ci: assert that we sample certain transitions (#6339)

It happened in the past that we screwed up the `preconditions` of the
state machine test such that no more transitions were sampled that
actually send packets. To protect against this, we use the newly
introduced logs and grep for certain transitions.

In the future, we can consider emitting a more structured output, like
writing all testcases to a DB and run more complex queries against it to
ensure that certain cases are covered.
This commit is contained in:
Thomas Eizinger
2024-08-19 23:40:43 +01:00
committed by GitHub
parent f9fb7531cc
commit 504e823a02

View File

@@ -88,6 +88,9 @@ jobs:
- uses: ./.github/actions/setup-rust
id: setup-rust
- uses: ./.github/actions/setup-tauri
- uses: taiki-e/install-action@v2
with:
tool: ripgrep
- name: "cargo test"
shell: bash
run: |
@@ -95,6 +98,11 @@ jobs:
# First, run all tests.
cargo test --all-features ${{ steps.setup-rust.outputs.packages }} -- --include-ignored --nocapture
# Assert that we sample certain transitions
rg SendICMPPacketToCidrResource $TESTCASES_DIR
rg SendICMPPacketToDnsResource $TESTCASES_DIR
rg SendDnsQueries $TESTCASES_DIR
# Backup dumped state and transition samples
mv $TESTCASES_DIR $TESTCASES_BACKUP_DIR