serve
serve copied to clipboard
Refactor sanity checks to use pytest
Description
This PR follows https://github.com/pytorch/serve/pull/2219 and refactors the sanity checks to use pytest
Type of change
Please delete options that are not relevant.
- [X] New feature (non-breaking change which adds functionality)
Feature/Issue validation/testing
Please describe the Unit or Integration tests that you ran to verify your changes and relevant result summary. Provide instructions so it can be reproduced. Please also list any relevant details for your test configuration.
- [X] pytest test/pytest/sanity
========================================================================================================================================================================== test session starts ===========================================================================================================================================================================
platform linux -- Python 3.9.16, pytest-7.2.2, pluggy-1.0.0
rootdir: /home/ubuntu/serve
plugins: mock-3.10.0, cov-4.0.0
collected 22 items
test/pytest/sanity/test_config_snapshot.py . [ 4%]
test/pytest/sanity/test_model_registering.py ..................... [100%]/home/ubuntu/miniconda3/envs/microbatching/lib/python3.9/site-packages/coverage/control.py:858: CoverageWarning: No data was collected. (no-data-collected)
self._warn("No data was collected.", slug="no-data-collected")
---------- coverage: platform linux, python 3.9.16-final-0 -----------
Coverage XML written to file test/pytest/sanity/coverage.xml
===================================================================================================================================================================== 22 passed in 307.21s (0:05:07) =====================================================================================================================================================================
- [X] python torchserve_sanity.py See PR checks
Checklist:
- [X] Did you have fun?
- [X] Have you added tests that prove your fix is effective or that this feature works?
- [X] Has code been commented, particularly in hard-to-understand areas?
Codecov Report
Merging #2221 (cf179e6) into master (9c52043) will decrease coverage by
0.08%. The diff coverage isn/a.
:exclamation: Current head cf179e6 differs from pull request most recent head f72fc13. Consider uploading reports for the commit f72fc13 to get more accurate results
@@ Coverage Diff @@
## master #2221 +/- ##
==========================================
- Coverage 72.44% 72.36% -0.08%
==========================================
Files 85 85
Lines 3963 3963
Branches 58 58
==========================================
- Hits 2871 2868 -3
- Misses 1088 1091 +3
Partials 4 4
see 1 file with indirect coverage changes
:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more
Currently regression test run test/pytest.
With these changes, tt seems that regression test will also run test_sanity. Do we need this duplicate work?
@lxning good point! Have changes the PR so that sanity tests are ignored when regression tests run