Build and Test#

This section outlines how to build and test the sm-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 sm-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 --show-diff-on-failure {posargs}
    type-checking: pyright src tests {posargs}
    tests: pytest --cov=sm_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/sm-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 and RabbitMQ Password.

pytest ./system_tests/<beamline> --password <Password>