chore: Generate environments for each individual test based on its markers/fixtures#2648
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2648 +/- ##
===========================================
- Coverage 80.55% 58.89% -21.66%
===========================================
Files 163 164 +1
Lines 13815 13761 -54
===========================================
- Hits 11128 8105 -3023
- Misses 2687 5656 +2969
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
134251c to
b58c052
Compare
There was a problem hiding this comment.
Seems like this should in a separate PR, unless it's fixing some bug.
There was a problem hiding this comment.
Can't we use the AVAILABLE_OFFLINE_STORES here as well? POSTGRES_ONLINE_CONFIG assumes you have a local version of postgres running and a containerized version is better.
sdk/python/tests/conftest.py
Outdated
There was a problem hiding this comment.
Should we get rid of the universal flag? since it doesn't seem like the online and offline versions are more versatile?
There was a problem hiding this comment.
So I need a name here that would represent that specific tests works with all offline stores (universal_offline_stores mark currently) or all online stores (universal_online_stores mark). Any ideas for a better name?
There was a problem hiding this comment.
I meant the pytest.mark.universal flag (since it seems like this the universal_online_stores and universal_offline_stores together would represent the same thing that current flag is supposed to represent).
There was a problem hiding this comment.
Got it. Removed universal.
There was a problem hiding this comment.
nit, from feast.entity import Entity (for tests)
Signed-off-by: Oleksii Moskalenko <[email protected]>
| Thread(target=worker, args=(status_info_counter,), daemon=True).start() | ||
|
|
||
| query = client.query(kind="Row", ancestor=key) | ||
| while True: |
There was a problem hiding this comment.
infinite looping here might hang the whole testing flow
sdk/python/tests/conftest.py
Outdated
| _config_cache = {} | ||
|
|
||
|
|
||
| def pytest_generate_tests(metafunc): |
There was a problem hiding this comment.
Can you add some docs to how this pytest_generate_tests thingy works? It's the first time I've seen it used and seems extremely powerful
sdk/python/tests/conftest.py
Outdated
There was a problem hiding this comment.
I meant the pytest.mark.universal flag (since it seems like this the universal_online_stores and universal_offline_stores together would represent the same thing that current flag is supposed to represent).
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: achals, pyalex The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Signed-off-by: Oleksii Moskalenko <[email protected]>
|
/lgtm Thanks for addressing! This looks great. |
Signed-off-by: Oleksii Moskalenko [email protected]
What this PR does / why we need it:
Test environment is being generated individually for each integration test based on its markers and/or requested fixtures. This allows us to drop some unnecessary use cases (eg, looping various online stores against test_historical_features) and shorten total run time.
The main change is
pytest_generate_testsfunction inconftest.pythat replaces static declaration of repo configs. It generates environments for each test and retrieves them from configs cache, so that environments could be shared between different tests.Which issue(s) this PR fixes:
Fixes #