Open muellerdo opened 3 years ago
Hi @muellerdo, thanks for reporting. I guess you don't have a running docker instance? That should be the issue since it is required by Testcontainers
which is used in the tests.
Hey @christopher-mohr,
thanks for the fast response.
A docker instance of a connected database or what do you mean with Testcontainers? No. In my current setup, the jar packaging runs in a separated container without any connected DB.
Ah, or does the testing spawn new containers?
Maybe, this can be interesting for this issue: https://www.testcontainers.org/supported_docker_environment/continuous_integration/dind_patterns/
Hey @christopher-mohr,
thanks for the fast response.
A docker instance of a connected database or what do you mean with Testcontainers? No. In my current setup, the jar packaging runs in a separated container without any connected DB.
Ah, or does the testing spawn new containers?
You actually need docker to use testconainers
. I guess this might be helpful.
Maybe, this can be interesting for this issue: https://www.testcontainers.org/supported_docker_environment/continuous_integration/dind_patterns/
Exactly. Sorry, I didn't see it before submitting my previous answer. :)
Mhm, it seems that the problem requires a little bit of structure redesigning of our docker-compose.
The problem is that testcontainers spawns containers in our container. This could be fixed when running a privileged instance or mount the docker socket into the container. However, the issue is now that we run the tests in the building process of our docker image. In the building process it is not possible to give the building container the ability to spawn new containers.
As far as I understand this issue, we have now the following options:
Any other suggestions or ideas?
I personally favor the mvn clean compile
in the dockerfile and running mvn test
and then mvn exec:exec
in a entry-script.
Packing it to a jar and starting it from there, would also be an option but be redundant after compiling it already.
Testing it everytime a docker container restart can absolutely make sense.
Do you think we should keep the tests as part of the docker image? Would there be cases where we would use the docker image for untested code?
I finally added a GitHub Action workflow for compiling, testing, packaging (verify
) which is executed for every push
and PR
.
Hi @muellerdo, since there hasn't been any progress for a while, should I just merge your PR for now and take it from there?
Hi @christopher-mohr,
I have to apologize for the stalling.
Hi @muellerdo, since there hasn't been any progress for a while, should I just merge your PR for now and take it from there?
This would be a good idea. Thank you!
Heyho,
when running './mvnw clean compile' everything works fine. However, when running './mvnw clean package', I obtained the following bug.
Seems like some tests are not working: