Skip to content

tests: Cram to Prysk#2003

Draft
joverlee521 wants to merge 7 commits into
masterfrom
cram-to-prysk
Draft

tests: Cram to Prysk#2003
joverlee521 wants to merge 7 commits into
masterfrom
cram-to-prysk

Conversation

@joverlee521

Copy link
Copy Markdown
Contributor

Description of proposed changes

Demo of migrating from Cram to Prysk, which is the maintained fork of Cram.

Prysk has a pytest plugin that works with pytest-xdist to run tests in parallel without any custom code.

With this change, all tests are runnable with run_test.sh or pytest

./run_tests.sh -n auto
pytest -n auto

Run subset of function tests with -k

./run_tests.sh -k tests/functional/filter/cram/filter

Related issue(s)

Alternative to #1995

Checklist

  • Automated checks pass
  • Check if you need to add a changelog message
  • Check if you need to add tests
  • Check if you need to update docs
  • figure out coverage
  • rename all cram to prysk (?)

This commit switches our Cram tests to Prysk, which is a fork of the
Cram project. Prysk has a pytest plugin to run the tests as part of
pytest. This opens the way to use pytest-xdist to run tests in parallel.

All tests pass when running `prysk` directly, but there are errors when
running prysk with pytest. Those errors will be fixed in the following
commit.
pytest-xdist is a plugin that extends pytest to distribute tests across
multiple CPUs to speed up test execution.
Switches pytest to run with all available cores. This includes the
Prysk tests which are now run as part of pytest.
This fails in the pytest-prsyk runs because the temporary directory
used by pytest does not include the `include-file.t` string.
I'm not sure if it's worth looking into, but modifying this test for now
to see if all tests pass in CI.
Since the pytest-xdist workers as randomly assigned, mixing the short
running unit tests and the long running functional tests might result
in an uneven spread of tests among workers. Run them separately so that
the long running functional tests can be spread evenly.
run_tests.sh should just run Prysk tests with the pytest and partial
tests with -k will automatically work.
Base automatically changed from update-cram-tmp to master May 19, 2026 23:12
Comment thread .github/workflows/ci.yaml
echo "Running cram tests without coverage"
echo "Running prysk tests without coverage"
export AUGUR="${{ github.workspace }}/bin/augur"
pytest --no-cov -n auto tests/functional/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, some tests (e.g.) are running slower because the auto-detect is only creating 2 workers instead of the expected 4. Not sure what's going on here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant