Skip to content

Commit 6cc929d

Browse files
committed
fix(ci): smaller summary without skips
1 parent 27e9e59 commit 6cc929d

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
EOF
5959
6060
jq --slurp --raw-output '
61-
map(.failed_tests|map("\(.klass)#\(.NAME)")) | flatten | unique | sort | to_entries[]
61+
map(.failed_tests|map("\(.klass)#\(.NAME)")) | flatten | unique | sort[0:100] | to_entries[]
6262
| "<tr><td><strong>\(.key)</strong></td><td>\(.value)</td></tr>"
6363
' reports/*/report.json >>$GITHUB_STEP_SUMMARY
6464
@@ -67,6 +67,9 @@ jobs:
6767
</table>
6868
EOF
6969
70+
# Do not print json if too large.
71+
[[ "$(du -s reports | cut -f1)" -gt 124 ]] && exit 0
72+
7073
echo >>$GITHUB_STEP_SUMMARY
7174
echo '```json' >>$GITHUB_STEP_SUMMARY
7275
jq --slurp --compact-output '.' reports/*/report.json >>$GITHUB_STEP_SUMMARY

.github/workflows/flaky.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
name: report-${{ matrix.crdb }}-${{ matrix.ruby }}-${{ matrix.seed }}
7373
path: report.json
7474
collect:
75-
if: failure()
75+
if: failure() || cancelled()
7676
needs: test
7777
runs-on: ubuntu-latest
7878
steps:
@@ -97,7 +97,7 @@ jobs:
9797
EOF
9898
9999
jq --slurp --raw-output '
100-
sort_by(.total_time)[]
100+
sort_by(.total_time)[0:100][]
101101
| {seed, time: .total_time | strftime("%H:%M:%S"), failure: .failed_tests[0].NAME }
102102
| "<tr><td>\(.seed)</td><td>\(.time)</td><td>\(.failure)</td></tr>"
103103
' reports/*/report.json >> $GITHUB_STEP_SUMMARY
@@ -107,6 +107,10 @@ jobs:
107107
</tbody>
108108
</table>
109109
EOF
110+
111+
# Do not print json if too large.
112+
[[ "$(du -s reports | cut -f1)" -gt 124 ]] && exit 0
113+
110114
echo >> $GITHUB_STEP_SUMMARY
111115
echo '```json' >> $GITHUB_STEP_SUMMARY
112116
jq --slurp --compact-output '.' reports/*/report.json >> $GITHUB_STEP_SUMMARY

lib/active_record/connection_adapters/cockroachdb/quoting.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,18 @@ module Quoting
3434
# but when creating objects, using RGeo features is more convenient than
3535
# converting to WKB, so this does it automatically.
3636
def quote(value)
37-
if value.is_a?(Numeric)
37+
case value
38+
when Numeric
3839
# NOTE: The fact that integers are quoted is important and helps
3940
# mitigate a potential vulnerability.
4041
#
4142
# See
4243
# - https://nvd.nist.gov/vuln/detail/CVE-2022-44566
4344
# - https://github.com/cockroachdb/activerecord-cockroachdb-adapter/pull/280#discussion_r1288692977
4445
"'#{quote_string(value.to_s)}'"
45-
elsif RGeo::Feature::Geometry.check_type(value)
46+
when RGeo::Feature::Geometry
4647
"'#{RGeo::WKRep::WKBGenerator.new(hex_format: true, type_format: :ewkb, emit_ewkb_srid: true).generate(value)}'"
47-
elsif value.is_a?(RGeo::Cartesian::BoundingBox)
48+
when RGeo::Cartesian::BoundingBox
4849
"'#{value.min_x},#{value.min_y},#{value.max_x},#{value.max_y}'::box"
4950
else
5051
super

test/cases/helper_cockroachdb.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def report
180180
seed: Minitest.seed,
181181
assertions: assertions,
182182
count: count,
183-
failed_tests: results,
183+
failed_tests: results.reject(&:skipped?),
184184
total_time: total_time,
185185
failures: failures,
186186
errors: errors,

0 commit comments

Comments
 (0)