Build and Test#
This section outlines how to build and test the p99-bluesky project.
Running Tests#
To execute the test suite in your terminal, use tox:
tox -p
The -p flag enables parallel test execution, which significantly speeds up the process.
Understanding tox#
In the p99-bluesky project, tox is configured to run a series of commands defined in the pyproject.toml file. These commands can also be executed individually in your terminal.
commands =
pre-commit: pre-commit run --all-files {posargs}
type-checking: pyright src tests {posargs}
tests: pytest --cov=p99_bluesky --cov-report term --cov-report xml:cov.xml {posargs}
docs: sphinx-{posargs:build -EW --keep-going} -T docs build/html
Code Formatting and Linting#
To automatically correct code formatting and linting errors identified by ruff, run the following command:
ruff check ./src/p99_bluesky --fix
This command will apply fixes to the source code directly. It is recommended to run this command before committing changes.
Running System Tests#
To run system you are required to have access to Athena services. You will also need p99 RabbitMQ Password which can be found on k8s-p99.
pytest ./system_tests/ --password <Password>