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

chore: Make contrib test pluggable #2654

Merged
merged 9 commits into from
May 10, 2022

Conversation

pyalex
Copy link
Collaborator

@pyalex pyalex commented May 9, 2022

Signed-off-by: Oleksii Moskalenko [email protected]

What this PR does / why we need it:

This decouples contrib tests from our main tests.

Instead of adding each new docker container to main conftest.py this PR proposes to use PYTEST_PLUGIN environment.
Thus all contrib related code (including data source creator) moved to feast.infra.offline_stores.contrib.

Which issue(s) this PR fixes:

Fixes #

Signed-off-by: Oleksii Moskalenko <[email protected]>
Signed-off-by: Oleksii Moskalenko <[email protected]>
@codecov-commenter
Copy link

codecov-commenter commented May 9, 2022

Codecov Report

Merging #2654 (55d9d79) into master (1e02066) will increase coverage by 0.04%.
The diff coverage is 65.76%.

@@            Coverage Diff             @@
##           master    #2654      +/-   ##
==========================================
+ Coverage   80.54%   80.58%   +0.04%     
==========================================
  Files         163      165       +2     
  Lines       13815    13727      -88     
==========================================
- Hits        11127    11062      -65     
+ Misses       2688     2665      -23     
Flag Coverage Δ
integrationtests 71.25% <97.05%> (-0.37%) ⬇️
unittests 58.66% <42.34%> (+0.05%) ⬆️

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

Impacted Files Coverage Δ
...s/contrib/spark_offline_store/tests/data_source.py 40.42% <ø> (ø)
...thon/feast/infra/online_stores/contrib/postgres.py 32.69% <0.00%> (ø)
...s/integration/registration/test_universal_types.py 98.78% <ø> (ø)
...s/contrib/trino_offline_store/tests/data_source.py 47.05% <25.00%> (ø)
...ts/integration/feature_repos/repo_configuration.py 89.44% <50.00%> (ø)
...ontrib/postgres_offline_store/tests/data_source.py 51.02% <51.02%> (ø)
...fline_stores/contrib/contrib_repo_configuration.py 100.00% <100.00%> (ø)
...s/contrib/postgres_offline_store/tests/__init__.py 100.00% <100.00%> (ø)
...line_stores/contrib/postgres_repo_configuration.py 100.00% <100.00%> (ø)
...ib/trino_offline_store/test_config/manual_tests.py 100.00% <100.00%> (ø)
... and 13 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 1e02066...55d9d79. Read the comment docs.

Signed-off-by: Oleksii Moskalenko <[email protected]>
@pyalex pyalex requested a review from achals May 9, 2022 23:17
@felixwang9817 felixwang9817 changed the title chore: Make contrib test plugable chore: Make contrib test pluggable May 9, 2022
pyalex added 4 commits May 9, 2022 17:31
Signed-off-by: Oleksii Moskalenko <[email protected]>
Signed-off-by: Oleksii Moskalenko <[email protected]>
Signed-off-by: Oleksii Moskalenko <[email protected]>

test-python-universal-postgres:
PYTHONPATH='.' \
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.offline_stores.contrib.postgres_repo_configuration \
PYTEST_PLUGINS=sdk.python.feast.infra.offline_stores.contrib.postgres_offline_store.tests \
Copy link
Member

Choose a reason for hiding this comment

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

If you remove the PYTHONPATH, this can be updated to feast.infra.offline_stores.contrib.postgres_offline_store.tests right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the import logic is the same as in FULL_REPO_CONFIGS_MODULE. Since our working dir is repo root we're probably need sdk.python prefix.

@@ -164,110 +161,13 @@ def start_test_local_server(repo_path: str, port: int):
fs.serve("localhost", port, no_access_log=True)


class TrinoContainerSingleton:
Copy link
Member

Choose a reason for hiding this comment

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

Thank you for deleting this crap 🙏🏽

@contextlib.contextmanager
def setup_python_fs_client():
@pytest.fixture
def python_fs_client(request):
Copy link
Member

Choose a reason for hiding this comment

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

oh I'm dumb I see this now

Copy link
Member

@achals achals 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, pyalex

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:

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

@achals achals merged commit 30e0bf3 into feast-dev:master May 10, 2022
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.

4 participants