From 504e823a02ebd416beb240084f707caebe38a9c8 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Mon, 19 Aug 2024 23:40:43 +0100 Subject: [PATCH] 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. --- .github/workflows/_rust.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/_rust.yml b/.github/workflows/_rust.yml index 301b487a9..5976026fc 100644 --- a/.github/workflows/_rust.yml +++ b/.github/workflows/_rust.yml @@ -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