Added (again) database integration tests
This tries to add tests of the database-module (integration tests) again. They have previously been removed due to issues with the gitlab-runner when waiting for the docker-in-docker (dind
) service to start. Further explanation below.
(approval only if the issue can be fixed on gitlab)
Merge request reports
Activity
assigned to @marius
The job's log has two hints.
Lines 9-11:
*** WARNING: Service runner-adnxtwvb-project-2033-concurrent-0-0a960557bb250a84-docker-0 probably didn't start properly. Health check error: service "runner-adnxtwvb-project-2033-concurrent-0-0a960557bb250a84-docker-0-wait-for-service" timeout
Line 44 where
docker version
in invoked:Get "http://docker:2375/v1.24/version": dial tcp: lookup docker on 139.17.1.2:53: no such host
It seems that the
gitlab-runner
needs to be started with aprivileged
flag set to true. I can verify that locally by running the commandgitlab-runner exec docker --docker-privileged tests::integration
that without the
--docker-privileged
flag the job fails just like in gitlab. According to this post https://about.gitlab.com/blog/2019/07/31/docker-in-docker-with-docker-19-dot-03/ the runner needs to be configured for privileged execution.@marius is it feasible to configure the runner like so, in particular is it reasonable from a security point of view?
Or @gislars
39 39 # Run the unit tests 40 40 - pytest tests/unit -s -v 41 42 tests::integration: 43 stage: test 44 interruptible: true 45 image: docker:20.10.16 46 tags: 47 - dind 48 variables: 49 DOCKER_HOST: tcp://docker:2375 50 DOCKER_DRIVER: overlay2 51 DOCKER_TLS_CERTDIR: "" 52 services: 53 # We rely on the docker-in-docker service 54 - name: docker:20.10.16-dind