Add ability to read query from file to postgresql_extensible input (#6361)
This commit is contained in:
committed by
Daniel Nelson
parent
bae12dde1e
commit
d717e8ea03
@@ -25,7 +25,7 @@ func queryRunner(t *testing.T, q query) *testutil.Accumulator {
|
||||
}
|
||||
var acc testutil.Accumulator
|
||||
p.Start(&acc)
|
||||
|
||||
p.Init()
|
||||
require.NoError(t, acc.GatherError(p.Gather))
|
||||
return &acc
|
||||
}
|
||||
@@ -201,6 +201,31 @@ func TestPostgresqlFieldOutput(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPostgresqlSqlScript(t *testing.T) {
|
||||
q := query{{
|
||||
Script: "testdata/test.sql",
|
||||
Version: 901,
|
||||
Withdbname: false,
|
||||
Tagvalue: "",
|
||||
}}
|
||||
p := &Postgresql{
|
||||
Service: postgresql.Service{
|
||||
Address: fmt.Sprintf(
|
||||
"host=%s user=postgres sslmode=disable",
|
||||
testutil.GetLocalHost(),
|
||||
),
|
||||
IsPgBouncer: false,
|
||||
},
|
||||
Databases: []string{"postgres"},
|
||||
Query: q,
|
||||
}
|
||||
var acc testutil.Accumulator
|
||||
p.Start(&acc)
|
||||
p.Init()
|
||||
|
||||
require.NoError(t, acc.GatherError(p.Gather))
|
||||
}
|
||||
|
||||
func TestPostgresqlIgnoresUnwantedColumns(t *testing.T) {
|
||||
if testing.Short() {
|
||||
t.Skip("Skipping integration test in short mode")
|
||||
|
||||
Reference in New Issue
Block a user