From 366c8b019f024ece101dbc50145f097bc970fc95 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 21 Oct 2022 12:04:44 -0400 Subject: [PATCH] ci: Update bfs to 2.6.2 --- .github/workflows/compat.yml | 15 ++------------- util/diff-bfs.sh | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 13 deletions(-) create mode 100755 util/diff-bfs.sh diff --git a/.github/workflows/compat.yml b/.github/workflows/compat.yml index 38c50cca..541984e6 100644 --- a/.github/workflows/compat.yml +++ b/.github/workflows/compat.yml @@ -90,7 +90,7 @@ jobs: with: repository: tavianator/bfs path: bfs - ref: '2.6' + ref: '2.6.2' - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -137,18 +137,7 @@ jobs: - name: Compare failing tests against main shell: bash run: | - OLD_FAILING=$(sed -n "s/^\([[:print:]]\+\) failed\!/\1/p" dl/tests.log | sort) - NEW_FAILING=$(sed -n "s/^\([[:print:]]\+\) failed\!/\1/p" bfs/tests.log | sort) - for LINE in $OLD_FAILING; do - if ! grep -Fxq $LINE<<<"$NEW_FAILING"; then - echo "::warning ::Congrats! The bfs test $LINE is now passing!" - fi - done - for LINE in $NEW_FAILING; do - if ! grep -Fxq $LINE<<<"$OLD_FAILING"; then - echo "::error ::bfs test failed: $LINE. $LINE is passing on 'main'. Maybe you have to rebase?" - fi - done + ./findutils/util/diff-bfs.sh dl/tests.log bfs/tests.log - name: Compare against main results shell: bash run: | diff --git a/util/diff-bfs.sh b/util/diff-bfs.sh new file mode 100755 index 00000000..098ba2ac --- /dev/null +++ b/util/diff-bfs.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -eu + +export LC_COLLATE=C + +# Extract the failing test lines from log files +failing_tests() { + sed -n 's/^\([[:print:]]\+\) failed\!/\1/p' "$1" | sort +} + +comm -3 <(failing_tests "$1") <(failing_tests "$2") | tr '\t' ',' | while IFS=, read old new; do + if [ -n "$old" ]; then + echo "::warning ::Congrats! The bfs test $old is now passing!" + fi + if [ -n "$new" ]; then + echo "::error ::bfs test failed: $new. $new is passing on 'main'. Maybe you have to rebase?" + fi +done