package store import "testing" // 1889/AC1: the checker's integration store answers on a unix socket named in the address's query // (mesh-build-go's store). A test database's address that drops the query reaches pgx's default socket, // where no server is, and every store test waits out its 20 s and fails. func TestATestDatabaseIsOnTheSocketItsAdminAddressNames(t *testing.T) { admin := "postgres://postgres@/postgres?host=%2Fwork%2Frun-1%2Fpg%2Fsocket&sslmode=disable" got := DatabaseForTest(admin, "ident_1_x") want := "postgres://postgres@/ident_1_x?host=%2Fwork%2Frun-1%2Fpg%2Fsocket&sslmode=disable" if got != want { t.Fatalf("the test database's address is %q, want %q", got, want) } } // 1889/AC2: the address `make check` gives (TCP, with sslmode) builds what the fixtures always built. func TestATestDatabaseOnTCPIsAddressedAsBefore(t *testing.T) { admin := "postgres://postgres:check@127.0.0.1:55566/postgres?sslmode=disable" got := DatabaseForTest(admin, "inv_2_y") want := "postgres://postgres:check@127.0.0.1:55566/inv_2_y?sslmode=disable" if got != want { t.Fatalf("the test database's address is %q, want %q", got, want) } }