Commit d2999a4b authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

Heptapod CI: Standalone chromedriver image in inside tests

Instead of painfully installing a working ChromeDriver with
a PPA, we just call the external service. This effectively
rollbacks the package installations done in ca5e23226837

Closes #17
parent 5157c01044e5
Pipeline #20648 passed with stage
in 21 minutes and 31 seconds
......@@ -47,21 +47,15 @@ docker-inside:
extends:
- .rules:test-heptapod
image: $HEPTAPOD_BASE_IMAGE:$TARGET_HEPTAPOD_IMAGE
services:
- name: selenium/standalone-chrome
alias: selenium-for-inside
script:
- apt-get update
# for PPA management
- apt-get -qy install sudo software-properties-common
- apt-get -qy install sudo iproute2
- visudo --file=ci/omnibus.sudoers -c
- install -m 0440 -o root -g root ci/omnibus.sudoers /etc/sudoers.d/omnibus
- |
cat > /etc/apt/preferences <<EOF
Package: *
Pin: origin "ppa.launchpad.net"
Pin-Priority: 700
EOF
- add-apt-repository ppa:saiarcot895/chromium-beta -y
- apt-get -qy install chromium-chromedriver
- ln -s /usr/lib/chromium-browser/chromedriver /usr/bin/
# this will in particular bring a version of virtualenv that's suited
# for Python 3.8 instead of one that can't use Python 3.8 in --python option
- /opt/gitlab/embedded/bin/pip3 install tox
......@@ -111,6 +105,11 @@ docker-native-inside:
extends:
- docker-inside
- .hg-native
# unfortunately variables are not expanded in service aliases
# so we need to duplicate
services:
- name: selenium/standalone-chrome
alias: selenium-for-native-inside
docker-native-remote-0:
variables:
......
......@@ -7,20 +7,27 @@ set -e
# that the wrapper script does is really too much clutter for the job log).
/assets/wrapper >/dev/null 2>&1 &
if [ "$HEPTAPOD_HG_NATIVE" = "yes" ]; then
COMMON_FLAGS="${COMMON_FLAGS} --heptapod-hg-native"
SELENIUM_SERVICE=selenium-for-native-inside
else
SELENIUM_SERVICE=selenium-for-inside
fi
# find the (unique) container IP address
# TODO make a separate script for readability and adaptability
HEPTAPOD_SERVICE_IP=$(ip -j -4 address show scope global | /opt/gitlab/embedded/bin/python3 -c 'import json, sys; print(json.load(sys.stdin)[0]["addr_info"][0]["local"])')
COMMON_FLAGS="-v \
--heptapod-url http://localhost:80 \
--heptapod-url http://$HEPTAPOD_SERVICE_IP \
--heptapod-ssh-port 22 \
--heptapod-ssh-user git \
--heptapod-reverse-call-host=localhost \
--heptapod-git-client-executable=/opt/gitlab/embedded/bin/git \
--heptapod-hg-client-executable=/opt/gitlab/embedded/bin/hg \
--heptapod-webdriver-remote-url http://${SELENIUM_SERVICE}:4444/wd/hub \
--heptapod-omnibus"
if [ "$HEPTAPOD_HG_NATIVE" = "yes" ]; then
COMMON_FLAGS="${COMMON_FLAGS} --heptapod-hg-native"
fi
chown -R git:git .
GIT_HOME=`ls -d ~git` # for explicit guaranteed forwarding
chown git:git $GIT_HOME
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment