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

Move UTs to separate directory, add pytest to pre-commit #1109

Merged
merged 16 commits into from
Apr 21, 2021

Conversation

shreyamalviya
Copy link
Contributor

@shreyamalviya shreyamalviya commented Apr 19, 2021

Fixes #1102

Some test files were in their own "tests/" directory. Deleted the extra "tests/" directories.
Shift it from monkey/pytest.ini to pyproject.toml.
Add conftest.py in tests/ to add monkey directory to sys.path so test files recognize paths.
@codecov
Copy link

codecov bot commented Apr 19, 2021

Codecov Report

Merging #1109 (753c058) into develop (57f8f20) will increase coverage by 0.11%.
The diff coverage is 100.00%.

❗ Current head 753c058 differs from pull request most recent head 7c452d0. Consider uploading reports for the commit 7c452d0 to get more accurate results
Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1109      +/-   ##
===========================================
+ Coverage    29.01%   29.13%   +0.11%     
===========================================
  Files          409      410       +1     
  Lines        12911    12934      +23     
===========================================
+ Hits          3746     3768      +22     
- Misses        9165     9166       +1     
Impacted Files Coverage Δ
...onkey/tests/infection_monkey/telemetry/conftest.py 100.00% <ø> (ø)
monkey/tests/monkey_island/cc/conftest.py 100.00% <ø> (ø)
monkey/tests/conftest.py 100.00% <100.00%> (ø)
monkey/__init__.py 0.00% <0.00%> (-100.00%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57f8f20...7c452d0. Read the comment docs.

The pytest documentation states that the testpaths configuration option
"Sets list of directories that should be searched ... when executing
pytest from the rootdir directory." Since pytest is not executed from
the rootdir directory, testpaths has no effect. Appending the "tests/"
directory to the end of addopts reduces the time required to run the
test suite by approximately 6 seconds.
@mssalvatore mssalvatore merged commit 297c702 into develop Apr 21, 2021
@mssalvatore mssalvatore deleted the unit-tests branch April 21, 2021 12:11
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.

Move all UT's into a dedicated directory
2 participants