-
Notifications
You must be signed in to change notification settings - Fork 78
/
.gitlab-ci-full-integration-template.yml
70 lines (69 loc) · 2.45 KB
/
.gitlab-ci-full-integration-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# The CI job name will be unique after substitution from the generator.
test:integration:$CI_NODE_INDEX:
rules:
- if: $RUN_TESTS_FULL_INTEGRATION == "true"
image: docker:${DOCKER_VERSION}-dind
stage: test
tags:
- mender-qa-worker-integration-tests
timeout: 10h
before_script:
# These two variables would be set by GitLab CI "parallel" feature, and are used by our Pytest
# plugin to split the tests among the CI jobs. They get substituted by the generator.
- export CI_NODE_INDEX=$CI_NODE_INDEX
- export CI_NODE_TOTAL=$CI_NODE_TOTAL
- |
docker login registry.mender.io \
--username $REGISTRY_MENDER_IO_USERNAME \
--password $REGISTRY_MENDER_IO_PASSWORD
- |
docker login docker.io \
--username $DOCKER_HUB_USERNAME \
--password $DOCKER_HUB_PASSWORD
- |
docker login $CI_REGISTRY \
--username $CI_REGISTRY_USER \
--password $CI_REGISTRY_PASSWORD
- apk add $(cat ./tests/requirements-system/apk-requirements.txt)
- apk add py3-virtualenv screen
- python -m virtualenv /.venv
- source /.venv/bin/activate
- pip3 install -r ./tests/requirements-python/python-requirements.txt
# Gitlab CI tends to set these DOCKER_ variables internally.
# dind also creates the unix socket at /var/run/docker.sock
- unset DOCKER_HOST DOCKER_TLS_VERIFY DOCKER_CERT_PATH
# Run dockerd and wait it to start
# https://github.com/krallin/tini#subreaping
- screen -d -m /usr/bin/env TINI_SUBREAPER=true dockerd-entrypoint.sh
- |
MAX_WAIT=300
while [ ${MAX_WAIT} -gt 0 ]; do
echo "[$(date +%F_%T)] MAX_WAIT=${MAX_WAIT}"; ps # Debug information
if docker version &>/dev/null; then
docker version # Verify that the dockerd is up and running
break
fi
MAX_WAIT=$((${MAX_WAIT} - 1))
sleep 1
done
if test $MAX_WAIT -lt 1; then
echo "Timeout waiting for docker to start"
exit 1;
fi
# Increase system limits to make sure the tests are not limited while
# running with high parallelism on a single VM
- sysctl -w fs.inotify.max_user_instances=1024
- sysctl -w fs.file-max=600000
- ulimit -n 524288
script:
- cd tests
- ./run.sh
artifacts:
expire_in: 2w
when: always
paths:
- tests/mender_test_logs
- tests/results_full_integration.xml
- tests/report_full_integration.html
reports:
junit: results_full_integration.xml