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

Fix pytest_collection_modifyitems to select benchmark tests only #1874

Merged
merged 2 commits into from
Sep 16, 2021

Conversation

achals
Copy link
Member

@achals achals commented Sep 16, 2021

Signed-off-by: Achal Shah achals@gmail.com

What this PR does / why we need it:
Fixes a bug. Additionally, remove test items instead of skipping them. This makes --collect-only more useful, since that flag doesn't filter out skipped flags.
Which issue(s) this PR fixes:

Fixes #

Does this PR introduce a user-facing change?:

none

:

Signed-off-by: Achal Shah <achals@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2021

Codecov Report

Merging #1874 (582087d) into master (c6bcb46) will decrease coverage by 22.21%.
The diff coverage is 58.82%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #1874       +/-   ##
===========================================
- Coverage   84.58%   62.37%   -22.22%     
===========================================
  Files          93       93               
  Lines        7273     7282        +9     
===========================================
- Hits         6152     4542     -1610     
- Misses       1121     2740     +1619     
Flag Coverage Δ
integrationtests ?
unittests 62.37% <58.82%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdk/python/tests/conftest.py 71.87% <58.82%> (-28.13%) ⬇️
.../integration/online_store/test_universal_online.py 14.73% <0.00%> (-85.27%) ⬇️
.../integration/online_store/test_online_retrieval.py 17.39% <0.00%> (-82.61%) ⬇️
sdk/python/tests/utils/online_read_write_test.py 18.18% <0.00%> (-81.82%) ⬇️
...fline_store/test_universal_historical_retrieval.py 18.69% <0.00%> (-80.49%) ⬇️
...gration/registration/test_feature_service_apply.py 31.25% <0.00%> (-68.75%) ⬇️
...istration/test_universal_odfv_feature_inference.py 35.71% <0.00%> (-64.29%) ⬇️
sdk/python/feast/infra/online_stores/datastore.py 30.32% <0.00%> (-63.12%) ⬇️
sdk/python/feast/infra/online_stores/redis.py 30.35% <0.00%> (-62.50%) ⬇️
sdk/python/tests/data/data_creator.py 38.09% <0.00%> (-61.91%) ⬇️
... and 43 more

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 c6bcb46...582087d. Read the comment docs.

@felixwang9817 felixwang9817 requested review from a team and removed request for a team, adchia, tsotnet and woop September 16, 2021 18:48
@felixwang9817 felixwang9817 self-assigned this Sep 16, 2021
@achals achals requested a review from adchia as a code owner September 16, 2021 18:56
if not should_run_integration:
for t in integration_tests:
items.remove(t)
else:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like these are exclusive?

If the user does should_run_integration and should_run_benchmark, it ends up only running benchmark tests.

I'd expect this more to be

if not should_run_integration, remove integration tests
if not should_run_benchmarks, remove benchmarks
done

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the current behaviour to be exclusive.

if user specifies --benchmark and --integration, it runs tests marked with both. If the user specified only one of them, it runs tests with only those marks.

i prefer this behaviour since otherwise we run unit tests during all our integration tests - which seems like a duplication and a waste. It also is more straightforward to reason about, IMO.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason why integration and benchmark tests are orthogonal is because it's possible for an integration test to need access to resources on aws/gcp, which requires the integration mark so that it can be set up correctly.

Signed-off-by: Achal Shah <achals@gmail.com>
@achals achals force-pushed the achal/fix-benchmark-selection branch from 8886373 to 582087d Compare September 16, 2021 19:37
@achals achals requested a review from adchia September 16, 2021 19:38
Copy link
Collaborator

@felixwang9817 felixwang9817 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: achals, felixwang9817

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [achals,felixwang9817]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@feast-ci-bot feast-ci-bot merged commit 8a49a65 into feast-dev:master Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants