Skip to content

Commit 0c3969a

Browse files
authored
Update Nexus tests to use parallelsuite (#9768)
## What changed? * Migrate the `NexusTestBaseSuite` to extend a lower-level `*testcore.TestEnv` instead of `testcore.FunctionalTestBase`, and rename `NexusTestBaseSuite` to a more aptly-named `NexusTestEnv` * Migrated all tests that uses the base to `parallelsuite` which required edits of the following types: * Change calls like `s.GetTestCluster()` to `env.GetTestCluster()`, because now these things are provided by the `NexusTestEnv` **environment** rather than the suite as before * A lot of tests needed `testcore.WithDedicatedCluster()` for isolation, otherwise tests using `capture` to assert on metrics would get polluted * `s.Eventually(...)` (or some other `s.Assertion(...)` type calls) --> `require.Eventually(t, ...)`, so the failures are reported at the right test rather than at suite level. Previously tests were not ran in parallel so this may not have been an issue * `s.GetTestCluster().FrontendClient()...` --> `env.FrontendClient()...` * Creating dedicated cluster env inside subtests instead of outside * Misc. changes -- I've commented inline ## Why? Migrate to the latest and greatest, and make clearer the division between what's provided by the suite vs. env. This PR also enables parallel runs of tests, which sped up test runtime (see bottom of PR for rudimentary benchmarks). ## 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) ## Test runtimes **nexus_api_test.go** **Before:** ``` $ go test ./tests/ -run 'TestNexusApiTestSuite' -count=1 ok go.temporal.io/server/tests 7.588s ``` **After:** ``` $ go test ./tests/ -run 'TestNexusApiTestSuite' -count=1 ok go.temporal.io/server/tests 2.799s ``` ------------ **nexus_api_validation_test.go** **Before:** ``` $ go test ./tests/ -run 'TestNexusAPIValidationTestSuite' -count=1 ok go.temporal.io/server/tests 2.309s ``` **After:** ``` $ go test ./tests/ -run 'TestNexusAPIValidationTestSuite' -count=1 ok go.temporal.io/server/tests 1.384s ``` ----------- **nexus_workflow_test.go** **Before:** ``` $ go test ./tests/ -run 'TestNexusWorkflowTestSuite' -count=1 ok go.temporal.io/server/tests 11.083s ``` **After:** ``` $ go test ./tests/ -run 'TestNexusWorkflowTestSuite' -count=1 ok go.temporal.io/server/tests 3.709s ```
1 parent 3fd45b5 commit 0c3969a

5 files changed

Lines changed: 1075 additions & 1000 deletions

File tree

0 commit comments

Comments
 (0)