mirror of https://github.com/jackc/pgx.git
Run tests in parallel
parent
a8ac061b6a
commit
03f2d34486
|
@ -533,6 +533,8 @@ func TestParseConfigEnvLibpq(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParseConfigReadsPgPassfile(t *testing.T) {
|
func TestParseConfigReadsPgPassfile(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
tf, err := ioutil.TempFile("", "")
|
tf, err := ioutil.TempFile("", "")
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,8 @@ func TestConnect(t *testing.T) {
|
||||||
|
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
connString := os.Getenv(tt.env)
|
connString := os.Getenv(tt.env)
|
||||||
if connString == "" {
|
if connString == "" {
|
||||||
t.Skipf("Skipping due to missing environment variable %v", tt.env)
|
t.Skipf("Skipping due to missing environment variable %v", tt.env)
|
||||||
|
@ -45,6 +47,8 @@ func TestConnect(t *testing.T) {
|
||||||
// TestConnectTLS is separate from other connect tests because it has an additional test to ensure it really is a secure
|
// TestConnectTLS is separate from other connect tests because it has an additional test to ensure it really is a secure
|
||||||
// connection.
|
// connection.
|
||||||
func TestConnectTLS(t *testing.T) {
|
func TestConnectTLS(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
connString := os.Getenv("PGX_TEST_TLS_CONN_STRING")
|
connString := os.Getenv("PGX_TEST_TLS_CONN_STRING")
|
||||||
if connString == "" {
|
if connString == "" {
|
||||||
t.Skipf("Skipping due to missing environment variable %v", "PGX_TEST_TLS_CONN_STRING")
|
t.Skipf("Skipping due to missing environment variable %v", "PGX_TEST_TLS_CONN_STRING")
|
||||||
|
@ -61,6 +65,8 @@ func TestConnectTLS(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectInvalidUser(t *testing.T) {
|
func TestConnectInvalidUser(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
connString := os.Getenv("PGX_TEST_TCP_CONN_STRING")
|
connString := os.Getenv("PGX_TEST_TCP_CONN_STRING")
|
||||||
if connString == "" {
|
if connString == "" {
|
||||||
t.Skipf("Skipping due to missing environment variable %v", "PGX_TEST_TCP_CONN_STRING")
|
t.Skipf("Skipping due to missing environment variable %v", "PGX_TEST_TCP_CONN_STRING")
|
||||||
|
@ -97,6 +103,8 @@ func TestConnectWithConnectionRefused(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectCustomDialer(t *testing.T) {
|
func TestConnectCustomDialer(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
|
@ -113,6 +121,8 @@ func TestConnectCustomDialer(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectWithRuntimeParams(t *testing.T) {
|
func TestConnectWithRuntimeParams(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
|
@ -137,6 +147,8 @@ func TestConnectWithRuntimeParams(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectWithFallback(t *testing.T) {
|
func TestConnectWithFallback(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
|
@ -168,6 +180,8 @@ func TestConnectWithFallback(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectWithAfterConnectFunc(t *testing.T) {
|
func TestConnectWithAfterConnectFunc(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
|
@ -205,6 +219,8 @@ func TestConnectWithAfterConnectFunc(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnectWithAfterConnectTargetSessionAttrsReadWrite(t *testing.T) {
|
func TestConnectWithAfterConnectTargetSessionAttrsReadWrite(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
config, err := pgconn.ParseConfig(os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
|
|
||||||
|
@ -218,6 +234,8 @@ func TestConnectWithAfterConnectTargetSessionAttrsReadWrite(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnExec(t *testing.T) {
|
func TestConnExec(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
defer closeConn(t, pgConn)
|
defer closeConn(t, pgConn)
|
||||||
|
@ -229,6 +247,8 @@ func TestConnExec(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnExecMultipleQueries(t *testing.T) {
|
func TestConnExecMultipleQueries(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
defer closeConn(t, pgConn)
|
defer closeConn(t, pgConn)
|
||||||
|
@ -240,6 +260,8 @@ func TestConnExecMultipleQueries(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnExecMultipleQueriesError(t *testing.T) {
|
func TestConnExecMultipleQueriesError(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
defer closeConn(t, pgConn)
|
defer closeConn(t, pgConn)
|
||||||
|
@ -255,6 +277,8 @@ func TestConnExecMultipleQueriesError(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnExecContextCanceled(t *testing.T) {
|
func TestConnExecContextCanceled(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
defer closeConn(t, pgConn)
|
defer closeConn(t, pgConn)
|
||||||
|
@ -269,6 +293,8 @@ func TestConnExecContextCanceled(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnRecoverFromTimeout(t *testing.T) {
|
func TestConnRecoverFromTimeout(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
defer closeConn(t, pgConn)
|
defer closeConn(t, pgConn)
|
||||||
|
@ -291,6 +317,8 @@ func TestConnRecoverFromTimeout(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestConnCancelQuery(t *testing.T) {
|
func TestConnCancelQuery(t *testing.T) {
|
||||||
|
t.Parallel()
|
||||||
|
|
||||||
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
pgConn, err := pgconn.Connect(context.Background(), os.Getenv("PGX_TEST_DATABASE"))
|
||||||
require.Nil(t, err)
|
require.Nil(t, err)
|
||||||
defer closeConn(t, pgConn)
|
defer closeConn(t, pgConn)
|
||||||
|
|
Loading…
Reference in New Issue