Add dedicated unit tests workflow - #162
Merged
Merged
Conversation
5 tasks
There was a problem hiding this comment.
Pull request overview
Adds a new GitHub Actions workflow to ensure the repo’s fast, unmarked Python pytest tests run in CI on every PR targeting main, while continuing to exclude the slower/live-sync test suites via marker filtering.
Changes:
- Introduces a dedicated
unit_testsworkflow that runs onpull_requesttomain. - Sets up Python 3.11 on
ubuntu-latest, installs the package, and runs pytest with marker-based exclusions to target only the fast unmarked tests.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
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.
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.
OlufemiAdeOlusile
force-pushed
the
ci/add-unit-tests-workflow
branch
from
July 30, 2026 10:29
52cfd5d to
769bd91
Compare
mkoura
approved these changes
Jul 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The fast, unmarked pytest tests (log parsing, graph generation, start_node, request retry, disk cleanup) never ran in CI:
Added unit_tests.yaml: runs on every PR to main, plain ubuntu-latest (no self-hosted runner needed since these are pure Python tests with no live node/db-sync involved), installs the package via pip, then runs 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.
Test plan