Open XiaosongWen opened 2 years ago
Hi @XiaosongWen, please configure logging according to our recommended configuration and share the logs with us: https://www.testcontainers.org/supported_docker_environment/logging_config/
Also, 1.16.3
is not the latest version of Tescontainers, 1.17.3
is.
Your Jenkins build node has access to the Docker daemon?
Hi Kiview, thank for the reply. I have added the logs configure and updated to version 1.17.3. And from this issue: https://github.com/testcontainers/testcontainers-java/issues/3455 Also setup a ImageNameSubstitutor. I can confirm that from the local log it is using: comany.com/xxx/testcontainers/ryuk:0.3.3
and comany.com/xxx/postgres:13.2
.
Here is what I got from jekeins:
MyEntityRepositoryAuditTest > initializationError FAILED
17:54:33 java.lang.ExceptionInInitializerError at Unsafe.java:-2
17:54:33 Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1371
17:54:33 Caused by: org.testcontainers.containers.ContainerLaunchException at GenericContainer.java:349
17:54:33 Caused by: org.testcontainers.containers.ContainerFetchException at GenericContainer.java:1371
17:54:33 Caused by: org.testcontainers.containers.ContainerFetchException at RemoteDockerImage.java:119
17:54:33 Caused by: com.github.dockerjava.api.exception.InternalServerErrorException at DefaultInvocationBuilder.java:247
17:54:33
17:54:33 MyEntityTest > shouldBeAbleToCreateEntity FAILED
17:54:33 java.lang.NoClassDefFoundError at MyEntityTest.java:12
And it somehow cause an NoClassDefFoundError, but MyEntityTest
has nothing to do with testcontainers.
I am wondering if I need to add something to jenkins file, currently it is:
stage('Tests') {
steps {
dir("XXXi") {
withCredentials([[
...
]]){
sh """
gradle clean test -Partifactory_user=$USERNAME -Partifactory_password=$PASSWORD
"""
}
}
}
}
Can you please run Gradle with -i
, so we see the actual logs of the tests?
Module
PostgreSQL
Testcontainers version
1.16.3
Using the latest Testcontainers version?
Yes
Host OS
linux
Host Arch
x86
Docker version
What happened?
I am using testcontainers for my unit test for repository, it passes locally but failed in the jenkins, and it only have one line log trace:
Here are my code, I retaged and pushed postgres:13.2 to company's private jfrog
Any suggestion helps, Thanks
Relevant log output