-
Notifications
You must be signed in to change notification settings - Fork 951
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
slightly more sensible test names (#1428)
Signed-off-by: Oleg Avdeev <oleg.v.avdeev@gmail.com>
- Loading branch information
Showing
15 changed files
with
317 additions
and
319 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.