This is what I have:
buildscript {
dependencies {
classpath("org.testcontainers:testcontainers:1.19.5")
classpath("org.testcontainers:postgresql:1.19.5")
}
repositories {
mavenCentral()
}
}
....
val testContainer =
org.testcontainers.containers.PostgreSQLContainer(DockerImageName.parse("paradedb/paradedb:latest").asCompatibleSubstituteFor("postgres"))
val startContainer by tasks.registering {
testContainer.start()
}
Hypothetically, it should to the trick - when I call gradlew startContainer
or when Liquibase's update tsk depends on it and I call update - it should
spin up the container and stop it only when the gradle is done.
Or, for example, if I will put jooqCodegen.finalizedBy(stopContainer) - the
same should happen. However, I got the following error in the very
beginning:
Can't instantiate a strategy from
org.testcontainers.dockerclient.UnixSocketClientProviderStrategy
(ClassNotFoundException). This probably means that cached configuration
refers to a client provider class that is not available in this version of
Testcontainers. Other strategies will be tried instead.
Could not find a valid Docker environment. Please check configuration.
Attempted configurations were:
As no valid configuration was found, execution cannot continue.
I am not sure what is the issue here. Obviously, testcontainers work on my
machine; I have native Docker installed. I have a dependency on
testcontainers on my script's classpath. At this point I do not know what I
am doing wrong :(
On Thursday 22 February 2024 at 10:31:34 UTC+1 Lukas Eder wrote:
> Well, what did you try?
>
> On Thu, Feb 22, 2024 at 10:19 AM Pasha Finkelshtein <
> [email protected]> wrote:
>
>> This obviously SHOULD work, but it doesn't. And I was hoping to get a
>> concrete example to understand what I'm doing wrong.
>>
>> It seems to me that test containers just don't work during the gradle
>> build, but maybe I'm wrong. And since nobody in the Testcontainers slack
>> answer I thought that maybe here somebody has a working example.
>>
>> Sorry for bothering you
>>
>
--
You received this message because you are subscribed to the Google Groups "jOOQ
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jooq-user/c6de4831-14e6-4d64-b558-34b73b45a2ben%40googlegroups.com.