Skip to content

Commit 97e7d55

Browse files
authored
slightly more sensible test names (feast-dev#1428)
Signed-off-by: Oleg Avdeev <oleg.v.avdeev@gmail.com>
1 parent ae477dd commit 97e7d55

15 files changed

+317
-319
lines changed

sdk/python/tests/cli/test_cli_local.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

sdk/python/tests/cli/test_datastore.py

Lines changed: 0 additions & 58 deletions
This file was deleted.

sdk/python/tests/cli/test_e2e_local.py

Lines changed: 0 additions & 87 deletions
This file was deleted.

sdk/python/tests/cli/test_online_retrieval.py

Lines changed: 0 additions & 78 deletions
This file was deleted.

sdk/python/tests/cli/test_partial_apply.py

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def local_repo(self, example_repo_py: str):
6161
result = self.run(["apply", str(repo_path)], cwd=repo_path)
6262
assert result.returncode == 0
6363

64-
yield FeatureStore(repo_path=repo_path, config=None)
64+
yield FeatureStore(repo_path=str(repo_path), config=None)
6565

6666
result = self.run(["teardown", str(repo_path)], cwd=repo_path)
6767
assert result.returncode == 0
File renamed without changes.

sdk/python/tests/cli/example_feature_repo_2.py renamed to sdk/python/tests/example_feature_repo_2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
driver = Entity(name="driver_id", value_type=ValueType.INT64, description="driver id",)
1313

1414

15-
driver_hourly_stats = FeatureView(
15+
driver_hourly_stats_view = FeatureView(
1616
name="driver_hourly_stats",
1717
entities=["driver_id"],
1818
ttl=Duration(seconds=86400 * 1),
File renamed without changes.

sdk/python/tests/test_cli_gcp.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import random
2+
import string
3+
import tempfile
4+
from pathlib import Path
5+
from textwrap import dedent
6+
7+
import pytest
8+
9+
from feast.feature_store import FeatureStore
10+
from tests.cli_utils import CliRunner
11+
from tests.online_read_write_test import basic_rw_test
12+
13+
14+
@pytest.mark.integration
15+
def test_basic() -> None:
16+
project_id = "".join(
17+
random.choice(string.ascii_lowercase + string.digits) for _ in range(10)
18+
)
19+
runner = CliRunner()
20+
with tempfile.TemporaryDirectory() as repo_dir_name, tempfile.TemporaryDirectory() as data_dir_name:
21+
22+
repo_path = Path(repo_dir_name)
23+
data_path = Path(data_dir_name)
24+
25+
repo_config = repo_path / "feature_store.yaml"
26+
27+
repo_config.write_text(
28+
dedent(
29+
f"""
30+
project: {project_id}
31+
metadata_store: {data_path / "metadata.db"}
32+
provider: gcp
33+
"""
34+
)
35+
)
36+
37+
repo_example = repo_path / "example.py"
38+
repo_example.write_text(
39+
(Path(__file__).parent / "example_feature_repo_1.py").read_text()
40+
)
41+
42+
result = runner.run(["apply", str(repo_path)], cwd=repo_path)
43+
assert result.returncode == 0
44+
45+
# Doing another apply should be a no op, and should not cause errors
46+
result = runner.run(["apply", str(repo_path)], cwd=repo_path)
47+
assert result.returncode == 0
48+
49+
basic_rw_test(
50+
FeatureStore(repo_path=str(repo_path), config=None),
51+
view_name="driver_locations",
52+
)
53+
54+
result = runner.run(["teardown", str(repo_path)], cwd=repo_path)
55+
assert result.returncode == 0

0 commit comments

Comments
 (0)