mirror of
https://github.com/temporalio/temporal.git
synced 2026-08-30 18:41:49 -07:00
Parallelize integration tests (#9292)
## What changed? Made integration tests run in parallel. ## Why? Before: ~8min [[run](https://github.com/temporalio/temporal/actions/runs/21930252400/job/63333789136#step:7:1)] 🐢 After: ~3m [[run](https://github.com/temporalio/temporal/actions/runs/22114061618/job/63917852614?pr=9292)] 🐰 ## How did you test it? - [ ] built - [ ] run locally and tested manually - [x] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) ## Potential risks They are not known to be flaky; and anecdotally all passed on the first run.
This commit is contained in:
27
.github/workflows/linters.yml
vendored
27
.github/workflows/linters.yml
vendored
@@ -128,6 +128,32 @@ jobs:
|
||||
- name: check yaml formatting
|
||||
run: make lint-yaml
|
||||
|
||||
parallelize-tests:
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-go@v6
|
||||
with:
|
||||
go-version-file: "go.mod"
|
||||
check-latest: true
|
||||
cache: true
|
||||
|
||||
- name: check test parallelization
|
||||
run: make parallelize-tests
|
||||
|
||||
- name: check-is-dirty
|
||||
run: |
|
||||
if [[ -n $(git status --porcelain) ]]; then
|
||||
echo "Detected uncommitted changes after running parallelize-tests."
|
||||
echo "Run 'make parallelize-tests' locally and commit the changes."
|
||||
git status
|
||||
git diff
|
||||
exit 1
|
||||
fi
|
||||
|
||||
golangci:
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
@@ -163,6 +189,7 @@ jobs:
|
||||
- fmt-imports
|
||||
- lint-yaml
|
||||
- golangci
|
||||
- parallelize-tests
|
||||
runs-on: ubuntu-24.04-arm
|
||||
if: always()
|
||||
env:
|
||||
|
||||
4
Makefile
4
Makefile
@@ -417,6 +417,10 @@ fmt-imports: $(GCI) # Don't get confused, there is a single linter called gci, w
|
||||
@printf $(COLOR) "Formatting imports..."
|
||||
@$(GCI) write --skip-generated -s standard -s default ./*
|
||||
|
||||
parallelize-tests:
|
||||
@printf $(COLOR) "Add t.Parallel() to tests..."
|
||||
@go run ./cmd/tools/parallelize $(INTEGRATION_TEST_DIRS)
|
||||
|
||||
fmt-yaml: $(YAMLFMT)
|
||||
@printf $(COLOR) "Formatting YAML files..."
|
||||
@$(YAMLFMT) -conf .github/.yamlfmt .
|
||||
|
||||
15
cmd/tools/parallelize/main.go
Normal file
15
cmd/tools/parallelize/main.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"go.temporal.io/server/tools/parallelize"
|
||||
)
|
||||
|
||||
func main() {
|
||||
if err := parallelize.Main(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
@@ -120,6 +120,7 @@ func (s *recordingSession) Query(query string, args ...any) gocql.Query {
|
||||
}
|
||||
|
||||
func TestCassandraShardStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpCassandraTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -138,6 +139,7 @@ func TestCassandraShardStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraExecutionMutableStateStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpCassandraTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -161,6 +163,7 @@ func TestCassandraExecutionMutableStateStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraExecutionMutableStateTaskStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpCassandraTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -186,6 +189,7 @@ func TestCassandraExecutionMutableStateTaskStoreSuite(t *testing.T) {
|
||||
// TODO: Merge persistence-tests into the tests directory.
|
||||
|
||||
func TestCassandraHistoryStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpCassandraTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -199,6 +203,7 @@ func TestCassandraHistoryStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpCassandraTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -212,6 +217,7 @@ func TestCassandraTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraFairTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpCassandraTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -225,6 +231,7 @@ func TestCassandraFairTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraTaskQueueTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpCassandraTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -238,6 +245,7 @@ func TestCassandraTaskQueueTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraTaskQueueFairTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpCassandraTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -251,6 +259,7 @@ func TestCassandraTaskQueueFairTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraTaskQueueUserDataSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpCassandraTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -264,6 +273,7 @@ func TestCassandraTaskQueueUserDataSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraHistoryV2Persistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.HistoryV2PersistenceSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithCassandra(&persistencetests.TestBaseOptions{})
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -271,6 +281,7 @@ func TestCassandraHistoryV2Persistence(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraMetadataPersistenceV2(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.MetadataPersistenceSuiteV2)
|
||||
s.TestBase = persistencetests.NewTestBaseWithCassandra(&persistencetests.TestBaseOptions{})
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -278,6 +289,7 @@ func TestCassandraMetadataPersistenceV2(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraClusterMetadataPersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.ClusterMetadataManagerSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithCassandra(&persistencetests.TestBaseOptions{})
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -285,6 +297,7 @@ func TestCassandraClusterMetadataPersistence(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraQueuePersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.QueuePersistenceSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithCassandra(&persistencetests.TestBaseOptions{})
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -315,6 +328,7 @@ func TestCassandraQueueV2Persistence(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCassandraNexusEndpointPersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
cluster := persistencetests.NewTestClusterForCassandra(&persistencetests.TestBaseOptions{}, log.NewNoopLogger())
|
||||
cluster.SetupTestDatabase()
|
||||
t.Cleanup(cluster.TearDownTestDatabase)
|
||||
|
||||
@@ -19,6 +19,7 @@ import (
|
||||
)
|
||||
|
||||
func TestMySQLShardStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -37,6 +38,7 @@ func TestMySQLShardStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLExecutionMutableStateStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -60,6 +62,7 @@ func TestMySQLExecutionMutableStateStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLExecutionMutableStateTaskStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -83,6 +86,7 @@ func TestMySQLExecutionMutableStateTaskStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -96,6 +100,7 @@ func TestMySQLHistoryStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -113,6 +118,7 @@ func TestMySQLTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLFairTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -130,6 +136,7 @@ func TestMySQLFairTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLTaskQueueTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -143,6 +150,7 @@ func TestMySQLTaskQueueTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLTaskQueueFairTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -156,6 +164,7 @@ func TestMySQLTaskQueueFairTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLTaskQueueUserDataSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -169,6 +178,7 @@ func TestMySQLTaskQueueUserDataSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLVisibilityPersistenceSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := &VisibilityPersistenceSuite{
|
||||
TestBase: persistencetests.NewTestBaseWithSQL(persistencetests.GetMySQLTestClusterOption()),
|
||||
}
|
||||
@@ -178,6 +188,7 @@ func TestMySQLVisibilityPersistenceSuite(t *testing.T) {
|
||||
// TODO: Merge persistence-tests into the tests directory.
|
||||
|
||||
func TestMySQLHistoryV2PersistenceSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.HistoryV2PersistenceSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetMySQLTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -185,6 +196,7 @@ func TestMySQLHistoryV2PersistenceSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLMetadataPersistenceSuiteV2(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.MetadataPersistenceSuiteV2)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetMySQLTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -192,6 +204,7 @@ func TestMySQLMetadataPersistenceSuiteV2(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLQueuePersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.QueuePersistenceSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetMySQLTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -199,6 +212,7 @@ func TestMySQLQueuePersistence(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLClusterMetadataPersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.ClusterMetadataManagerSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetMySQLTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -208,6 +222,7 @@ func TestMySQLClusterMetadataPersistence(t *testing.T) {
|
||||
// SQL Store tests
|
||||
|
||||
func TestMySQLNamespaceSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -225,6 +240,7 @@ func TestMySQLNamespaceSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLQueueMessageSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -242,6 +258,7 @@ func TestMySQLQueueMessageSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLQueueMetadataSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -259,6 +276,7 @@ func TestMySQLQueueMetadataSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLMatchingTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -276,6 +294,7 @@ func TestMySQLMatchingTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLMatchingTaskV2Suite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -293,6 +312,7 @@ func TestMySQLMatchingTaskV2Suite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLMatchingTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -310,6 +330,7 @@ func TestMySQLMatchingTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLMatchingFairTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -327,6 +348,7 @@ func TestMySQLMatchingFairTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryShardSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -344,6 +366,7 @@ func TestMySQLHistoryShardSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryNodeSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -361,6 +384,7 @@ func TestMySQLHistoryNodeSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryTreeSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -378,6 +402,7 @@ func TestMySQLHistoryTreeSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryCurrentExecutionSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -395,6 +420,7 @@ func TestMySQLHistoryCurrentExecutionSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryCurrentChasmExecutionSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -412,6 +438,7 @@ func TestMySQLHistoryCurrentChasmExecutionSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryExecutionSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -429,6 +456,7 @@ func TestMySQLHistoryExecutionSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryTransferTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -446,6 +474,7 @@ func TestMySQLHistoryTransferTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryTimerTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -463,6 +492,7 @@ func TestMySQLHistoryTimerTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryReplicationTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -480,6 +510,7 @@ func TestMySQLHistoryReplicationTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryVisibilityTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -497,6 +528,7 @@ func TestMySQLHistoryVisibilityTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryReplicationDLQTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -514,6 +546,7 @@ func TestMySQLHistoryReplicationDLQTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryExecutionBufferSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -531,6 +564,7 @@ func TestMySQLHistoryExecutionBufferSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryExecutionActivitySuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -548,6 +582,7 @@ func TestMySQLHistoryExecutionActivitySuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryExecutionChildWorkflowSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -565,6 +600,7 @@ func TestMySQLHistoryExecutionChildWorkflowSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryExecutionTimerSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -582,6 +618,7 @@ func TestMySQLHistoryExecutionTimerSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryExecutionChasmSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -599,6 +636,7 @@ func TestMySQLHistoryExecutionChasmSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryExecutionRequestCancelSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -616,6 +654,7 @@ func TestMySQLHistoryExecutionRequestCancelSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryExecutionSignalSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -633,6 +672,7 @@ func TestMySQLHistoryExecutionSignalSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHistoryExecutionSignalRequestSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -650,6 +690,7 @@ func TestMySQLHistoryExecutionSignalRequestSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLVisibilitySuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewMySQLConfig()
|
||||
SetupMySQLDatabase(t, cfg)
|
||||
SetupMySQLSchema(t, cfg)
|
||||
@@ -667,6 +708,7 @@ func TestMySQLVisibilitySuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLClosedConnectionError(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
@@ -675,12 +717,14 @@ func TestMySQLClosedConnectionError(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLQueueV2(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
t.Cleanup(tearDown)
|
||||
RunQueueV2TestSuiteForSQL(t, testData.Factory)
|
||||
}
|
||||
|
||||
func TestMySQLNexusEndpointPersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
testData, tearDown := setUpMySQLTest(t)
|
||||
defer tearDown()
|
||||
|
||||
|
||||
@@ -684,11 +684,13 @@ func (p *PostgreSQLSuite) TestPostgreSQLNexusEndpointPersistence() {
|
||||
}
|
||||
|
||||
func TestPQ(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := &PostgreSQLSuite{pluginName: "postgres12"}
|
||||
suite.Run(t, s)
|
||||
}
|
||||
|
||||
func TestPGX(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := &PostgreSQLSuite{pluginName: "postgres12_pgx"}
|
||||
suite.Run(t, s)
|
||||
}
|
||||
|
||||
@@ -88,6 +88,7 @@ func LoadSchema(t *testing.T, db sqlplugin.AdminDB, schemaFile string) {
|
||||
}
|
||||
|
||||
func TestSQLiteExecutionMutableStateStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
logger := log.NewNoopLogger()
|
||||
factory := sql.NewFactory(
|
||||
@@ -121,6 +122,7 @@ func TestSQLiteExecutionMutableStateStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteExecutionMutableStateTaskStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
logger := log.NewNoopLogger()
|
||||
factory := sql.NewFactory(
|
||||
@@ -154,6 +156,7 @@ func TestSQLiteExecutionMutableStateTaskStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
logger := log.NewNoopLogger()
|
||||
factory := sql.NewFactory(
|
||||
@@ -177,6 +180,7 @@ func TestSQLiteHistoryStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
logger := log.NewNoopLogger()
|
||||
factory := sql.NewFactory(
|
||||
@@ -200,6 +204,7 @@ func TestSQLiteTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFairTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
logger := log.NewNoopLogger()
|
||||
factory := sql.NewFactory(
|
||||
@@ -223,6 +228,7 @@ func TestSQLiteFairTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteTaskQueueTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
logger := log.NewNoopLogger()
|
||||
factory := sql.NewFactory(
|
||||
@@ -246,6 +252,7 @@ func TestSQLiteTaskQueueTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteTaskQueueFairTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
logger := log.NewNoopLogger()
|
||||
factory := sql.NewFactory(
|
||||
@@ -269,6 +276,7 @@ func TestSQLiteTaskQueueFairTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteTaskQueueUserDataSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
logger := log.NewNoopLogger()
|
||||
factory := sql.NewFactory(
|
||||
@@ -292,6 +300,7 @@ func TestSQLiteTaskQueueUserDataSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileExecutionMutableStateStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
defer func() {
|
||||
@@ -329,6 +338,7 @@ func TestSQLiteFileExecutionMutableStateStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileExecutionMutableStateTaskStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
defer func() {
|
||||
@@ -366,6 +376,7 @@ func TestSQLiteFileExecutionMutableStateTaskStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryStoreSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
defer func() {
|
||||
@@ -393,6 +404,7 @@ func TestSQLiteFileHistoryStoreSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
defer func() {
|
||||
@@ -420,6 +432,7 @@ func TestSQLiteFileTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileFairTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
defer func() {
|
||||
@@ -447,6 +460,7 @@ func TestSQLiteFileFairTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileTaskQueueTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
defer func() {
|
||||
@@ -474,6 +488,7 @@ func TestSQLiteFileTaskQueueTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileTaskQueueFairTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
defer func() {
|
||||
@@ -501,6 +516,7 @@ func TestSQLiteFileTaskQueueFairTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileTaskQueueUserDataSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
defer func() {
|
||||
@@ -530,12 +546,14 @@ func TestSQLiteFileTaskQueueUserDataSuite(t *testing.T) {
|
||||
// TODO: Merge persistence-tests into the tests directory.
|
||||
|
||||
func TestSQLiteVisibilityPersistenceSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(VisibilityPersistenceSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetSQLiteMemoryTestClusterOption())
|
||||
suite.Run(t, s)
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryV2PersistenceSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.HistoryV2PersistenceSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetSQLiteMemoryTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -543,6 +561,7 @@ func TestSQLiteHistoryV2PersistenceSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteMetadataPersistenceSuiteV2(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.MetadataPersistenceSuiteV2)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetSQLiteMemoryTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -550,6 +569,7 @@ func TestSQLiteMetadataPersistenceSuiteV2(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteClusterMetadataPersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.ClusterMetadataManagerSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetSQLiteMemoryTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -557,6 +577,7 @@ func TestSQLiteClusterMetadataPersistence(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteQueuePersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.QueuePersistenceSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetSQLiteMemoryTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -564,6 +585,7 @@ func TestSQLiteQueuePersistence(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryV2PersistenceSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.HistoryV2PersistenceSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetSQLiteFileTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -571,6 +593,7 @@ func TestSQLiteFileHistoryV2PersistenceSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileMetadataPersistenceSuiteV2(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.MetadataPersistenceSuiteV2)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetSQLiteFileTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -578,6 +601,7 @@ func TestSQLiteFileMetadataPersistenceSuiteV2(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileClusterMetadataPersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.ClusterMetadataManagerSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetSQLiteFileTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -585,6 +609,7 @@ func TestSQLiteFileClusterMetadataPersistence(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileQueuePersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := new(persistencetests.QueuePersistenceSuite)
|
||||
s.TestBase = persistencetests.NewTestBaseWithSQL(persistencetests.GetSQLiteFileTestClusterOption())
|
||||
s.TestBase.Setup(nil)
|
||||
@@ -594,6 +619,7 @@ func TestSQLiteFileQueuePersistence(t *testing.T) {
|
||||
// SQL store tests
|
||||
|
||||
func TestSQLiteNamespaceSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -608,6 +634,7 @@ func TestSQLiteNamespaceSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteQueueMessageSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -622,6 +649,7 @@ func TestSQLiteQueueMessageSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteQueueMetadataSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -636,6 +664,7 @@ func TestSQLiteQueueMetadataSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteMatchingTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -650,6 +679,7 @@ func TestSQLiteMatchingTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteMatchingTaskV2Suite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -664,6 +694,7 @@ func TestSQLiteMatchingTaskV2Suite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteMatchingTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -678,6 +709,7 @@ func TestSQLiteMatchingTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteMatchingTaskQueueV2Suite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -692,6 +724,7 @@ func TestSQLiteMatchingTaskQueueV2Suite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryShardSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -706,6 +739,7 @@ func TestSQLiteHistoryShardSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryNodeSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -720,6 +754,7 @@ func TestSQLiteHistoryNodeSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryTreeSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -734,6 +769,7 @@ func TestSQLiteHistoryTreeSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryCurrentExecutionSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -748,6 +784,7 @@ func TestSQLiteHistoryCurrentExecutionSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryCurrentChasmExecutionSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -762,6 +799,7 @@ func TestSQLiteHistoryCurrentChasmExecutionSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryExecutionSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -776,6 +814,7 @@ func TestSQLiteHistoryExecutionSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryTransferTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -790,6 +829,7 @@ func TestSQLiteHistoryTransferTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryTimerTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -804,6 +844,7 @@ func TestSQLiteHistoryTimerTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryReplicationTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -818,6 +859,7 @@ func TestSQLiteHistoryReplicationTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryVisibilityTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -832,6 +874,7 @@ func TestSQLiteHistoryVisibilityTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryReplicationDLQTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -846,6 +889,7 @@ func TestSQLiteHistoryReplicationDLQTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryExecutionBufferSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -860,6 +904,7 @@ func TestSQLiteHistoryExecutionBufferSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryExecutionActivitySuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -874,6 +919,7 @@ func TestSQLiteHistoryExecutionActivitySuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryExecutionChildWorkflowSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -888,6 +934,7 @@ func TestSQLiteHistoryExecutionChildWorkflowSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryExecutionTimerSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -902,6 +949,7 @@ func TestSQLiteHistoryExecutionTimerSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryExecutionChasmSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -916,6 +964,7 @@ func TestSQLiteHistoryExecutionChasmSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryExecutionRequestCancelSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -930,6 +979,7 @@ func TestSQLiteHistoryExecutionRequestCancelSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryExecutionSignalSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -944,6 +994,7 @@ func TestSQLiteHistoryExecutionSignalSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteHistoryExecutionSignalRequestSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -958,6 +1009,7 @@ func TestSQLiteHistoryExecutionSignalRequestSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteVisibilitySuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindVisibility, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
@@ -972,6 +1024,7 @@ func TestSQLiteVisibilitySuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileNamespaceSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -987,6 +1040,7 @@ func TestSQLiteFileNamespaceSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileQueueMessageSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1002,6 +1056,7 @@ func TestSQLiteFileQueueMessageSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileQueueMetadataSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1017,6 +1072,7 @@ func TestSQLiteFileQueueMetadataSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileMatchingTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1032,6 +1088,7 @@ func TestSQLiteFileMatchingTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileMatchingTaskQueueSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1047,6 +1104,7 @@ func TestSQLiteFileMatchingTaskQueueSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileMatchingTaskQueueV2Suite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1062,6 +1120,7 @@ func TestSQLiteFileMatchingTaskQueueV2Suite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryShardSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1077,6 +1136,7 @@ func TestSQLiteFileHistoryShardSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryNodeSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1092,6 +1152,7 @@ func TestSQLiteFileHistoryNodeSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryTreeSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1107,6 +1168,7 @@ func TestSQLiteFileHistoryTreeSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryCurrentExecutionSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1122,6 +1184,7 @@ func TestSQLiteFileHistoryCurrentExecutionSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryCurrentChasmExecutionSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1137,6 +1200,7 @@ func TestSQLiteFileHistoryCurrentChasmExecutionSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryExecutionSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1152,6 +1216,7 @@ func TestSQLiteFileHistoryExecutionSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryTransferTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1167,6 +1232,7 @@ func TestSQLiteFileHistoryTransferTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryTimerTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1182,6 +1248,7 @@ func TestSQLiteFileHistoryTimerTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryReplicationTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1197,6 +1264,7 @@ func TestSQLiteFileHistoryReplicationTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryVisibilityTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1212,6 +1280,7 @@ func TestSQLiteFileHistoryVisibilityTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryReplicationDLQTaskSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1227,6 +1296,7 @@ func TestSQLiteFileHistoryReplicationDLQTaskSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryExecutionBufferSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1242,6 +1312,7 @@ func TestSQLiteFileHistoryExecutionBufferSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryExecutionActivitySuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1257,6 +1328,7 @@ func TestSQLiteFileHistoryExecutionActivitySuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryExecutionChildWorkflowSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1272,6 +1344,7 @@ func TestSQLiteFileHistoryExecutionChildWorkflowSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryExecutionTimerSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1287,6 +1360,7 @@ func TestSQLiteFileHistoryExecutionTimerSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryExecutionChasmSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1302,6 +1376,7 @@ func TestSQLiteFileHistoryExecutionChasmSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryExecutionRequestCancelSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1317,6 +1392,7 @@ func TestSQLiteFileHistoryExecutionRequestCancelSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryExecutionSignalSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1332,6 +1408,7 @@ func TestSQLiteFileHistoryExecutionSignalSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileHistoryExecutionSignalRequestSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindMain, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1347,6 +1424,7 @@ func TestSQLiteFileHistoryExecutionSignalRequestSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteFileVisibilitySuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
store, err := sql.NewSQLDB(sqlplugin.DbKindVisibility, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
@@ -1362,6 +1440,7 @@ func TestSQLiteFileVisibilitySuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteQueueV2(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
logger := log.NewNoopLogger()
|
||||
@@ -1381,6 +1460,7 @@ func TestSQLiteQueueV2(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSQLiteNexusEndpointPersistence(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteFileConfig()
|
||||
SetupSQLiteDatabase(t, cfg)
|
||||
logger := log.NewNoopLogger()
|
||||
@@ -1403,6 +1483,7 @@ func TestSQLiteNexusEndpointPersistence(t *testing.T) {
|
||||
// connection to the sqlite database, we will lose the db in this case. We fixed this by extending the driver in
|
||||
// modernc.org/sqlite. This test verifies that fix.
|
||||
func TestSQLiteTransactionContextCancellation(t *testing.T) {
|
||||
t.Parallel()
|
||||
cfg := NewSQLiteMemoryConfig()
|
||||
db, err := sql.NewSQLDB(sqlplugin.DbKindVisibility, cfg, resolver.NewNoopResolver(), log.NewTestLogger(), metrics.NoopMetricsHandler)
|
||||
if err != nil {
|
||||
|
||||
@@ -28,6 +28,19 @@ To pass in the required build tags, add them to the "Go tool arguments" field in
|
||||
-tags disable_grpc_modules,test_dep
|
||||
```
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Parallelization
|
||||
|
||||
All tests (and subtests!) should use `t.Parallel()` to be run concurrently;
|
||||
unless there is a reason not to.
|
||||
|
||||
`make parallelize-tests` can be used to automatically add `t.Parallel()`.
|
||||
Use `//parallelize:ignore` to opt your test out of it.
|
||||
|
||||
Functional tests in `tests/` using `testcore.NewEnv(t)` will always use `t.Parallel()`;
|
||||
unless the `MustRunSequential` option is passed.
|
||||
|
||||
## Test helpers
|
||||
|
||||
Test helpers can be found in the [common/testing](../../common/testing) package.
|
||||
|
||||
@@ -61,6 +61,7 @@ func ExampleNewServer() {
|
||||
}
|
||||
|
||||
func TestNewServer(t *testing.T) {
|
||||
t.Parallel()
|
||||
ts := temporaltest.NewServer(temporaltest.WithT(t))
|
||||
|
||||
ts.NewWorker("hello_world", func(registry worker.Registry) {
|
||||
@@ -91,6 +92,7 @@ func TestNewServer(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNewWorkerWithOptions(t *testing.T) {
|
||||
t.Parallel()
|
||||
ts := temporaltest.NewServer(temporaltest.WithT(t))
|
||||
c := ts.GetDefaultClient()
|
||||
|
||||
@@ -139,6 +141,7 @@ func TestNewWorkerWithOptions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDefaultWorkerOptions(t *testing.T) {
|
||||
t.Parallel()
|
||||
ts := temporaltest.NewServer(
|
||||
temporaltest.WithT(t),
|
||||
temporaltest.WithBaseWorkerOptions(
|
||||
@@ -188,6 +191,7 @@ func (denyAllClaimMapper) GetClaims(*authorization.AuthInfo) (*authorization.Cla
|
||||
}
|
||||
|
||||
func TestBaseServerOptions(t *testing.T) {
|
||||
t.Parallel()
|
||||
// This test verifies that we can set custom claim mappers and authorizers
|
||||
// with BaseServerOptions.
|
||||
ts := temporaltest.NewServer(
|
||||
@@ -217,6 +221,7 @@ func TestBaseServerOptions(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestClientWithCustomInterceptor(t *testing.T) {
|
||||
t.Parallel()
|
||||
var opts client.Options
|
||||
opts.Interceptors = append(opts.Interceptors, NewTestInterceptor())
|
||||
ts := temporaltest.NewServer(
|
||||
@@ -255,6 +260,7 @@ func TestClientWithCustomInterceptor(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSearchAttributeRegistration(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
|
||||
defer cancel()
|
||||
ts := temporaltest.NewServer(temporaltest.WithT(t))
|
||||
|
||||
@@ -18,7 +18,8 @@ func (s *SetupSchemaTestSuite) SetupSuite() {
|
||||
s.Logger.Fatal("Error creating CQLClient", tag.Error(err))
|
||||
}
|
||||
s.client = client
|
||||
s.SetupSuiteBase(client, "")
|
||||
// No ConnectParams needed: Cassandra CLI defaults work without explicit flags.
|
||||
s.SetupSuiteBase(client, "", test.ConnectParams{})
|
||||
}
|
||||
|
||||
func (s *SetupSchemaTestSuite) TearDownSuite() {
|
||||
|
||||
@@ -15,7 +15,8 @@ func (s *UpdateSchemaTestSuite) SetupSuite() {
|
||||
if err != nil {
|
||||
s.Logger.Fatal("Error creating CQLClient", tag.Error(err))
|
||||
}
|
||||
s.SetupSuiteBase(client, "")
|
||||
// No ConnectParams needed: Cassandra CLI defaults work without explicit flags.
|
||||
s.SetupSuiteBase(client, "", test.ConnectParams{})
|
||||
}
|
||||
|
||||
func (s *UpdateSchemaTestSuite) TearDownSuite() {
|
||||
|
||||
@@ -22,6 +22,16 @@ type (
|
||||
DropDatabase(name string) error
|
||||
ListTables() ([]string, error)
|
||||
}
|
||||
|
||||
// ConnectParams holds connection parameters for CLI tool invocations in tests.
|
||||
// Empty fields are omitted from the command line, allowing the CLI defaults to apply.
|
||||
ConnectParams struct {
|
||||
Host string
|
||||
Port string
|
||||
User string
|
||||
Password string
|
||||
}
|
||||
|
||||
// DBTestBase is the base for all test suites that test
|
||||
// the functionality of a DB implementation
|
||||
DBTestBase struct {
|
||||
@@ -33,6 +43,24 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
// CLIFlags returns the CLI flags for the connection parameters.
|
||||
func (p ConnectParams) CLIFlags() []string {
|
||||
var flags []string
|
||||
if p.Host != "" {
|
||||
flags = append(flags, "--endpoint", p.Host)
|
||||
}
|
||||
if p.Port != "" {
|
||||
flags = append(flags, "--port", p.Port)
|
||||
}
|
||||
if p.User != "" {
|
||||
flags = append(flags, "--user", p.User)
|
||||
}
|
||||
if p.Password != "" {
|
||||
flags = append(flags, "--password", p.Password)
|
||||
}
|
||||
return flags
|
||||
}
|
||||
|
||||
// SetupSuiteBase sets up the test suite
|
||||
func (tb *DBTestBase) SetupSuiteBase(db DB) {
|
||||
tb.Assertions = require.New(tb.T()) // Have to define our overridden assertions in the test setup. If we did it earlier, tb.T() will return nil
|
||||
|
||||
@@ -24,10 +24,12 @@ type SetupSchemaTestBase struct {
|
||||
DBName string
|
||||
db DB
|
||||
pluginName string
|
||||
conn ConnectParams
|
||||
}
|
||||
|
||||
// SetupSuiteBase sets up the test suite
|
||||
func (tb *SetupSchemaTestBase) SetupSuiteBase(db DB, pluginName string) {
|
||||
func (tb *SetupSchemaTestBase) SetupSuiteBase(db DB, pluginName string, conn ConnectParams) {
|
||||
tb.conn = conn
|
||||
tb.Assertions = require.New(tb.T()) // Have to define our overridden assertions in the test setup. If we did it earlier, tb.T() will return nil
|
||||
tb.Logger = log.NewTestLogger()
|
||||
tb.rand = rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
@@ -131,11 +133,9 @@ func (tb *SetupSchemaTestBase) RunSetupTest(
|
||||
func (tb *SetupSchemaTestBase) getCommandBase() []string {
|
||||
command := []string{"./tool"}
|
||||
if tb.pluginName != "" {
|
||||
command = append(command, []string{
|
||||
"-pl", tb.pluginName,
|
||||
}...)
|
||||
command = append(command, "-pl", tb.pluginName)
|
||||
}
|
||||
return command
|
||||
return append(command, tb.conn.CLIFlags()...)
|
||||
}
|
||||
|
||||
func getExpectedTables(versioningEnabled bool, wantTables []string) map[string]struct{} {
|
||||
|
||||
@@ -24,10 +24,12 @@ type UpdateSchemaTestBase struct {
|
||||
DBName string
|
||||
db DB
|
||||
pluginName string
|
||||
conn ConnectParams
|
||||
}
|
||||
|
||||
// SetupSuiteBase sets up the test suite
|
||||
func (tb *UpdateSchemaTestBase) SetupSuiteBase(db DB, pluginName string) {
|
||||
func (tb *UpdateSchemaTestBase) SetupSuiteBase(db DB, pluginName string, conn ConnectParams) {
|
||||
tb.conn = conn
|
||||
tb.Assertions = require.New(tb.T()) // Have to define our overridden assertions in the test setup. If we did it earlier, tb.T() will return nil
|
||||
tb.Logger = log.NewTestLogger()
|
||||
tb.rand = rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
@@ -153,9 +155,7 @@ func (tb *UpdateSchemaTestBase) makeSchemaVersionDirs(rootDir string, sqlFileCon
|
||||
func (tb *UpdateSchemaTestBase) getCommandBase() []string {
|
||||
command := []string{"./tool"}
|
||||
if tb.pluginName != "" {
|
||||
command = append(command, []string{
|
||||
"-pl", tb.pluginName,
|
||||
}...)
|
||||
command = append(command, "-pl", tb.pluginName)
|
||||
}
|
||||
return command
|
||||
return append(command, tb.conn.CLIFlags()...)
|
||||
}
|
||||
|
||||
198
tools/parallelize/parallelize.go
Normal file
198
tools/parallelize/parallelize.go
Normal file
@@ -0,0 +1,198 @@
|
||||
package parallelize
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"go/ast"
|
||||
"go/parser"
|
||||
"go/token"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Main() error {
|
||||
if len(os.Args) < 2 {
|
||||
return errors.New("usage: parallelize <dir> [<dir>...]")
|
||||
}
|
||||
|
||||
var failed bool
|
||||
for _, dir := range os.Args[1:] {
|
||||
if err := processDir(dir); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error processing %s: %v\n", dir, err)
|
||||
failed = true
|
||||
}
|
||||
}
|
||||
if failed {
|
||||
return errors.New("some files failed to process")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func processDir(dir string) error {
|
||||
return filepath.WalkDir(dir, func(path string, d os.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if d.IsDir() || !strings.HasSuffix(path, "_test.go") {
|
||||
return nil
|
||||
}
|
||||
return processFile(path)
|
||||
})
|
||||
}
|
||||
|
||||
func processFile(path string) error {
|
||||
fset := token.NewFileSet()
|
||||
f, err := parser.ParseFile(fset, path, nil, parser.ParseComments)
|
||||
if err != nil {
|
||||
return fmt.Errorf("parse %s: %w", path, err)
|
||||
}
|
||||
|
||||
// Collect line numbers where we need to insert t.Parallel().
|
||||
// Each entry is the line of the opening '{' of the test function body.
|
||||
type insertion struct {
|
||||
line int // line number of the '{' opening the function body
|
||||
paramName string // name of the *testing.T parameter
|
||||
}
|
||||
var insertions []insertion
|
||||
|
||||
for _, decl := range f.Decls {
|
||||
fn, ok := decl.(*ast.FuncDecl)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if !isTestFunc(fn) {
|
||||
continue
|
||||
}
|
||||
paramName := testingTParamName(fn)
|
||||
if paramName == "" {
|
||||
continue
|
||||
}
|
||||
if hasParallelCall(fn.Body, paramName) {
|
||||
continue
|
||||
}
|
||||
if hasNoLintComment(fn) {
|
||||
continue
|
||||
}
|
||||
bodyLine := fset.Position(fn.Body.Lbrace).Line
|
||||
insertions = append(insertions, insertion{line: bodyLine, paramName: paramName})
|
||||
}
|
||||
|
||||
if len(insertions) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Sort by line descending so insertions don't shift line numbers of subsequent insertions.
|
||||
sort.Slice(insertions, func(i, j int) bool {
|
||||
return insertions[i].line > insertions[j].line
|
||||
})
|
||||
|
||||
fi, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("stat %s: %w", path, err)
|
||||
}
|
||||
|
||||
src, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return fmt.Errorf("read %s: %w", path, err)
|
||||
}
|
||||
|
||||
lines := strings.Split(string(src), "\n")
|
||||
for _, ins := range insertions {
|
||||
// ins.line is 1-indexed, so it conveniently equals the 0-based index
|
||||
// of the line right after '{', which is where we want to insert.
|
||||
idx := ins.line
|
||||
newLine := "\t" + ins.paramName + ".Parallel()"
|
||||
lines = append(lines[:idx+1], lines[idx:]...)
|
||||
lines[idx] = newLine
|
||||
}
|
||||
|
||||
if err := os.WriteFile(path, []byte(strings.Join(lines, "\n")), fi.Mode()); err != nil {
|
||||
return fmt.Errorf("write %s: %w", path, err)
|
||||
}
|
||||
|
||||
fmt.Printf("parallelize: %s\n", path)
|
||||
return nil
|
||||
}
|
||||
|
||||
// isTestFunc returns true for func TestXxx(t *testing.T).
|
||||
func isTestFunc(fn *ast.FuncDecl) bool {
|
||||
if fn.Recv != nil {
|
||||
return false // method, not a function
|
||||
}
|
||||
if !strings.HasPrefix(fn.Name.Name, "Test") {
|
||||
return false
|
||||
}
|
||||
if fn.Body == nil {
|
||||
return false
|
||||
}
|
||||
return testingTParamName(fn) != ""
|
||||
}
|
||||
|
||||
// testingTParamName returns the name of the *testing.T parameter, or "" if not found.
|
||||
func testingTParamName(fn *ast.FuncDecl) string {
|
||||
if fn.Type.Params == nil || len(fn.Type.Params.List) == 0 {
|
||||
return ""
|
||||
}
|
||||
for _, field := range fn.Type.Params.List {
|
||||
starExpr, ok := field.Type.(*ast.StarExpr)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
selExpr, ok := starExpr.X.(*ast.SelectorExpr)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
pkg, ok := selExpr.X.(*ast.Ident)
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if pkg.Name == "testing" && selExpr.Sel.Name == "T" {
|
||||
if len(field.Names) > 0 {
|
||||
return field.Names[0].Name
|
||||
}
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
// hasNoLintComment checks for //parallelize:ignore in the function's doc comment.
|
||||
func hasNoLintComment(fn *ast.FuncDecl) bool {
|
||||
if fn.Doc == nil {
|
||||
return false
|
||||
}
|
||||
for _, c := range fn.Doc.List {
|
||||
if strings.Contains(c.Text, "parallelize:ignore") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// hasParallelCall checks if the function body already contains <param>.Parallel().
|
||||
func hasParallelCall(body *ast.BlockStmt, paramName string) bool {
|
||||
found := false
|
||||
ast.Inspect(body, func(n ast.Node) bool {
|
||||
if found {
|
||||
return false
|
||||
}
|
||||
call, ok := n.(*ast.CallExpr)
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
sel, ok := call.Fun.(*ast.SelectorExpr)
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
ident, ok := sel.X.(*ast.Ident)
|
||||
if !ok {
|
||||
return true
|
||||
}
|
||||
if ident.Name == paramName && sel.Sel.Name == "Parallel" {
|
||||
found = true
|
||||
}
|
||||
return true
|
||||
})
|
||||
return found
|
||||
}
|
||||
175
tools/parallelize/parallelize_test.go
Normal file
175
tools/parallelize/parallelize_test.go
Normal file
@@ -0,0 +1,175 @@
|
||||
package parallelize
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestProcessFile(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
tests := []struct {
|
||||
name string
|
||||
input string
|
||||
expected string
|
||||
}{
|
||||
{
|
||||
name: "adds t.Parallel to multiple tests",
|
||||
input: `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFoo(t *testing.T) {
|
||||
t.Log("foo")
|
||||
}
|
||||
|
||||
func TestBar(t *testing.T) {
|
||||
t.Log("bar")
|
||||
}
|
||||
`,
|
||||
expected: `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFoo(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Log("foo")
|
||||
}
|
||||
|
||||
func TestBar(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Log("bar")
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "skips test that already has t.Parallel",
|
||||
input: `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFoo(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Log("hello")
|
||||
}
|
||||
`,
|
||||
expected: `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFoo(t *testing.T) {
|
||||
t.Parallel()
|
||||
t.Log("hello")
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "skips test with parallelize:ignore",
|
||||
input: `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
//parallelize:ignore
|
||||
func TestFoo(t *testing.T) {
|
||||
t.Log("hello")
|
||||
}
|
||||
`,
|
||||
expected: `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
//parallelize:ignore
|
||||
func TestFoo(t *testing.T) {
|
||||
t.Log("hello")
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "skips non-test functions",
|
||||
input: `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
func helperFunc(t *testing.T) {
|
||||
t.Log("helper")
|
||||
}
|
||||
`,
|
||||
expected: `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
func helperFunc(t *testing.T) {
|
||||
t.Log("helper")
|
||||
}
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "skips test suite methods",
|
||||
input: `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
func (s *MySuite) TestFoo(t *testing.T) {
|
||||
t.Log("suite test")
|
||||
}
|
||||
`,
|
||||
expected: `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
func (s *MySuite) TestFoo(t *testing.T) {
|
||||
t.Log("suite test")
|
||||
}
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
t.Parallel()
|
||||
path := filepath.Join(t.TempDir(), "example_test.go")
|
||||
require.NoError(t, os.WriteFile(path, []byte(tc.input), 0644))
|
||||
|
||||
require.NoError(t, processFile(path))
|
||||
|
||||
got, err := os.ReadFile(path)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, tc.expected, string(got))
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestProcessDir(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dir := t.TempDir()
|
||||
|
||||
testFile := `package foo_test
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestFoo(t *testing.T) {
|
||||
t.Log("hello")
|
||||
}
|
||||
`
|
||||
nonTestFile := `package foo
|
||||
|
||||
func Foo() {}
|
||||
`
|
||||
|
||||
require.NoError(t, os.WriteFile(filepath.Join(dir, "foo_test.go"), []byte(testFile), 0644))
|
||||
require.NoError(t, os.WriteFile(filepath.Join(dir, "foo.go"), []byte(nonTestFile), 0644))
|
||||
|
||||
require.NoError(t, processDir(dir))
|
||||
|
||||
got, err := os.ReadFile(filepath.Join(dir, "foo_test.go"))
|
||||
require.NoError(t, err)
|
||||
require.Contains(t, string(got), "t.Parallel()")
|
||||
|
||||
got, err = os.ReadFile(filepath.Join(dir, "foo.go"))
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, nonTestFile, string(got))
|
||||
}
|
||||
@@ -46,7 +46,12 @@ func (s *SetupSchemaTestSuite) SetupSuite() {
|
||||
s.Fail("error creating sql connection:%v", err)
|
||||
}
|
||||
s.conn = conn
|
||||
s.SetupSuiteBase(conn, s.pluginName)
|
||||
s.SetupSuiteBase(conn, s.pluginName, test.ConnectParams{
|
||||
Host: s.host,
|
||||
Port: s.port,
|
||||
User: testUser,
|
||||
Password: testPassword,
|
||||
})
|
||||
}
|
||||
|
||||
// TearDownSuite tear down test suite
|
||||
|
||||
@@ -50,7 +50,12 @@ func (s *UpdateSchemaTestSuite) SetupSuite() {
|
||||
if err != nil {
|
||||
s.Logger.Fatal("Error creating CQLClient", tag.Error(err))
|
||||
}
|
||||
s.SetupSuiteBase(conn, s.pluginName)
|
||||
s.SetupSuiteBase(conn, s.pluginName, test.ConnectParams{
|
||||
Host: s.host,
|
||||
Port: s.port,
|
||||
User: testUser,
|
||||
Password: testPassword,
|
||||
})
|
||||
}
|
||||
|
||||
// TearDownSuite tear down test suite
|
||||
|
||||
@@ -8,17 +8,21 @@ import (
|
||||
)
|
||||
|
||||
func TestCQLClientTestSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
suite.Run(t, new(cassandra.CQLClientTestSuite))
|
||||
}
|
||||
|
||||
func TestSetupCQLSchemaTestSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
suite.Run(t, new(cassandra.SetupSchemaTestSuite))
|
||||
}
|
||||
|
||||
func TestUpdateCQLSchemaTestSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
suite.Run(t, new(cassandra.UpdateSchemaTestSuite))
|
||||
}
|
||||
|
||||
func TestVersionTestSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
suite.Run(t, new(cassandra.VersionTestSuite))
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func TestMySQLConnTestSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
suite.Run(t, clitest.NewSQLConnTestSuite(
|
||||
environment.GetMySQLAddress(),
|
||||
strconv.Itoa(environment.GetMySQLPort()),
|
||||
@@ -21,6 +22,7 @@ func TestMySQLConnTestSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLHandlerTestSuite(t *testing.T) {
|
||||
t.Parallel()
|
||||
suite.Run(t, clitest.NewHandlerTestSuite(
|
||||
environment.GetMySQLAddress(),
|
||||
strconv.Itoa(environment.GetMySQLPort()),
|
||||
@@ -29,10 +31,7 @@ func TestMySQLHandlerTestSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLSetupSchemaTestSuite(t *testing.T) {
|
||||
t.Setenv("SQL_HOST", environment.GetMySQLAddress())
|
||||
t.Setenv("SQL_PORT", strconv.Itoa(environment.GetMySQLPort()))
|
||||
t.Setenv("SQL_USER", testUser)
|
||||
t.Setenv("SQL_PASSWORD", testPassword)
|
||||
t.Parallel()
|
||||
suite.Run(t, clitest.NewSetupSchemaTestSuite(
|
||||
environment.GetMySQLAddress(),
|
||||
strconv.Itoa(environment.GetMySQLPort()),
|
||||
@@ -42,10 +41,7 @@ func TestMySQLSetupSchemaTestSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLUpdateSchemaTestSuite(t *testing.T) {
|
||||
t.Setenv("SQL_HOST", environment.GetMySQLAddress())
|
||||
t.Setenv("SQL_PORT", strconv.Itoa(environment.GetMySQLPort()))
|
||||
t.Setenv("SQL_USER", testUser)
|
||||
t.Setenv("SQL_PASSWORD", testPassword)
|
||||
t.Parallel()
|
||||
suite.Run(t, clitest.NewUpdateSchemaTestSuite(
|
||||
environment.GetMySQLAddress(),
|
||||
strconv.Itoa(environment.GetMySQLPort()),
|
||||
@@ -59,8 +55,7 @@ func TestMySQLUpdateSchemaTestSuite(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestMySQLVersionTestSuite(t *testing.T) {
|
||||
t.Setenv("SQL_USER", testUser)
|
||||
t.Setenv("SQL_PASSWORD", testPassword)
|
||||
t.Parallel()
|
||||
suite.Run(t, clitest.NewVersionTestSuite(
|
||||
environment.GetMySQLAddress(),
|
||||
strconv.Itoa(environment.GetMySQLPort()),
|
||||
|
||||
@@ -34,10 +34,6 @@ func (p *PostgresqlSuite) TestPostgreSQLHandlerTestSuite() {
|
||||
}
|
||||
|
||||
func (p *PostgresqlSuite) TestPostgreSQLSetupSchemaTestSuite() {
|
||||
p.T().Setenv("SQL_HOST", environment.GetPostgreSQLAddress())
|
||||
p.T().Setenv("SQL_PORT", strconv.Itoa(environment.GetPostgreSQLPort()))
|
||||
p.T().Setenv("SQL_USER", testUser)
|
||||
p.T().Setenv("SQL_PASSWORD", testPassword)
|
||||
suite.Run(p.T(), clitest.NewSetupSchemaTestSuite(
|
||||
environment.GetPostgreSQLAddress(),
|
||||
strconv.Itoa(environment.GetPostgreSQLPort()),
|
||||
@@ -47,10 +43,6 @@ func (p *PostgresqlSuite) TestPostgreSQLSetupSchemaTestSuite() {
|
||||
}
|
||||
|
||||
func (p *PostgresqlSuite) TestPostgreSQLUpdateSchemaTestSuite() {
|
||||
p.T().Setenv("SQL_HOST", environment.GetPostgreSQLAddress())
|
||||
p.T().Setenv("SQL_PORT", strconv.Itoa(environment.GetPostgreSQLPort()))
|
||||
p.T().Setenv("SQL_USER", testUser)
|
||||
p.T().Setenv("SQL_PASSWORD", testPassword)
|
||||
suite.Run(p.T(), clitest.NewUpdateSchemaTestSuite(
|
||||
environment.GetPostgreSQLAddress(),
|
||||
strconv.Itoa(environment.GetPostgreSQLPort()),
|
||||
@@ -64,8 +56,6 @@ func (p *PostgresqlSuite) TestPostgreSQLUpdateSchemaTestSuite() {
|
||||
}
|
||||
|
||||
func (p *PostgresqlSuite) TestPostgreSQLVersionTestSuite() {
|
||||
p.T().Setenv("SQL_USER", testUser)
|
||||
p.T().Setenv("SQL_PASSWORD", testPassword)
|
||||
suite.Run(p.T(), clitest.NewVersionTestSuite(
|
||||
environment.GetPostgreSQLAddress(),
|
||||
strconv.Itoa(environment.GetPostgreSQLPort()),
|
||||
@@ -76,11 +66,13 @@ func (p *PostgresqlSuite) TestPostgreSQLVersionTestSuite() {
|
||||
}
|
||||
|
||||
func TestPostgres(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := &PostgresqlSuite{pluginName: postgresql.PluginName}
|
||||
suite.Run(t, s)
|
||||
}
|
||||
|
||||
func TestPostgresPGX(t *testing.T) {
|
||||
t.Parallel()
|
||||
s := &PostgresqlSuite{pluginName: postgresql.PluginNamePGX}
|
||||
suite.Run(t, s)
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package tests
|
||||
|
||||
const (
|
||||
testUser = "temporal"
|
||||
testPassword = "temporal"
|
||||
|
||||
testMySQLExecutionSchemaFile = "../../schema/mysql/v8/temporal/schema.sql"
|
||||
testMySQLVisibilitySchemaFile = "../../schema/mysql/v8/visibility/schema.sql"
|
||||
testMySQLExecutionSchemaVersionDir = "../../schema/mysql/v8/temporal/versioned"
|
||||
|
||||
Reference in New Issue
Block a user