From 2a5c194da2be58c19d77f204855b9191d575cd3e Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 21:38:49 +0200 Subject: [PATCH] Dedicated script for oldest tests --- .azure-pipelines/templates/extended-tests.yml | 23 +---------- .azure-pipelines/templates/standard-tests.yml | 20 +-------- tools/run_oldest_tests.sh | 41 +++++++++++++++++++ 3 files changed, 45 insertions(+), 39 deletions(-) create mode 100755 tools/run_oldest_tests.sh diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests.yml index 080954ede..712fe39ce 100644 --- a/.azure-pipelines/templates/extended-tests.yml +++ b/.azure-pipelines/templates/extended-tests.yml @@ -137,24 +137,5 @@ jobs: ACME_SERVER: boulder-v2 steps: - script: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - python-dev \ - python-pip \ - git \ - gcc \ - libaugeas0 \ - libssl-dev \ - libffi-dev \ - ca-certificates \ - nginx-light \ - openssl \ - curl - curl -fsSL https://get.docker.com -o get-docker.sh - sudo sh get-docker.sh - sudo pip install --upgrade pip setuptools wheel - python tools/pip_install.py -U tox - displayName: Install dependencies - - script: | - python -m tox - displayName: Run tox + tools/run_oldest_tests.sh + displayName: Run oldest tests diff --git a/.azure-pipelines/templates/standard-tests.yml b/.azure-pipelines/templates/standard-tests.yml index 8e5e528f1..6054c4aaf 100644 --- a/.azure-pipelines/templates/standard-tests.yml +++ b/.azure-pipelines/templates/standard-tests.yml @@ -7,24 +7,8 @@ jobs: TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest steps: - script: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - python-dev \ - python-pip \ - git \ - gcc \ - libaugeas0 \ - libssl-dev \ - libffi-dev \ - ca-certificates - displayName: Install Linux dependencies - - script: | - sudo pip install --upgrade pip setuptools wheel - python tools/pip_install.py -U tox - displayName: Install dependencies - - script: | - python -m tox - displayName: Run tox + tools/run_oldest_tests.sh + displayName: Run oldest tests - job: apache_compat pool: vmImage: ubuntu-latest diff --git a/tools/run_oldest_tests.sh b/tools/run_oldest_tests.sh new file mode 100755 index 000000000..5761ef3b7 --- /dev/null +++ b/tools/run_oldest_tests.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -e + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +pushd "${DIR}/../" || exit 1 + +function cleanup() { + rm -f "${SCRIPT}" + popd +} + +trap cleanup EXIT + +SCRIPT=$(mktemp /tmp/test-script.XXXXXX) +chmod +x "${SCRIPT}" + +cat << EOF >> "${SCRIPT}" +#!/bin/sh +set -e +apt-get update +apt-get install -y --no-install-recommends \ + python-dev \ + python-pip \ + git \ + gcc \ + libaugeas0 \ + libssl-dev \ + libffi-dev \ + ca-certificates \ + nginx-light \ + openssl \ + curl +curl -fsSL https://get.docker.com -o get-docker.sh +sh get-docker.sh +pip install --upgrade pip setuptools wheel +python tools/pip_install.py --ignore-installed six -U tox +python -m tox +EOF + +docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "${PWD}:/workspace" -v "${SCRIPT}:/script.sh" -e TOXENV -e ACME_SERVER -e PYTEST_ADDOPTS -w /workspace --network=host ubuntu:14.04 /script.sh