Skip to content
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

Unable to run mockserver container in GitLab CI #967

Closed
sivaprasadreddy opened this issue Nov 8, 2018 · 3 comments
Closed

Unable to run mockserver container in GitLab CI #967

sivaprasadreddy opened this issue Nov 8, 2018 · 3 comments
Labels

Comments

@sivaprasadreddy
Copy link
Contributor

Hi,
I am building a SpringBoot application and using Gitlab CI https://gitlab.com/sivalabs/spring-boot-2-sample. I am trying to use TestContainers for Postgres and mockserver containers during integration testing.

I have configured .gitlab-ci.yml as described in https://www.testcontainers.org/ci/ci.html#gitlab. But somehow it is not working. When a call is made to mockserver endpoint it is hanging forever.

image: docker:latest
services:
- docker:dind

variables:
  DOCKER_DRIVER: overlay2
  SPRING_PROFILES_ACTIVE: gitlab-ci

stages:
- build

maven-build:
  stage: build
  script:
  - docker run -t --rm -v /var/run/docker.sock:/var/run/docker.sock -v "$(pwd)":"$(pwd)" -w "$(pwd)" -u 0:0 maven:3-jdk-8 mvn clean verify -B

To reproduce the error simply change UserControllerIT or UserControllerRestAssuredIT to extend BaseTestContainerIntegrationTest.

@atomfrede
Copy link
Contributor

I forked your example and did upgrade testcontainers and used a gitlab.ci config I use usually. It looks good to me. Maybe have a look if using different stages is fine for you. https://gitlab.com/atomfrede/spring-boot-2-sample/-/jobs/131846466

@stale
Copy link

stale bot commented Mar 8, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

@stale stale bot added the stale label Mar 8, 2019
@sivaprasadreddy
Copy link
Contributor Author

Thanks a lot for the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants