Open toddself opened 5 years ago
I would love to work on this issue, would you please just guide me to what should i do?
I'm thinking of writing a test in js which forks docker compose up
, and checking it's exit code.
Will this be fine or should I do something else?
PS. I'm new to this project but want to contribute to this awesome initiative..
The rest of the tests are running in Docker in Circle, but since these would be testing that the docker-compose setup itself works (and everything running in Docker works together), you'll probably want to use a VM executor: https://circleci.com/docs/2.0/executor-types/
An initial test could probably be as simple as:
docker-compose up -d
docker ps
to make sure all the containers stayed up).Related, once #204 is in, we should figure out if there's a good way to test that, too. Maybe microk8s + an extra Postgres pod?
After some digginig, I guess, I could use remote docker command for the same https://circleci.com/docs/2.0/building-docker-images/ Thoughts? If building docker fails, test will fail..
Yep, those docs are a better example than the link I found, especially the last example. If building the containers fails CI should fail, but I think maybe that should be a separate step, since building containers to push to Docker Hub for production deployment is different than spinning up docker-compose and making sure everything can still talk to everything else.
Yeah, we want two things really:
docker-compose
and have a working running instance (ideally we'd curl
against it to at least give it a litmus check that the server started)Also @nveenjain thank you for coming by and pitching in!
@toddself do you have Circle access? 1. Docker iamges should build without fail
is what this script is for, and my thought was that it should be run on each merge to master and git tag. We'd need a Docker Hub service account credentials added in Circle for that to work.
@zacanger I can give it a shot in the am!
I'm thinking of creating a new build job
build:
docker:
- image: circleci/node:latest
- image: circleci/postgres:latest
steps:
- checkout
- setup_remote_docker
- run: npm install
- run:
name: Docker compose up
command: |
set -ex
docker-compose up -d
Should i send request to every app after we do docker-compose, also if I'm doing anything wrong, please tell, I'm not quite familiar with CircleCI...
I don't think you need the postgres container in there -- the docker compose command should cause a postgres container to be spun up automatically.
@zacanger if it requires putting secret creds into circle-ci that could be a problem -- or we would only have to let that test run on master since even if you have creds in the "secure env variables" section, they still need to be decrypted when passed on the command line which can cause cred leakage :(
Good point. I opened a new issue #291 about this so I don't hijack this issue.
We need tests to ensure changes are able to generate packages and that running docker-compose doesn't fail on these changes.
If anyone is interested in working on this that would be great!