Skip to content

Commit

Permalink
Simplify unused snapshot check (#1525)
Browse files Browse the repository at this point in the history
  • Loading branch information
harupy committed Jan 1, 2023
1 parent 4b8e30f commit e3867b1
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/ci.yaml
Expand Up @@ -116,18 +116,12 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- run: cargo install cargo-insta
- run: pip install black[d]==22.12.0
- name: Run tests
run: |
export INSTA_SNAPSHOT_REFERENCES_FILE="$(mktemp)"
cargo test --all
USED_SNAPSHOTS=$(cat $INSTA_SNAPSHOT_REFERENCES_FILE | xargs realpath --relative-to $PWD)
UNUSED_SNAPSHOTS=$(cat <(git ls-files '*.snap') <(echo "$USED_SNAPSHOTS") | sort | uniq -u)
if [ ! -z "$UNUSED_SNAPSHOTS" ]; then
echo "Found unused snapshots:"
echo "$UNUSED_SNAPSHOTS"
exit 1
fi
cargo insta test --all --delete-unreferenced-snapshots
git diff --exit-code
- run: cargo test --package ruff --test black_compatibility_test -- --ignored

# TODO(charlie): Re-enable the `wasm-pack` tests.
Expand Down

0 comments on commit e3867b1

Please sign in to comment.