From 6f70efe180b342e26ee151d44f20d8ab47b7775d Mon Sep 17 00:00:00 2001 From: femi Date: Fri, 24 Jul 2026 07:29:25 +0100 Subject: [PATCH 1/3] ci: add dedicated unit tests workflow The fast, unmarked pytest tests (log parsing, graph generation, start_node, request retry, disk cleanup) never ran in CI. repo_lint.yaml only lints; node_sync_test.yaml and db_sync_full_sync.yaml only run the marked live-sync tests; nix_smoke.yaml only triggers on Nix file changes and just does an import check. Added unit_tests.yaml: runs on every PR to main, plain ubuntu-latest, pip install -e . then pytest with everything marked node_sync, db_sync, snapshot_creation, local_snapshot, iohk_snapshot, or mainnet_tx_count excluded, leaving just the fast unmarked tests. --- .github/workflows/unit_tests.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/unit_tests.yaml diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml new file mode 100644 index 00000000..6ead2374 --- /dev/null +++ b/.github/workflows/unit_tests.yaml @@ -0,0 +1,31 @@ +name: unit_tests + +on: + pull_request: + branches: + - main + +env: + PY_COLORS: "1" + +jobs: + unit_tests: + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@v6 + - name: Set up python + uses: actions/setup-python@v7 + with: + python-version: '3.11' + - name: Install package + run: | + python3 -m venv .venv + source .venv/bin/activate + python3 -m pip install --require-virtualenv -e . + - name: Run unit tests + run: | + source .venv/bin/activate + pytest sync_tests/tests/ \ + -m "not (node_sync or db_sync or snapshot_creation or local_snapshot or iohk_snapshot or mainnet_tx_count)" \ + -v From a9f9f77979f61353961d448f79906a9a18e0b439 Mon Sep 17 00:00:00 2001 From: femi Date: Fri, 24 Jul 2026 07:33:12 +0100 Subject: [PATCH 2/3] fix(ci): scope unit_tests.yaml token to read-only CodeQL flagged the job for not limiting GITHUB_TOKEN permissions. This workflow only checks out the repo and runs pytest, so contents: read is all it needs. --- .github/workflows/unit_tests.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 6ead2374..266e4495 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -5,6 +5,9 @@ on: branches: - main +permissions: + contents: read + env: PY_COLORS: "1" From 769bd911a49bac3dfa59ef7bc94a564c044b8769 Mon Sep 17 00:00:00 2001 From: femi Date: Thu, 30 Jul 2026 11:29:43 +0100 Subject: [PATCH 3/3] fix: point unit_tests.yaml at framework_tests Framework tests moved to a top-level framework_tests/ directory in #165. This workflow still targeted sync_tests/tests/ with a marker-exclusion filter, which after that move would just select zero tests, silently. Now runs pytest framework_tests directly, no filter needed, same as how cardano-node-tests invokes its equivalent in code_checks.yaml. Verified by simulating the exact CI steps in a fresh venv: fresh install via pip install -e ., then pytest framework_tests -v, 20 passed. --- .github/workflows/unit_tests.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 266e4495..6cff28b2 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -29,6 +29,4 @@ jobs: - name: Run unit tests run: | source .venv/bin/activate - pytest sync_tests/tests/ \ - -m "not (node_sync or db_sync or snapshot_creation or local_snapshot or iohk_snapshot or mainnet_tx_count)" \ - -v + pytest framework_tests -v