This commit is contained in:
rahulpinto19
2026-02-02 13:30:55 +00:00
parent a6335c3797
commit ff874ef385
2 changed files with 5 additions and 6 deletions

View File

@@ -615,7 +615,7 @@ func GetMySQLWants() (string, string, string, string) {
// compatible with postgres-sql tool
func SetupPostgresSQLTable(t *testing.T, ctx context.Context, pool *pgxpool.Pool, createStatement, insertStatement, tableName string, params []any) func(*testing.T) {
t.Fatalf("return failure for the teardwon1 testing fro the tesetcleanup")
err := pool.Ping(ctx)
if err != nil {
t.Fatalf("unable to connect to test database: %s", err)
@@ -623,9 +623,10 @@ func SetupPostgresSQLTable(t *testing.T, ctx context.Context, pool *pgxpool.Pool
// Create table
_, err = pool.Query(ctx, createStatement)
if err != nil {
t.Fatalf("unable to create test table %s: %s", tableName, err)
}
// if err != nil {
// t.Fatalf("unable to create test table %s: %s", tableName, err)
// }
t.Fatalf("unable to create test table %s: %s", tableName, err)
// Insert test data
_, err = pool.Query(ctx, insertStatement, params...)

View File

@@ -96,7 +96,6 @@ func TestPostgres(t *testing.T) {
// cleanup test environment
// tests.CleanupPostgresTables(t, ctx, pool)
t.Cleanup(func() {
fmt.Println("this is executed after the failure");
tests.CleanupPostgresTables(t, context.Background(), pool)
})
@@ -108,7 +107,6 @@ func TestPostgres(t *testing.T) {
// set up data for param tool
createParamTableStmt, insertParamTableStmt, paramToolStmt, idParamToolStmt, nameParamToolStmt, arrayToolStmt, paramTestParams := tests.GetPostgresSQLParamToolInfo(tableNameParam)
teardownTable1 := tests.SetupPostgresSQLTable(t, ctx, pool, createParamTableStmt, insertParamTableStmt, tableNameParam, paramTestParams)
fmt.Println("here passing error in teardownTable1");
defer teardownTable1(t)
// set up data for auth tool