Skip to content

Commit c02120d

Browse files
authored
chore: Fix integration test commands for contrib plugins + local integration tests. (feast-dev#3017)
* chore: Fix integration test commands for contrib plugins. Fix local integration tests to not depend on GCP Signed-off-by: Danny Chiao <danny@tecton.ai> * title Signed-off-by: Danny Chiao <danny@tecton.ai>
1 parent 95be28c commit c02120d

7 files changed

Lines changed: 113 additions & 64 deletions

File tree

CONTRIBUTING.md

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,42 @@
1-
# Development Guide: Main Feast Repository
1+
<h1>Development Guide: Main Feast Repository</h1>
2+
23
> Please see [Development Guide](https://docs.feast.dev/project/development-guide) for project level development instructions.
34
5+
<h2>Table of Contents</h2>
6+
7+
- [Overview](#overview)
8+
- [Community](#community)
9+
- [Making a pull request](#making-a-pull-request)
10+
- [Pull request checklist](#pull-request-checklist)
11+
- [Forking the repo](#forking-the-repo)
12+
- [Pre-commit Hooks](#pre-commit-hooks)
13+
- [Signing off commits](#signing-off-commits)
14+
- [Incorporating upstream changes from master](#incorporating-upstream-changes-from-master)
15+
- [Feast Python SDK / CLI](#feast-python-sdk--cli)
16+
- [Environment Setup](#environment-setup)
17+
- [Code Style & Linting](#code-style--linting)
18+
- [Unit Tests](#unit-tests)
19+
- [Integration Tests](#integration-tests)
20+
- [Local integration tests](#local-integration-tests)
21+
- [(Advanced) Full integration tests](#advanced-full-integration-tests)
22+
- [(Advanced) Running specific provider tests or running your test against specific online or offline stores](#advanced-running-specific-provider-tests-or-running-your-test-against-specific-online-or-offline-stores)
23+
- [(Experimental) Run full integration tests against containerized services](#experimental-run-full-integration-tests-against-containerized-services)
24+
- [Contrib integration tests](#contrib-integration-tests)
25+
- [(Contrib) Running tests for Spark offline store](#contrib-running-tests-for-spark-offline-store)
26+
- [(Contrib) Running tests for Trino offline store](#contrib-running-tests-for-trino-offline-store)
27+
- [(Contrib) Running tests for Postgres offline store](#contrib-running-tests-for-postgres-offline-store)
28+
- [(Contrib) Running tests for Postgres online store](#contrib-running-tests-for-postgres-online-store)
29+
- [(Contrib) Running tests for HBase online store](#contrib-running-tests-for-hbase-online-store)
30+
- [(Experimental) Feast UI](#experimental-feast-ui)
31+
- [Feast Java Serving](#feast-java-serving)
32+
- [Feast Go Client](#feast-go-client)
33+
- [Environment Setup](#environment-setup-1)
34+
- [Building](#building)
35+
- [Code Style & Linting](#code-style--linting-1)
36+
- [Unit Tests](#unit-tests-1)
37+
- [Testing with Github Actions workflows](#testing-with-github-actions-workflows)
38+
- [Issues](#issues)
39+
440
## Overview
541
This guide is targeted at developers looking to contribute to Feast components in
642
the main Feast repository:
@@ -147,7 +183,7 @@ These tests create new temporary tables / datasets locally only, and they are cl
147183
make test-python-integration-local
148184
```
149185

150-
#### Full integration tests
186+
#### (Advanced) Full integration tests
151187
To test across clouds, on top of setting up Redis, you also need GCP / AWS / Snowflake setup.
152188

153189
> Note: you can manually control what tests are run today by inspecting
@@ -211,7 +247,7 @@ export SNOWFLAKE_CI_WAREHOUSE='[your warehouse]'
211247

212248
Then run `make test-python-integration`. Note that for Snowflake / GCP / AWS, this will create new temporary tables / datasets.
213249

214-
#### Running specific provider tests or running your test against specific online or offline stores
250+
#### (Advanced) Running specific provider tests or running your test against specific online or offline stores
215251

216252
1. If you don't need to have your test run against all of the providers(`gcp`, `aws`, and `snowflake`) or don't need to run against all of the online stores, you can tag your test with specific providers or stores that you need(`@pytest.mark.universal_online_stores` or `@pytest.mark.universal_online_stores` with the `only` parameter). The `only` parameter selects specific offline providers and online stores that your test will test against. Example:
217253

@@ -245,7 +281,25 @@ The services with containerized replacements currently implemented are:
245281

246282
You can run `make test-python-integration-container` to run tests against the containerized versions of dependencies.
247283

248-
## Feast UI
284+
### Contrib integration tests
285+
#### (Contrib) Running tests for Spark offline store
286+
You can run `make test-python-universal-spark` to run all tests against the Spark offline store. (Note: you'll have to run `pip install -e ".[dev]"` first).
287+
288+
Not all tests are passing yet
289+
290+
#### (Contrib) Running tests for Trino offline store
291+
You can run `make test-python-universal-trino` to run all tests against the Trino offline store. (Note: you'll have to run `pip install -e ".[dev]"` first)
292+
293+
#### (Contrib) Running tests for Postgres offline store
294+
TODO
295+
296+
#### (Contrib) Running tests for Postgres online store
297+
TODO
298+
299+
#### (Contrib) Running tests for HBase online store
300+
TODO
301+
302+
## (Experimental) Feast UI
249303
See [Feast contributing guide](ui/CONTRIBUTING.md)
250304

251305
## Feast Java Serving

Makefile

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,9 @@ test-python-integration-local:
7979
FEAST_IS_LOCAL_TEST=True \
8080
FEAST_LOCAL_ONLINE_CONTAINER=True \
8181
python -m pytest -n 8 --integration \
82-
-k "not test_apply_entity_integration and \
83-
not test_apply_feature_view_integration and \
84-
not test_apply_data_source_integration and \
85-
not test_lambda_materialization and \
86-
not test_feature_view_inference_success and \
87-
not test_update_file_data_source_with_inferred_event_timestamp_col and \
88-
not test_nullable_online_store" \
82+
-k "not gcs_registry and \
83+
not s3_registry and \
84+
not test_lambda_materialization" \
8985
sdk/python/tests \
9086
) || echo "This script uses Docker, and it isn't running - please start the Docker Daemon and try again!";
9187

@@ -97,9 +93,32 @@ test-python-integration-container:
9793
python -m pytest -n 8 --integration sdk/python/tests \
9894
) || echo "This script uses Docker, and it isn't running - please start the Docker Daemon and try again!";
9995

100-
test-python-universal-contrib:
96+
test-python-universal-spark:
10197
PYTHONPATH='.' \
102-
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.offline_stores.contrib.contrib_repo_configuration \
98+
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.offline_stores.contrib.spark_repo_configuration \
99+
PYTEST_PLUGINS=feast.infra.offline_stores.contrib.spark_offline_store.tests \
100+
FEAST_USAGE=False IS_TEST=True \
101+
python -m pytest -n 8 --integration \
102+
-k "not test_historical_retrieval_fails_on_validation and \
103+
not test_historical_retrieval_with_validation and \
104+
not test_historical_features_persisting and \
105+
not test_historical_retrieval_fails_on_validation and \
106+
not test_universal_cli and \
107+
not test_go_feature_server and \
108+
not test_feature_logging and \
109+
not test_reorder_columns and \
110+
not test_logged_features_validation and \
111+
not test_lambda_materialization_consistency and \
112+
not test_offline_write and \
113+
not test_push_features_to_offline_store.py and \
114+
not gcs_registry and \
115+
not s3_registry and \
116+
not test_universal_types" \
117+
sdk/python/tests
118+
119+
test-python-universal-trino:
120+
PYTHONPATH='.' \
121+
FULL_REPO_CONFIGS_MODULE=sdk.python.feast.infra.offline_stores.contrib.trino_repo_configuration \
103122
PYTEST_PLUGINS=feast.infra.offline_stores.contrib.trino_offline_store.tests \
104123
FEAST_USAGE=False IS_TEST=True \
105124
python -m pytest -n 8 --integration \
@@ -110,6 +129,13 @@ test-python-universal-contrib:
110129
not test_universal_cli and \
111130
not test_go_feature_server and \
112131
not test_feature_logging and \
132+
not test_reorder_columns and \
133+
not test_logged_features_validation and \
134+
not test_lambda_materialization_consistency and \
135+
not test_offline_write and \
136+
not test_push_features_to_offline_store.py and \
137+
not gcs_registry and \
138+
not s3_registry and \
113139
not test_universal_types" \
114140
sdk/python/tests
115141

sdk/python/feast/infra/offline_stores/contrib/contrib_repo_configuration.py renamed to sdk/python/feast/infra/offline_stores/contrib/spark_repo_configuration.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
from feast.infra.offline_stores.contrib.spark_offline_store.tests.data_source import (
22
SparkDataSourceCreator,
33
)
4-
from feast.infra.offline_stores.contrib.trino_offline_store.tests.data_source import (
5-
TrinoSourceCreator,
6-
)
74
from tests.integration.feature_repos.repo_configuration import REDIS_CONFIG
85
from tests.integration.feature_repos.universal.online_store.redis import (
96
RedisOnlineStoreCreator,
107
)
118

129
AVAILABLE_OFFLINE_STORES = [
1310
("local", SparkDataSourceCreator),
14-
("local", TrinoSourceCreator),
1511
]
1612

1713
AVAILABLE_ONLINE_STORES = {"redis": (REDIS_CONFIG, RedisOnlineStoreCreator)}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from feast.infra.offline_stores.contrib.trino_offline_store.tests.data_source import (
2+
TrinoSourceCreator,
3+
)
4+
from tests.integration.feature_repos.repo_configuration import REDIS_CONFIG
5+
from tests.integration.feature_repos.universal.online_store.redis import (
6+
RedisOnlineStoreCreator,
7+
)
8+
9+
AVAILABLE_OFFLINE_STORES = [
10+
("local", TrinoSourceCreator),
11+
]
12+
13+
AVAILABLE_ONLINE_STORES = {"redis": (REDIS_CONFIG, RedisOnlineStoreCreator)}

sdk/python/tests/integration/registration/test_feature_store.py

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@
3030
from feast.infra.online_stores.sqlite import SqliteOnlineStoreConfig
3131
from feast.repo_config import RepoConfig
3232
from feast.types import Array, Bytes, Float64, Int64, String
33-
from tests.utils.data_source_test_creator import (
34-
prep_file_source,
35-
simple_bq_source_using_query_arg,
36-
simple_bq_source_using_table_arg,
37-
)
33+
from tests.utils.data_source_test_creator import prep_file_source
3834

3935

4036
@pytest.mark.integration
@@ -96,50 +92,19 @@ def test_feature_view_inference_success(test_feature_store, dataframe_source):
9692
tags={},
9793
)
9894

99-
fv2 = FeatureView(
100-
name="fv2",
101-
entities=[entity],
102-
ttl=timedelta(minutes=5),
103-
online=True,
104-
batch_source=simple_bq_source_using_table_arg(dataframe_source, "ts_1"),
105-
tags={},
106-
)
107-
108-
fv3 = FeatureView(
109-
name="fv3",
110-
entities=[entity],
111-
ttl=timedelta(minutes=5),
112-
online=True,
113-
batch_source=simple_bq_source_using_query_arg(dataframe_source, "ts_1"),
114-
tags={},
115-
)
116-
117-
test_feature_store.apply([entity, fv1, fv2, fv3]) # Register Feature Views
95+
test_feature_store.apply([entity, fv1]) # Register Feature Views
11896
feature_view_1 = test_feature_store.list_feature_views()[0]
119-
feature_view_2 = test_feature_store.list_feature_views()[1]
120-
feature_view_3 = test_feature_store.list_feature_views()[2]
12197

12298
actual_file_source = {
12399
(feature.name, feature.dtype) for feature in feature_view_1.features
124100
}
125-
actual_bq_using_table_arg_source = {
126-
(feature.name, feature.dtype) for feature in feature_view_2.features
127-
}
128-
actual_bq_using_query_arg_source = {
129-
(feature.name, feature.dtype) for feature in feature_view_3.features
130-
}
131101
expected = {
132102
("float_col", Float64),
133103
("int64_col", Int64),
134104
("string_col", String),
135105
}
136106

137-
assert (
138-
expected
139-
== actual_file_source
140-
== actual_bq_using_table_arg_source
141-
== actual_bq_using_query_arg_source
142-
)
107+
assert expected == actual_file_source
143108

144109
test_feature_store.teardown()
145110

sdk/python/tests/integration/registration/test_inference.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,7 @@
55
from feast import RepoConfig
66
from feast.errors import RegistryInferenceFailure
77
from feast.inference import update_data_sources_with_inferred_event_timestamp_col
8-
from tests.utils.data_source_test_creator import (
9-
prep_file_source,
10-
simple_bq_source_using_query_arg,
11-
simple_bq_source_using_table_arg,
12-
)
8+
from tests.utils.data_source_test_creator import prep_file_source
139

1410

1511
@pytest.mark.integration
@@ -20,8 +16,6 @@ def test_update_file_data_source_with_inferred_event_timestamp_col(simple_datase
2016
with prep_file_source(df=simple_dataset_1) as file_source:
2117
data_sources = [
2218
file_source,
23-
simple_bq_source_using_table_arg(simple_dataset_1),
24-
simple_bq_source_using_query_arg(simple_dataset_1),
2519
]
2620
update_data_sources_with_inferred_event_timestamp_col(
2721
data_sources, RepoConfig(provider="local", project="test")
@@ -30,7 +24,7 @@ def test_update_file_data_source_with_inferred_event_timestamp_col(simple_datase
3024
source.timestamp_field for source in data_sources
3125
]
3226

33-
assert actual_event_timestamp_cols == ["ts_1", "ts_1", "ts_1"]
27+
assert actual_event_timestamp_cols == ["ts_1"]
3428

3529
with prep_file_source(df=df_with_two_viable_timestamp_cols) as file_source:
3630
with pytest.raises(RegistryInferenceFailure):

sdk/python/tests/utils/e2e_test_validation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ def make_feature_store_yaml(project, test_repo_config, repo_dir_name: Path):
199199
),
200200
]
201201

202-
if os.getenv("FEAST_IS_LOCAL_TEST", "False") == "True":
202+
# Only test if this is NOT a local test
203+
if os.getenv("FEAST_IS_LOCAL_TEST", "False") != "True":
203204
NULLABLE_ONLINE_STORE_CONFIGS.extend(
204205
[
205206
IntegrationTestRepoConfig(

0 commit comments

Comments
 (0)