diff --git a/pkg/scalers/postgres_scaler_test.go b/pkg/scalers/postgres_scaler_test.go deleted file mode 100644 index 118033b41f6..00000000000 --- a/pkg/scalers/postgres_scaler_test.go +++ /dev/null @@ -1,65 +0,0 @@ -package scalers - -import ( - "database/sql" - "fmt" - "testing" -) - - -func TestPostgrestQuery(t *testing.T) { - pgpassword := "g880VzeVAu" - meta := &postGRESMetadata{ - "postgres", - pgpassword, - "localhost", - "5433", - "SELECT COUNT(*) FROM task_instance WHERE state!='running'", - "postgres", - "disable", - } - db, err := getConnection(meta) - if err != nil { - t.Error("Could not create PG connection") - } - var id int - err = db.QueryRow("SELECT SUM(bar) FROM foo").Scan(&id) - if err != nil { - t.Error(fmt.Sprintf("Could not query PG: %s", err)) - } - if id != 3 { - t.Error(fmt.Sprintf("wrong number of rows: %d", id)) - } - defer db.Close() - -} - -func TestPostgrestQuery2(t *testing.T) { - //pgpassword := "g880VzeVAu" - //meta := &postGRESMetadata{ - // "airflow", - // "", - // "localhost", - // "5432", - // "SELECT COUNT(*) FROM task_instance", - // "airflow", - // "disable", - //} - //db, err := getConnection(meta) - db, err := sql.Open("postgres", "postgresql://airflow:airflow@localhost:5432/airflow?sslmode=disable") - - if err != nil { - t.Error("Could not create PG connection") - } - var id int - err = db.QueryRow("SELECT COUNT (*) FROM task_instance").Scan(&id) - if err != nil { - t.Error(fmt.Sprintf("Could not query PG: %s", err)) - } - if id != 1 { - t.Error(fmt.Sprintf("wrong number of rows: %d", id)) - } - defer db.Close() - -} -