Improved Pg test matrix (#616)

* Add postgres 10/11 to test  matrix
* Add docker-compose file fo running multiple postgres versions locally
* Fix client test for pg 10, modify function details to include specific fields
* Try to install latest postgres client
* Add concurrency setting
This commit is contained in:
Dan Sosedoff
2022-12-12 18:58:00 -06:00
committed by GitHub
parent 4c40eef99a
commit 0dfec506cf
6 changed files with 77 additions and 11 deletions

View File

@@ -7,6 +7,7 @@ import (
"os/exec"
"runtime"
"sort"
"strings"
"testing"
"time"
@@ -143,7 +144,7 @@ func teardownClient() {
}
}
func teardown() {
func teardown(t *testing.T, allowFail bool) {
output, err := exec.Command(
testCommands["dropdb"],
"-U", serverUser,
@@ -152,9 +153,13 @@ func teardown() {
serverDatabase,
).CombinedOutput()
if err != nil {
fmt.Println("Teardown error:", err)
fmt.Printf("%s\n", output)
if err != nil && strings.Contains(err.Error(), "does not exist") {
t.Log("Teardown error:", err)
t.Logf("%s\n", output)
if !allowFail {
assert.NoError(t, err)
}
}
}
@@ -602,7 +607,7 @@ func TestAll(t *testing.T) {
initVars()
setupCommands()
teardown()
teardown(t, false)
setup()
setupClient()
@@ -632,5 +637,5 @@ func TestAll(t *testing.T) {
testDumpExport(t)
teardownClient()
teardown()
teardown(t, true)
}