Use appropriate version for selenium chromedriver

Pin Chrome to 88.

Since we're using the latest stable Chrome and pin chromedriver,
it was a matter of time for it to become not compatible.

This code first installs Chrome (now pinned), picks its version and,
with path convention in place, installs corresponding chromedriver.

Looks like latest available (89) Crome causes timeouts and using
corresponding chromedriver does not help. Thus pin Chrome for now
still using dynamic chromedriver version.

Also removes leftovers of horizon stein job.

Change-Id: Ibe8b326d90100a695edbf560f105e7bbe692c9db
Signed-off-by: Andrii Ostapenko <andrii.ostapenko@att.com>
This commit is contained in:
Andrii Ostapenko
2021-04-12 10:11:18 -05:00
parent 5dc30893fb
commit f3cd97a7c4
3 changed files with 16 additions and 7 deletions

View File

@@ -6,11 +6,20 @@ RUN set -xe; \
apt-get install --no-install-recommends -y python3 python3-pip unzip wget gnupg; \
python3 -m pip install --upgrade pip; \
python3 -m pip install selenium; \
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -; \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'; \
wget --directory-prefix=/tmp/ https://chromedriver.storage.googleapis.com/2.44/chromedriver_linux64.zip; \
#wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -; \
#sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'; \
#apt-get -y update; \
#apt-get install --no-install-recommends -y google-chrome-stable; \
wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_88.0.4324.182-1_amd64.deb; \
apt install -y /tmp/chrome.deb; \
# We'll keep it here for later to be able to easily remove chrome pinning
CHROME_VER=$(dpkg -s google-chrome-stable | grep -Po '(?<=^Version: ).*' | awk -F'.' '{print $1"."$2"."}'); \
wget -O /tmp/index.xml https://chromedriver.storage.googleapis.com/; \
DRIVER_PATH=$(grep -Po "(?<=<Key>)${CHROME_VER}[^<]*?chromedriver_linux64\.zip(?=</Key>)" /tmp/index.xml | tail -1); \
wget --directory-prefix=/tmp/ https://chromedriver.storage.googleapis.com/${DRIVER_PATH}; \
unzip /tmp/chromedriver_linux64.zip -d /etc/selenium; \
apt-get -y update; \
apt-get install --no-install-recommends -y google-chrome-stable; \
apt-get clean; \
rm -rf /var/lib/apt/lists/* /tmp/*

View File

@@ -32,7 +32,7 @@
- name: openstack-helm-images-compute-kit-train-ubuntu_bionic
- name: openstack-helm-images-cinder-stein-ubuntu_bionic
- name: openstack-helm-images-cinder-train-ubuntu_bionic
- name: openstack-helm-images-horizon-stein-ubuntu_bionic
- name: openstack-helm-images-horizon-train-ubuntu_bionic
- job:
name: openstack-helm-images-build-minikube-aio

View File

@@ -30,7 +30,7 @@
dependencies:
- name: openstack-helm-images-aio-monitoring
- name: openstack-helm-images-aio-logging
- name: openstack-helm-images-horizon-stein-ubuntu_bionic
- name: openstack-helm-images-horizon-train-ubuntu_bionic
- job:
name: openstack-helm-images-build-osh-selenium