Running the Automated Tests¶
To run ESLint by itself, you may run the lint task:
Or to automatically fix issues found (where possible):
yarn lint --fix
You can also check against Prettier:
and to have it actually fix (to the best of its ability) any format issues, just do:
See the code style section for more details.
Running the Jest front-end unit tests¶
The unit tests for the UI are run with [Jest].
To run the tests:
- If you haven't already done so, install local dependencies by running
yarn installfrom the project root.
- Then run
yarn testto execute the tests.
The tests will perform an initial run and then re-execute each time a project file is changed.
To run all Python tests, including linting, sorting, etc:
% pip install tox % tox
NOTE: For instructions on how to run tests outside of Docker look at tests/README.md. Running them within Docker is still the recommended option.
Running a specific set of Python tests¶
Here are some examples of ways to run the python tests with varying levels of specificity:
docker-compose run backend pytest tests/
docker-compose run backend pytest tests/etl/
test_ingest_pending_pulse_job within the
docker-compose run backend pytest tests/ -k test_ingest_pending_pulse_job
The Selenium tests are written in Python, so when you execute some of the commands above, you will execute the Selenium tests as well.
The Selenium tests require a UI build:
docker-compose up --build docker-compose run backend pytest tests/selenium/