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 running docker in tests on CircleCI build #1837
Conversation
We want to use Testcontainers for testing various functionality with real backends running. Hopefully the `setup_remote_docker` command allows this to work.
Well, that didn't work at all (as mentioned in testcontainers/testcontainers-java#1014 (comment)). I'm going to take a new approach of using a JUnit Jupiter tag for tests that need docker support and excluding them from the default run. I'll make a separate |
Adds a `dockerTest` task to the build that runs the tests tagged with `docker`, which are excluded in the default `test` task. This will be used in the CircleCI build from a separate `machine` executor, which is required to use Testcontainers on CircleCI.
b73f10c
to
7795bec
Compare
a4290fa
to
d24244d
Compare
This seems to be working well. Only thing to maybe look into later is getting the I will update the pull request to remove the placeholder test tagged with Please take a look @izeye and @jeqo. Let me know what you think, since you both have a pull request blocked by not being able to use testcontainers on our CI build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT. Though, no much I can say until I enable testcontainer tests on my PR 😅
@shakuzen Looks good to me, too. Thanks! |
Thanks for the review. Let me know if you have any issues or feedback after rebasing your PRs on this post-merge. |
Tests the ElasticMeterRegistry against a running Elasticsearch instance in a docker container using testcontainers. Currently tested against Elasticsearch 6 and 7. See gh-1837 Closes gh-1429 Co-authored-by: Adrian Cole <adriancole@users.noreply.github.com> Co-authored-by: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com>
We want to use Testcontainers for testing various functionality with real backends running. We need to run such tests on a
machine
type executor on CircleCI. This makes a separate CircleCI job to run those, using a newly added Gradle taskdockerTest
that only runs the tests tagged (with JUnit Jupiter's@Tag("docker")
) with thedocker
label (see sample test). The defaulttest
task will not run the tests tagged withdocker
.Unblocks things like #1429
Also upgrades to CircleCI's version 2.1 configuration which allows some deduplication of the executor, which was in order as different build images were being used in different jobs (by mistake). Also dedups the almost identical steps used in both the
build
anddocker-test
jobs.