-
Notifications
You must be signed in to change notification settings - Fork 30
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
Postgres on CI/CD won't run #42
Comments
Hi @Wasenshi123 , it looks like your CI/CD builder agent doesn't have docker installed on it. Could you check this somehow, please? |
Hi @Deffiss , yes, I checked my CI/CD and it indeed doesn't have docker installed in the build process. So I went on and installed docker but now I got the new error :
Can you help me out, please? Here is a part of my CI/CD setup in case it helps (circleci config) :
|
Seem's like Docker is not able to download requested image from Hub. If you are specifying private docker hub or with access control(login/password or certificate) - it is currently impossible to use it with our lib in the such way |
Hi @Hellevar , No, I didn't use any private image. Please note that this error is from when the method Another thing I noticed is, the number of total tests is messed up and seems off. Also another minor note is that it also yields this error at around the end something like:
[Update: I try change dotnet test to run debug instead of release on local and it works fine.] So not sure why but it seems almost like the postgres db docker container cannot build and up fast enough so the test runs before the docker is ready somehow and failed? (To be precise, running test on debug mode for the first time also fail and yields the same error as the release mode, but then next time it can reuse the container and pass successfully) The error it yields is different from the CI/CD case here, though. Not sure if this is related to each other since I use release mode on CI/CD as per you suggestion This is the error from running test on release mode (and also for debug mode only on first time) locally :
It says this despite that it was the one who is trying to create the container itself (And I've verified that there is none of the container up and running before I run the test) |
Additional information:
|
Did you try to remove all containers: |
Yes, I run that before running |
Can you try to remove postgress image ( |
@Deffiss hi, I've just solved the local problem and now everything works fine just as it should be. (basically, I used the common same name for any Postgres container created by EnvironmentFixture. While in reality, it got created for every test classes, so multiple containers were fighting each other for the name, ha) But still, the CI/CD remains the same (and that is the main issue). I have no clue about this:
FYI: This is running on CircleCi, so it's docker in docker. |
For docker in docker scenario, you need to configure test env:
In order to run this from both local and CI/CD envs, you probably need some trick that allows to identify whether you are docker-in-docker or not. We did that from environment variables (something like DOCKER_IN_DOCKER equals TRUE). |
@Deffiss Thank you for your suggestion. Well, but I have tried it. With .DockerInDocker(true) and also pull Postgres image beforehand, still no luck. I think it has something to do with the circleCi itself. They have this line Maybe that raise some security requirements that causes Docker.Dotnet to throw the error above? (also, still, wondering why it seems to run the test twice in a number of total tests? perhaps it will automatically be gone if the problem above got solved? well, at least in the local it did go away) |
By default |
I found in this documentation https://circleci.com/docs/2.0/building-docker-images/
|
I use the package to run the test with PostgresDB. I followed your example here and it works fine, locally.
But when I run it on the ci/cd, it won't work.
Basically, it says :
The text was updated successfully, but these errors were encountered: