Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make model-archiver tests runnable from any directory #2191

Merged
merged 2 commits into from
Mar 22, 2023

Conversation

mreso
Copy link
Collaborator

@mreso mreso commented Mar 22, 2023

Description

So far tests for model-archiver had to be called from model-archiver folder. This PR changes this to make them callable from any folder.

The rest is just pre-commit beautification.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

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.

  • ~/serve$ pytest model-archiver/model_archiver/tests/
========================================================================================= test session starts =========================================================================================
platform linux -- Python 3.9.16, pytest-7.2.2, pluggy-1.0.0
rootdir: /home/ubuntu/serve/model-archiver
plugins: mock-3.10.0, cov-4.0.0
collected 28 items

model-archiver/model_archiver/tests/integ_tests/test_integration_model_archiver.py ..                                                                                                           [  7%]
model-archiver/model_archiver/tests/unit_tests/test_model_packaging.py ....                                                                                                                     [ 21%]
model-archiver/model_archiver/tests/unit_tests/test_model_packaging_utils.py .....................                                                                                              [ 96%]
model-archiver/model_archiver/tests/unit_tests/test_version.py .                                                                                                                                [100%]

========================================================================================= 28 passed in 0.59s ==========================================================================================
  • ~/serve/model-archiver$ pytest model_archiver/tests/
========================================================================================= test session starts =========================================================================================
platform linux -- Python 3.9.16, pytest-7.2.2, pluggy-1.0.0
rootdir: /home/ubuntu/serve/model-archiver
plugins: mock-3.10.0, cov-4.0.0
collected 28 items

model_archiver/tests/integ_tests/test_integration_model_archiver.py ..                                                                                                                          [  7%]
model_archiver/tests/unit_tests/test_model_packaging.py ....                                                                                                                                    [ 21%]
model_archiver/tests/unit_tests/test_model_packaging_utils.py .....................                                                                                                             [ 96%]
model_archiver/tests/unit_tests/test_version.py .                                                                                                                                               [100%]

========================================================================================= 28 passed in 0.57s ==========================================================================================

Checklist:

  • Did you have fun?
  • Have you added tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Merging #2191 (dd1cc93) into master (6daaa42) will not change coverage.
The diff coverage is n/a.

❗ Current head dd1cc93 differs from pull request most recent head 2bc7547. Consider uploading reports for the commit 2bc7547 to get more accurate results

@@           Coverage Diff           @@
##           master    #2191   +/-   ##
=======================================
  Coverage   71.45%   71.45%           
=======================================
  Files          73       73           
  Lines        3296     3296           
  Branches       57       57           
=======================================
  Hits         2355     2355           
  Misses        941      941           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mreso mreso changed the title [WIP] Make model-archiver tests runnable from any directory Make model-archiver tests runnable from any directory Mar 22, 2023
@mreso mreso merged commit c164374 into master Mar 22, 2023
@mreso mreso deleted the better_engineering/model_archiver_tests branch March 22, 2023 23:52
morgandu pushed a commit to morgandu/pytorch-serve that referenced this pull request Mar 25, 2023
* Make model-archiver tests independent from caller directory

* Make model-archiver tests callable from any directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants