Skip to content

Commit

Permalink
fix go tests
Browse files Browse the repository at this point in the history
Signed-off-by: Danny Chiao <danny@tecton.ai>
  • Loading branch information
adchia committed Aug 18, 2022
1 parent bdf2e46 commit 87c43fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions go/internal/feast/onlinestore/sqliteonlinestore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@ import (

func TestSqliteAndFeatureRepoSetup(t *testing.T) {
dir := t.TempDir()
feature_repo_path := filepath.Join(dir, "feature_repo")
feature_repo_path := filepath.Join(dir, "my_project", "feature_repo")

err := test.SetupCleanFeatureRepo(dir)
assert.Nil(t, err)
config, err := registry.NewRepoConfigFromFile(feature_repo_path)
assert.Nil(t, err)
assert.Equal(t, "feature_repo", config.Project)
assert.Equal(t, "my_project", config.Project)
assert.Equal(t, "data/registry.db", config.GetRegistryConfig().Path)
assert.Equal(t, "local", config.Provider)
assert.Equal(t, map[string]interface{}{
"path": "data/online_store.db",
"type": "sqlite",
}, config.OnlineStore)
assert.Empty(t, config.OfflineStore)
assert.Empty(t, config.FeatureServer)
Expand All @@ -35,12 +36,12 @@ func TestSqliteAndFeatureRepoSetup(t *testing.T) {

func TestSqliteOnlineRead(t *testing.T) {
dir := t.TempDir()
feature_repo_path := filepath.Join(dir, "feature_repo")
feature_repo_path := filepath.Join(dir, "my_project", "feature_repo")
test.SetupCleanFeatureRepo(dir)
config, err := registry.NewRepoConfigFromFile(feature_repo_path)
assert.Nil(t, err)

store, err := NewSqliteOnlineStore("feature_repo", config, config.OnlineStore)
store, err := NewSqliteOnlineStore("my_project", config, config.OnlineStore)
defer store.Destruct()
assert.Nil(t, err)
entity_key1 := types.EntityKey{
Expand Down
4 changes: 2 additions & 2 deletions go/internal/test/go_integration_test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func GetLatestFeatures(Rows []*Row, entities map[int64]bool) map[int64]*Row {
}

func SetupCleanFeatureRepo(basePath string) error {
cmd := exec.Command("feast", "init", "feature_repo")
cmd := exec.Command("feast", "init", "my_project")
path, err := filepath.Abs(basePath)
cmd.Env = os.Environ()

Expand All @@ -102,7 +102,7 @@ func SetupCleanFeatureRepo(basePath string) error {
}
applyCommand := exec.Command("feast", "apply")
applyCommand.Env = os.Environ()
featureRepoPath, err := filepath.Abs(filepath.Join(path, "feature_repo"))
featureRepoPath, err := filepath.Abs(filepath.Join(path, "my_project", "feature_repo"))
if err != nil {
return err
}
Expand Down

0 comments on commit 87c43fe

Please sign in to comment.