Trendyol / stove

Stove: The easiest way of writing e2e tests for your JVM back-end API with Kotlin
https://trendyol.github.io/stove/
Apache License 2.0
146 stars 10 forks source link

Support testcontainer-less TestSystem #370

Open oguzhaneren opened 5 months ago

oguzhaneren commented 5 months ago

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 commented 5 months ago

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:

oguzhaneren commented 5 months ago

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.
osoykan commented 3 months ago

ReadySystem requirements:

Approach 1

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

Approach 2

Ehancements