Skip to content

Commit

Permalink
slightly more sensible test names (#1428)
Browse files Browse the repository at this point in the history
Signed-off-by: Oleg Avdeev <oleg.v.avdeev@gmail.com>
  • Loading branch information
oavdeev committed Mar 31, 2021
1 parent ae477dd commit 97e7d55
Show file tree
Hide file tree
Showing 15 changed files with 317 additions and 319 deletions.
52 changes: 0 additions & 52 deletions sdk/python/tests/cli/test_cli_local.py

This file was deleted.

58 changes: 0 additions & 58 deletions sdk/python/tests/cli/test_datastore.py

This file was deleted.

87 changes: 0 additions & 87 deletions sdk/python/tests/cli/test_e2e_local.py

This file was deleted.

78 changes: 0 additions & 78 deletions sdk/python/tests/cli/test_online_retrieval.py

This file was deleted.

41 changes: 0 additions & 41 deletions sdk/python/tests/cli/test_partial_apply.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def local_repo(self, example_repo_py: str):
result = self.run(["apply", str(repo_path)], cwd=repo_path)
assert result.returncode == 0

yield FeatureStore(repo_path=repo_path, config=None)
yield FeatureStore(repo_path=str(repo_path), config=None)

result = self.run(["teardown", str(repo_path)], cwd=repo_path)
assert result.returncode == 0
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
driver = Entity(name="driver_id", value_type=ValueType.INT64, description="driver id",)


driver_hourly_stats = FeatureView(
driver_hourly_stats_view = FeatureView(
name="driver_hourly_stats",
entities=["driver_id"],
ttl=Duration(seconds=86400 * 1),
Expand Down
File renamed without changes.
55 changes: 55 additions & 0 deletions sdk/python/tests/test_cli_gcp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import random
import string
import tempfile
from pathlib import Path
from textwrap import dedent

import pytest

from feast.feature_store import FeatureStore
from tests.cli_utils import CliRunner
from tests.online_read_write_test import basic_rw_test


@pytest.mark.integration
def test_basic() -> None:
project_id = "".join(
random.choice(string.ascii_lowercase + string.digits) for _ in range(10)
)
runner = CliRunner()
with tempfile.TemporaryDirectory() as repo_dir_name, tempfile.TemporaryDirectory() as data_dir_name:

repo_path = Path(repo_dir_name)
data_path = Path(data_dir_name)

repo_config = repo_path / "feature_store.yaml"

repo_config.write_text(
dedent(
f"""
project: {project_id}
metadata_store: {data_path / "metadata.db"}
provider: gcp
"""
)
)

repo_example = repo_path / "example.py"
repo_example.write_text(
(Path(__file__).parent / "example_feature_repo_1.py").read_text()
)

result = runner.run(["apply", str(repo_path)], cwd=repo_path)
assert result.returncode == 0

# Doing another apply should be a no op, and should not cause errors
result = runner.run(["apply", str(repo_path)], cwd=repo_path)
assert result.returncode == 0

basic_rw_test(
FeatureStore(repo_path=str(repo_path), config=None),
view_name="driver_locations",
)

result = runner.run(["teardown", str(repo_path)], cwd=repo_path)
assert result.returncode == 0

0 comments on commit 97e7d55

Please sign in to comment.