Skip to content

CLI and Library Tests

Jeffrey Lester edited this page Dec 4, 2023 · 3 revisions

Tests

Tests are broken into CLI and library tests. PRs and updates to PRs targeting the master branch trigger the following workflows:

  • .github/workflows/cli-tests.yml
  • .github/workflows/lib-tests.yml
  • .github/workflows/test-release.yml

To learn more about the workflows, visit the GitHub workflows overview.

Install Test Packages

The testing package can be installed by running the install.sh script in the repository's root directory or by installing the package directly via:

pip install --editable src/test/

CLI Tests

CLI tests are built using Click's CLI runner and thoroughly test the CLI's commands and options. The tests and related logic are stored in src/test/src/cli/.

To execute the CLI test runner, run:

python src/test/src/cli/runner.py

Library Tests

Library tests are built using JSON files containing various tests for each module. The tests and related logic are stored in src/test/src/lib/. The JSON specs for each test type are stored in src/test/src/lib/specs.py, and new module tests are added in src/test/src/lib/json/. Tests are executed in the order they are defined in the JSON files.

To execute the library tests runner, run:

python src/test/src/lib/runner.py

To execute a specific module test, run:

python src/test/src/lib/runner.py ${MODULE}