Skip to content

Commit

Permalink
fix suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: troychiu <[email protected]>
  • Loading branch information
troychiu committed Mar 15, 2024
1 parent 3f9c131 commit 1608f89
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions flyteadmin/tests/attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestUpdateClusterResourceAttributes(t *testing.T) {
ctx := context.Background()
client, conn := GetTestAdminServiceClient()
defer conn.Close()
db, err := repositories.GetDB(ctx, getDbConfig(), getLoggerConfig())
db, err := repositories.GetDB(ctx, getDbConfigWithEnv(), getLoggerConfig())
assert.Nil(t, err)
truncateTableForTesting(db, "resources")
sqlDB, err := db.DB()
Expand Down Expand Up @@ -130,7 +130,7 @@ func TestUpdateProjectDomainAttributes(t *testing.T) {
ctx := context.Background()
client, conn := GetTestAdminServiceClient()
defer conn.Close()
db, err := repositories.GetDB(ctx, getDbConfig(), getLoggerConfig())
db, err := repositories.GetDB(ctx, getDbConfigWithEnv(), getLoggerConfig())
assert.Nil(t, err)
truncateTableForTesting(db, "resources")
sqlDB, err := db.DB()
Expand Down Expand Up @@ -242,7 +242,7 @@ func TestUpdateWorkflowAttributes(t *testing.T) {
client, conn := GetTestAdminServiceClient()
defer conn.Close()

db, err := repositories.GetDB(ctx, getDbConfig(), getLoggerConfig())
db, err := repositories.GetDB(ctx, getDbConfigWithEnv(), getLoggerConfig())
assert.Nil(t, err)
truncateTableForTesting(db, "resources")
sqlDB, err := db.DB()
Expand Down Expand Up @@ -303,7 +303,7 @@ func TestListAllMatchableAttributes(t *testing.T) {
client, conn := GetTestAdminServiceClient()
defer conn.Close()

db, err := repositories.GetDB(ctx, getDbConfig(), getLoggerConfig())
db, err := repositories.GetDB(ctx, getDbConfigWithEnv(), getLoggerConfig())
assert.Nil(t, err)
truncateTableForTesting(db, "resources")
sqlDB, err := db.DB()
Expand Down
4 changes: 2 additions & 2 deletions flyteadmin/tests/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ var adminScope = promutils.NewScope("flyteadmin")

func getDbConfigWithEnv() *database.DbConfig {
if os.Getenv(integrationTestConfigEnvVar) == "True" {
return getDbConfig()
return getIntegrationDbConfig()
} else {
return getSandboxDbConfig()
}
}

func getDbConfig() *database.DbConfig {
func getIntegrationDbConfig() *database.DbConfig {
return &database.DbConfig{
Postgres: database.PostgresConfig{
Host: "postgres",
Expand Down
2 changes: 1 addition & 1 deletion flyteadmin/tests/execution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func populateWorkflowExecutionsForTestingOnly() {
fmt.Sprintf(insertExecutionQueryStr, "project1", "domain2", "name1", "RUNNING", 1, 2),
fmt.Sprintf(insertExecutionQueryStr, "project2", "domain2", "name1", "SUCCEEDED", 1, 2),
}
db, err := repositories.GetDB(context.Background(), getDbConfig(), getLoggerConfig())
db, err := repositories.GetDB(context.Background(), getDbConfigWithEnv(), getLoggerConfig())
ctx := context.Background()
if err != nil {
logger.Fatalf(ctx, "Failed to open DB connection due to %v", err)
Expand Down

0 comments on commit 1608f89

Please sign in to comment.