Files
Anton RomanovichandGitHub 2a3829a4e5 Introduce TestClusterFactory (#5118)
**What changed?**
Functional test suites use `TestCluster` (defined in
`tests/test_cluster.go`) that rely on `TestBase` (defined in
`common/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 `TestClusterFactory` and
`PersistenceTestBaseFactory` and feeding them into all test suites.

If this PR is accepted, the next steps would be to make test suites
exportable by:
* capitalizing their names (e.g. `functionalSuite` → `FunctionalSuite`);
* moving them from `*_test.go` to `.go` files.

Once we do that, we get the ability to import functional test suites
from `go.temporal.io/server/tests`, instantiate them with custom
`TestClusterFactory` and `PersistenceTestBaseFactory` and run tests.
This approach now possible with
`go.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.
2023-12-01 15:37:22 -06:00
..
2023-10-09 17:38:51 -05:00