nlp-recipes/tests
Miguel González-Fierro 2c37bf0892
Merge pull request #190 from microsoft/bert-ss
Bert sentence encoder
2019-07-25 09:35:30 +01:00
..
ci removed repeated instructions, added durations and revert back to nlpmachine 2019-07-23 17:39:28 +01:00
integration remove senteval notebooks and integration tests 2019-07-19 18:26:55 +00:00
smoke merge staging and fix 🐛 2019-07-15 16:31:38 +00:00
unit notebook test 2019-07-24 11:32:36 -04:00
README.md add comments to tests/readme 2019-06-26 10:53:32 -04:00
__init__.py Intial commit to put the receipe template in 2019-04-05 13:55:58 -04:00
conftest.py notebook test 2019-07-24 11:32:36 -04:00
notebooks_common.py added data integration tests with notebooks 2019-05-24 14:26:36 +00:00

README.md

Tests

This project uses unit, smoke and integration tests with Python files and notebooks. For more information, see a quick introduction to unit, smoke and integration tests. To manually execute the unit tests in the different environments, first make sure you are in the correct environment as described in the SETUP.md.

Tests are automatically run as part of a DevOps pipeline. The pipelines are defined in .yml files in tests/ci with filenames that align with pipeline names.

Test execution

Click on the following menus to see more details on how to execute the unit, smoke and integration tests:

Unit tests

Unit tests ensure that each class or function behaves as it should. Every time a developer makes a pull request to staging or master branch, a battery of unit tests is executed.

For executing the Python unit tests for the utilities:

pytest tests/unit -m "not notebooks and not gpu"

For executing the Python unit tests for the notebooks:

pytest tests/unit -m "notebooks and not gpu"

For executing the Python GPU unit tests for the utilities:

pytest tests/unit -m "not notebooks and gpu"

For executing the Python GPU unit tests for the notebooks:

pytest tests/unit -m "notebooks and gpu"
Smoke tests

Smoke tests make sure that the system works and are executed just before the integration tests every night.

For executing the Python smoke tests:

pytest tests/smoke -m "smoke and not gpu"

For executing the Python GPU smoke tests:

pytest tests/smoke -m "smoke and gpu"
Integration tests

Integration tests make sure that the program results are acceptable

For executing the Python integration tests:

pytest tests/integration -m "integration and not gpu"

For executing the Python GPU integration tests:

pytest tests/integration -m "integration and gpu"

How to create tests on notebooks with Papermill

In the notebooks of these repo we use Papermill in unit, smoke and integration tests.

In the unit tests we just make sure the notebook runs. In the smoke tests, we run them with a small dataset or a small number of epochs to make sure that, apart from running, they provide reasonable metrics. Finally, in the integration tests, we use a bigger dataset for more epochs and we test that the metrics are what we expect.

For a deep overview on how to integrate papermill on unit, smoke and integration test, please refer to this guide from Microsoft Recommenders repo.

More details on how to integrate Papermill with notebooks can be found in their repo.