Introduce TestClusterFactory#5118
Merged
rodrigozhou merged 2 commits intotemporalio:mainfrom Dec 1, 2023
Merged
Conversation
8fca7ee to
810f404
Compare
Contributor
Author
|
@rodrigozhou Could you please take a look at this one as well? 🙂 I'm not sure I've chosen the best approach, so I would appreciate any feedback. |
810f404 to
46fada3
Compare
rodrigozhou
reviewed
Nov 30, 2023
rodrigozhou
approved these changes
Dec 1, 2023
rodrigozhou
pushed a commit
that referenced
this pull request
Dec 5, 2023
## What changed? Names of all test suites were capitalized. ## Why? Following up on #5118 and making another step towards exportable functional test suites. If this PR gets merged, the next (and the final one) PR will move the test suite implementations from `*_test.go` to `.go` files. ## How did you test it? Ran tests. ## Potential risks Merge conflicts in other PRs. ## Is hotfix candidate? No.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Functional test suites use
TestCluster(defined intests/test_cluster.go) that rely onTestBase(defined incommon/persistence/persistence-tests/persistence_test_base.go).This PR introduces factories that allow changing how these components are created.
Why?
The goal is to make Temporal functional tests customizable and exportable to ease the development of custom Temporal server implementations. My case is https://github.com/yandex/temporal-over-ydb. Its README describes the only currently possible way to run Temporal functional tests from the outside, which is to copy them over and patch.
This PR targets the "customizable" part and makes it possible to run tests over custom persistence by implementing
TestClusterFactoryandPersistenceTestBaseFactoryand feeding them into all test suites.If this PR is accepted, the next steps would be to make test suites exportable by:
functionalSuite→FunctionalSuite);*_test.goto.gofiles.Once we do that, we get the ability to import functional test suites from
go.temporal.io/server/tests, instantiate them with customTestClusterFactoryandPersistenceTestBaseFactoryand run tests. This approach now possible withgo.temporal.io/server/common/persistence/persistence-tests, for example: https://github.com/yandex/temporal-over-ydb/blob/main/tests/persistencetests/ydb_test.go#L8.How did you test it?
Ran tests.
Potential risks
None.
Is hotfix candidate?
No.