Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support testcontainer-less TestSystem #370

Open
oguzhaneren opened this issue Mar 28, 2024 · 3 comments
Open

Support testcontainer-less TestSystem #370

oguzhaneren opened this issue Mar 28, 2024 · 3 comments
Labels
area:all-deps enhancement New feature or request

Comments

@oguzhaneren
Copy link

oguzhaneren commented Mar 28, 2024

When using stove in pipelines, we faced some infrastructural issues like image errors, timeout, slow startup time, high memory and cpu usage.

To solve this kind of issues we decide use Stove with shared environments instead of DiD. If we can pass our environment configurations to Stove, Stove doesn't need boot testcontainers any more.

so we need to pass our shared environment configs to Stove like following.

TestSystem("http://localhost:8001").with {
            bridge()
            couchbase {
                CouchbaseSystemOptions.fromInstance("http://localhost:8089","username","password","defaultBucket)
            }
            kafka {
                KafkaSystemOptions.fromInstance("localhost:9001",objectMapper)
            }
        }.run()
    }

with this implementation we can continue to use Stove without any breaking change in tests, we need to change only Test setup.

@osoykan osoykan added area:all-deps enhancement New feature or request labels Mar 28, 2024
@osoykan
Copy link
Collaborator

osoykan commented Mar 28, 2024

That makes sense, and quite similar to what we have already:

TestSystem(baseUrl = "http://localhost:8001") {
    if (isRunningLocally()) {
        enableReuseForTestContainers()
        keepDendenciesRunning() // this will keep the dependencies running after the tests are finished
    }
}

There are some points to think about from top of my head:

  • What about test migrations? Do we assume that they are run already? We should provide options to always-run: false | true migration when running against existing infra.
  • Should not mix with isRunningLocally, or at least if both are configured the local one should take precedence.

@oguzhaneren
Copy link
Author

That makes sense, and quite similar to what we have already:

TestSystem(baseUrl = "http://localhost:8001") {
    if (isRunningLocally()) {
        enableReuseForTestContainers()
        keepDendenciesRunning() // this will keep the dependencies running after the tests are finished
    }
}

There are some points to think about from top of my head:

  • What about test migrations? Do we assume that they are run already? We should provide options to always-run: false | true migration when running against existing infra.
  • Should not mix with isRunningLocally, or at least if both are configured the local one should take precedence.
  • I think we can continue to support migrations because we continue to create buckets and topics from e2e code base.
  • reusable containers are not suitable (https://java.testcontainers.org/features/reuse/) for CI pipelines but we can use at local, so it would be good if we support both type, instance or resuable

@osoykan
Copy link
Collaborator

osoykan commented May 16, 2024

ReadySystem requirements:

Approach 1

Adding a new type of SystemOptions, called ReadySystemOptions, corresponding systems

  • {SystemName}ReadySytemOptions: CouchbaseReadySytemOptions, KafkaReadySystemOptions

  • Migrations can run as is

  • Ready system Healthcheck callback

  • StateOfSystem can stay as is, it looks.

Approach 2

  • No need to introduce a new SystemOptions
  • migrations run as is
  • StateStore can be implemented, could be Gitlab, ElasticSearch, a document DB, etc, user can simply implement it.

Ehancements

  • ShudownHook can be implemented to clear all the data for the related TestSystem

osoykan added a commit that referenced this issue May 28, 2024
StateStore implementation can be provided outside by the users, thus you can store the state in any other provider such as Gitlab, another file storage or database #370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:all-deps enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants