computervision-recipes/tests
PatrickBue 3dc96e00f6
Update assets location (#637)
2021-01-21 13:12:19 -05:00
..
.ci Update submit_azureml_pytest.py 2020-07-11 10:57:21 -04:00
integration restore i3d + itegration test (#562) 2020-06-24 14:40:22 -04:00
smoke Video Dataset / Model refactor + framework for action tests (#477) 2020-03-26 13:06:55 -04:00
unit Update assets location (#637) 2021-01-21 13:12:19 -05:00
README.md restructure repo (#335) 2019-09-26 13:43:11 -04:00
__init__.py
conftest.py Update assets location (#637) 2021-01-21 13:12:19 -05:00
resources.py Adding coco functionality (#523) 2020-03-24 18:21:58 -04:00

README.md

Tests

This project provides folders for unit, smoke and integration tests with Python files and notebooks:

  • In the unit tests we just make sure the notebook runs.
  • In the smoke tests, we run AzureML notebooks.
  • The integration tests are used to check that the models are performing at a given threshold.

For more information, see a quick introduction to unit, smoke and integration tests.

Test execution

Click on the following menus to see more details on how to execute the unit and smoke 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.

Note that the next instructions execute the tests from the root folder.

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"

Note: today there are no specific gpu tests.

Smoke tests

The Smoke tests are notebooks that run on AzureML.

Note that the next instructions execute the tests from the root folder.

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"

Note: today there are no specific gpu tests.

Skipping Tests

In order to skip a test because there is an OS or upstream issue which cannot be resolved you can use pytest annotations.

Example:

@pytest.mark.skip(reason="<INSERT VALID REASON>")
@pytest.mark.skipif(sys.platform == 'win32', reason="Not implemented on Windows")
def test_to_skip():
    assert False

Papermill

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