Skip to content
Snippets Groups Projects

Improvements and fixes to the LAVA docker-compose setup

Merged Emanuele Aina requested to merge wip/em/lava-docker-compose into main
Files
3
+ 20
18
@@ -77,6 +77,7 @@ gitlab-integration-test:
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
AUTHZ_MEDIATOR_IMAGE: $CI_REGISTRY_IMAGE/authz-mediator:$TAG_SHA
GITLAB_EXTERNAL_URL: http://docker:8000
GITLAB_SECRET: 5h0uLd{8E}-4u709EneR47Ed
before_script:
- apt update && apt install -y --no-install-recommends
@@ -94,27 +95,28 @@ gitlab-integration-test:
python3-pytest
python3-selenium
python3-gitlab
wait-for-it
- pip3 install pytest-selenium==4.0.0 selenium==4.9.1
- wait-for-it docker:8000 --timeout=180 -- echo "The GitLab frontend is up"
- |
timeout 300s bash <<EOF
echo "Wait for the GitLab backend"
while ! curl -o /dev/null --no-progress-meter --fail http://docker:8000/
do
sleep 10s
done
python3 - <<EOF
import os, sys, time
import gitlab
globals().update(os.environ) # import all env vars
results = None
print(f'Waiting for {GITLAB_EXTERNAL_URL} to be ready')
for i in range(1, 61):
try:
gl = gitlab.Gitlab(GITLAB_EXTERNAL_URL, private_token=GITLAB_SECRET)
results = gl.users.list()
except Exception as e:
delay = 10
print(f'Round {i:2}: got "{e}", will try again in {delay}s')
time.sleep(delay)
if results:
print(f'Ready, got {len(results)} results')
else:
print(f'Not ready after {i} attempts')
sys.exit(1)
EOF
- curl -v --fail --no-progress-meter http://docker:8000/
- |
timeout 300s bash <<EOF
echo "Wait for the GitLab API"
while ! python3 -c "import os; import gitlab; gl = gitlab.Gitlab('http://docker:8000', private_token=os.environ['GITLAB_SECRET']); print(gl.users.list())" >/dev/null 2>&1
do
sleep 10s
done
EOF
- python3 -c "import os; import gitlab; gl = gitlab.Gitlab('http://docker:8000', private_token=os.environ['GITLAB_SECRET']); print(gl.users.list())"
- pytest-3 -v --capture=no --color=yes
--driver Remote --capability browserName firefox
--selenium-host docker --selenium-port 4444
Loading