From 12dce1de229e72475c2dec52e2732adfb1acec80 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 21:54:02 +0200 Subject: [PATCH] Merge logic for farm tests --- .../templates/jobs/extended-tests-jobs.yml | 49 +++++++------------ .../templates/steps/tox-steps.yml | 10 ++++ 2 files changed, 27 insertions(+), 32 deletions(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 383026523..47d35453d 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -1,9 +1,11 @@ jobs: - job: x_test variables: - IMAGE_NAME: ubuntu-18.04 - ${{ if contains(variables['TOXENV'], 'integration') }}: - PYTEST_ADDOPTS: --numprocesses 4 + - name: IMAGE_NAME + value: ubuntu-18.04 + - group: certbot-common + - ${{ if contains(variables['TOXENV'], 'integration') }}: + PYTEST_ADDOPTS: --numprocesses 4 strategy: matrix: linux-py36: @@ -78,36 +80,19 @@ jobs: TOXENV: le_auto_oraclelinux6 dev: TOXENV: docker_dev + farmtest-apache2: + PYTHON_VERSION: 3.7 + TOXENV: azure-test-farm-apache2 + farmtest-leauto-upgrades: + PYTHON_VERSION: 3.7 + TOXENV: azure-test-farm-leauto-upgrades + farmtest-certonly-standalone: + PYTHON_VERSION: 3.7 + TOXENV: azure-test-farm-certonly-standalone + farmtest-sdists: + PYTHON_VERSION: 3.7 + TOXENV: azure-test-farm-sdists pool: vmImage: $(IMAGE_NAME) steps: - template: ../steps/tox-steps.yml - - job: farm_test - variables: - - group: certbot-common - strategy: - matrix: - apache2: - TOXENV: azure-test-farm-apache2 - leauto-upgrades: - TOXENV: azure-test-farm-leauto-upgrades - certonly-standalone: - TOXENV: azure-test-farm-certonly-standalone - sdists: - TOXENV: azure-test-farm-sdists - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: 3.7 - addToPath: true - - bash: | - python tools/pip_install.py -I tox virtualenv - displayName: Install runtime dependencies - - task: DownloadSecureFile@1 - name: testFarmPem - inputs: - secureFile: azure-test-farm.pem - - bash: | - ln -s $(testFarmPem.secureFilePath) azure-test-farm.pem - exit 0 - displayName: Run tox diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 5d7af9935..52c9f623b 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -25,6 +25,14 @@ steps: - bash: | python tools/pip_install.py -I tox virtualenv displayName: Install runtime dependencies + - task: DownloadSecureFile@1 + name: testFarmPem + inputs: + secureFile: azure-test-farm.pem + condition: contains(variables['TOXENV'], 'test-farm') + - bash: | + ln -s $(testFarmPem.secureFilePath) azure-test-farm.pem + condition: contains(variables['TOXENV'], 'test-farm') - bash: | if [[ "${TOXENV}" == *"test-farm"* ]]; then # To be removed once farm tests are configured on Azure @@ -33,6 +41,8 @@ steps: if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh elif command -v unbuffer >/dev/null 2>&1; then + # Call to unbuffer ensures that docker command can be run with + # -it while tox is not executed from an interactive console. unbuffer -p python -m tox else python -m tox