From caac15ae6d88314718ec42d86e849a3f7c2f1a32 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 14:56:02 +0200 Subject: [PATCH 001/172] Refactor pipeline to include linux tests --- .azure-pipelines/advanced-test.yml | 4 ++-- .azure-pipelines/advanced.yml | 4 ++-- .azure-pipelines/main.yml | 2 +- .azure-pipelines/release.yml | 4 ++-- ...sts-suite.yml => standard-tests-suite.yml} | 21 +++++++++++++++++++ ...-tests.yml => windows-installer-tests.yml} | 0 6 files changed, 28 insertions(+), 7 deletions(-) rename .azure-pipelines/templates/{tests-suite.yml => standard-tests-suite.yml} (66%) rename .azure-pipelines/templates/{installer-tests.yml => windows-installer-tests.yml} (100%) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 5be29ba79..a97e0a802 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -9,5 +9,5 @@ pr: none jobs: # Any addition here should be reflected in the advanced and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/tests-suite.yml - - template: templates/installer-tests.yml + - template: templates/standard-tests-suite.yml + - template: templates/windows-installer-tests.yml diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index d950e6524..d390e2dfa 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -14,5 +14,5 @@ schedules: jobs: # Any addition here should be reflected in the advanced-test and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/tests-suite.yml - - template: templates/installer-tests.yml + - template: templates/standard-tests-suite.yml + - template: templates/windows-installer-tests.yml diff --git a/.azure-pipelines/main.yml b/.azure-pipelines/main.yml index eac3e451e..2da57cb5a 100644 --- a/.azure-pipelines/main.yml +++ b/.azure-pipelines/main.yml @@ -5,4 +5,4 @@ pr: - '*.x' jobs: - - template: templates/tests-suite.yml + - template: templates/standard-tests-suite.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index e9acbc69a..75f7eecfa 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -8,6 +8,6 @@ pr: none jobs: # Any addition here should be reflected in the advanced and advanced-test pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/tests-suite.yml - - template: templates/installer-tests.yml + - template: templates/standard-tests-suite.yml + - template: templates/windows-installer-tests.yml - template: templates/changelog.yml diff --git a/.azure-pipelines/templates/tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml similarity index 66% rename from .azure-pipelines/templates/tests-suite.yml rename to .azure-pipelines/templates/standard-tests-suite.yml index d330b7954..c0f8550d3 100644 --- a/.azure-pipelines/templates/tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -23,6 +23,27 @@ jobs: PYTHON_VERSION: 3.7 TOXENV: integration-certbot PYTEST_ADDOPTS: --numprocesses 4 + linux-py27: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 2.7 + TOXENV: py27 + linux-py35: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.5 + TOXENV: py35 + linux-py38-cover: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.8 + TOXENV: py27-cover + linux-py37-lint: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.7 + TOXENV: lint + linux-py35-mypy: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.5 + TOXENV: mypy + pool: vmImage: $(IMAGE_NAME) steps: diff --git a/.azure-pipelines/templates/installer-tests.yml b/.azure-pipelines/templates/windows-installer-tests.yml similarity index 100% rename from .azure-pipelines/templates/installer-tests.yml rename to .azure-pipelines/templates/windows-installer-tests.yml From b71385fb3dbb9491a6e20e505542953b0f8fed75 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:03:19 +0200 Subject: [PATCH 002/172] Add linux dependencies --- .../templates/standard-tests-suite.yml | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index c0f8550d3..5345e870d 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -43,18 +43,33 @@ jobs: IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.5 TOXENV: mypy - pool: vmImage: $(IMAGE_NAME) steps: - - bash: brew install augeas + - bash: | + brew install augeas condition: startswith(variables['IMAGE_NAME'], 'macOS') - displayName: Install Augeas + displayName: Install MacOS dependencies + - bash: | + apt update + apt install -y --no-install-recommends \ + python-dev \ + gcc \ + libaugeas0 \ + libssl-dev \ + libffi-dev \ + ca-certificates \ + nginx-light \ + openssl + condition: startswith(variables['IMAGE_NAME'], 'ubuntu') + displayName: Install Linux dependencies - task: UsePythonVersion@0 inputs: versionSpec: $(PYTHON_VERSION) addToPath: true - - script: python tools/pip_install.py -U tox coverage + - script: | + python tools/pip_install.py -U tox coverage displayName: Install dependencies - - script: python -m tox + - script: | + python -m tox displayName: Run tox From cbc28494a9e8505b4cb0f1311b3baaef6f235f8a Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:04:26 +0200 Subject: [PATCH 003/172] Sudo --- .azure-pipelines/templates/standard-tests-suite.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index 5345e870d..adf014e4e 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -51,8 +51,8 @@ jobs: condition: startswith(variables['IMAGE_NAME'], 'macOS') displayName: Install MacOS dependencies - bash: | - apt update - apt install -y --no-install-recommends \ + sudo apt update + sudo apt install -y --no-install-recommends \ python-dev \ gcc \ libaugeas0 \ From 38444b1cd9492044587f6dee8a6d4c9b370fca16 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:14:06 +0200 Subject: [PATCH 004/172] Add oldest tests --- .../templates/standard-tests-suite.yml | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index adf014e4e..d59de9ce4 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -1,4 +1,31 @@ jobs: + - job: oldest_test + pool: + vmImage: ubuntu-latest + container: ubuntu:14.04 + steps: + - bash: | + sudo apt update + sudo apt install -y --no-install-recommends \ + python-dev \ + gcc \ + libaugeas0 \ + libssl-dev \ + libffi-dev \ + ca-certificates \ + nginx-light \ + openssl + displayName: Install Linux dependencies + - task: UsePythonVersion@0 + inputs: + versionSpec: 2.7 + addToPath: true + - script: | + python tools/pip_install.py -U tox coverage + displayName: Install dependencies + - script: | + python -m tox -e py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest + displayName: Run tox - job: test strategy: matrix: From a2d0c7357847a8bce0c90135f32fd90b7b7f360e Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:25:09 +0200 Subject: [PATCH 005/172] Focus on oldest tests --- .../templates/standard-tests-suite.yml | 153 +++++++++--------- 1 file changed, 77 insertions(+), 76 deletions(-) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index d59de9ce4..5ec406718 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -21,82 +21,83 @@ jobs: versionSpec: 2.7 addToPath: true - script: | - python tools/pip_install.py -U tox coverage + python -m virtualenv venv + venv/bin/python tools/pip_install.py -U tox coverage displayName: Install dependencies - script: | - python -m tox -e py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest + venv/bin/python -m tox -e py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest displayName: Run tox - - job: test - strategy: - matrix: - macos-py27: - IMAGE_NAME: macOS-10.14 - PYTHON_VERSION: 2.7 - TOXENV: py27 - macos-py38: - IMAGE_NAME: macOS-10.14 - PYTHON_VERSION: 3.8 - TOXENV: py38 - windows-py35: - IMAGE_NAME: vs2017-win2016 - PYTHON_VERSION: 3.5 - TOXENV: py35 - windows-py37-cover: - IMAGE_NAME: vs2017-win2016 - PYTHON_VERSION: 3.7 - TOXENV: py37-cover - windows-integration-certbot: - IMAGE_NAME: vs2017-win2016 - PYTHON_VERSION: 3.7 - TOXENV: integration-certbot - PYTEST_ADDOPTS: --numprocesses 4 - linux-py27: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 2.7 - TOXENV: py27 - linux-py35: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 3.5 - TOXENV: py35 - linux-py38-cover: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 3.8 - TOXENV: py27-cover - linux-py37-lint: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 3.7 - TOXENV: lint - linux-py35-mypy: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 3.5 - TOXENV: mypy - pool: - vmImage: $(IMAGE_NAME) - steps: - - bash: | - brew install augeas - condition: startswith(variables['IMAGE_NAME'], 'macOS') - displayName: Install MacOS dependencies - - bash: | - sudo apt update - sudo apt install -y --no-install-recommends \ - python-dev \ - gcc \ - libaugeas0 \ - libssl-dev \ - libffi-dev \ - ca-certificates \ - nginx-light \ - openssl - condition: startswith(variables['IMAGE_NAME'], 'ubuntu') - displayName: Install Linux dependencies - - task: UsePythonVersion@0 - inputs: - versionSpec: $(PYTHON_VERSION) - addToPath: true - - script: | - python tools/pip_install.py -U tox coverage - displayName: Install dependencies - - script: | - python -m tox - displayName: Run tox +# - job: test +# strategy: +# matrix: +# macos-py27: +# IMAGE_NAME: macOS-10.14 +# PYTHON_VERSION: 2.7 +# TOXENV: py27 +# macos-py38: +# IMAGE_NAME: macOS-10.14 +# PYTHON_VERSION: 3.8 +# TOXENV: py38 +# windows-py35: +# IMAGE_NAME: vs2017-win2016 +# PYTHON_VERSION: 3.5 +# TOXENV: py35 +# windows-py37-cover: +# IMAGE_NAME: vs2017-win2016 +# PYTHON_VERSION: 3.7 +# TOXENV: py37-cover +# windows-integration-certbot: +# IMAGE_NAME: vs2017-win2016 +# PYTHON_VERSION: 3.7 +# TOXENV: integration-certbot +# PYTEST_ADDOPTS: --numprocesses 4 +# linux-py27: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 2.7 +# TOXENV: py27 +# linux-py35: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 3.5 +# TOXENV: py35 +# linux-py38-cover: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 3.8 +# TOXENV: py27-cover +# linux-py37-lint: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 3.7 +# TOXENV: lint +# linux-py35-mypy: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 3.5 +# TOXENV: mypy +# pool: +# vmImage: $(IMAGE_NAME) +# steps: +# - bash: | +# brew install augeas +# condition: startswith(variables['IMAGE_NAME'], 'macOS') +# displayName: Install MacOS dependencies +# - bash: | +# sudo apt update +# sudo apt install -y --no-install-recommends \ +# python-dev \ +# gcc \ +# libaugeas0 \ +# libssl-dev \ +# libffi-dev \ +# ca-certificates \ +# nginx-light \ +# openssl +# condition: startswith(variables['IMAGE_NAME'], 'ubuntu') +# displayName: Install Linux dependencies +# - task: UsePythonVersion@0 +# inputs: +# versionSpec: $(PYTHON_VERSION) +# addToPath: true +# - script: | +# python tools/pip_install.py -U tox coverage +# displayName: Install dependencies +# - script: | +# python -m tox +# displayName: Run tox From d430c2af441a3aebb17d46f31093716eb71eb8c8 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:27:50 +0200 Subject: [PATCH 006/172] Other attempt --- .azure-pipelines/templates/standard-tests-suite.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index 5ec406718..104d53e1e 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -8,6 +8,7 @@ jobs: sudo apt update sudo apt install -y --no-install-recommends \ python-dev \ + python-pip \ gcc \ libaugeas0 \ libssl-dev \ @@ -16,16 +17,11 @@ jobs: nginx-light \ openssl displayName: Install Linux dependencies - - task: UsePythonVersion@0 - inputs: - versionSpec: 2.7 - addToPath: true - script: | - python -m virtualenv venv - venv/bin/python tools/pip_install.py -U tox coverage + pip install -U tox coverage displayName: Install dependencies - script: | - venv/bin/python -m tox -e py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest + python -m tox -e py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest displayName: Run tox # - job: test # strategy: From 3072ead927641ae767d0d1963bdeb93d647218a5 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:32:35 +0200 Subject: [PATCH 007/172] Upgrade system --- .azure-pipelines/templates/standard-tests-suite.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index 104d53e1e..b54a0ec8e 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -18,7 +18,8 @@ jobs: openssl displayName: Install Linux dependencies - script: | - pip install -U tox coverage + pip install --upgrade pip setuptools wheel + pip install -U tox displayName: Install dependencies - script: | python -m tox -e py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest From 542a8e3e9f314cda8a75fce97d4ce3ceaa4dcf85 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:35:15 +0200 Subject: [PATCH 008/172] Sudo --- .azure-pipelines/templates/standard-tests-suite.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index b54a0ec8e..01f0bd3ef 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -5,8 +5,8 @@ jobs: container: ubuntu:14.04 steps: - bash: | - sudo apt update - sudo apt install -y --no-install-recommends \ + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ python-dev \ python-pip \ gcc \ @@ -18,7 +18,7 @@ jobs: openssl displayName: Install Linux dependencies - script: | - pip install --upgrade pip setuptools wheel + sudo pip install --upgrade pip setuptools wheel pip install -U tox displayName: Install dependencies - script: | @@ -76,8 +76,8 @@ jobs: # condition: startswith(variables['IMAGE_NAME'], 'macOS') # displayName: Install MacOS dependencies # - bash: | -# sudo apt update -# sudo apt install -y --no-install-recommends \ +# sudo apt-get update +# sudo apt-get install -y --no-install-recommends \ # python-dev \ # gcc \ # libaugeas0 \ From 14a86020b1f0881b8b0e34ef83e80377e0106f76 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:38:37 +0200 Subject: [PATCH 009/172] TOXENV --- .azure-pipelines/templates/standard-tests-suite.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index 01f0bd3ef..3e94d5f71 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -3,6 +3,8 @@ jobs: pool: vmImage: ubuntu-latest container: ubuntu:14.04 + variables: + TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest steps: - bash: | sudo apt-get update @@ -22,7 +24,7 @@ jobs: pip install -U tox displayName: Install dependencies - script: | - python -m tox -e py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest + python -m tox displayName: Run tox # - job: test # strategy: From da59a4f4a8e2aee092bc052adc9952b08c0d2d1a Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:39:45 +0200 Subject: [PATCH 010/172] Use pip_install --- .azure-pipelines/templates/standard-tests-suite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index 3e94d5f71..e7e7f5927 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -21,7 +21,7 @@ jobs: displayName: Install Linux dependencies - script: | sudo pip install --upgrade pip setuptools wheel - pip install -U tox + python tools/pip_install.py -U tox displayName: Install dependencies - script: | python -m tox From 1854740bcf880df4db34368ae00e7d19f8c8f297 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:48:10 +0200 Subject: [PATCH 011/172] Add apache_compat --- .../templates/standard-tests-suite.yml | 160 ++++++++++-------- 1 file changed, 86 insertions(+), 74 deletions(-) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index e7e7f5927..2df754679 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -26,77 +26,89 @@ jobs: - script: | python -m tox displayName: Run tox -# - job: test -# strategy: -# matrix: -# macos-py27: -# IMAGE_NAME: macOS-10.14 -# PYTHON_VERSION: 2.7 -# TOXENV: py27 -# macos-py38: -# IMAGE_NAME: macOS-10.14 -# PYTHON_VERSION: 3.8 -# TOXENV: py38 -# windows-py35: -# IMAGE_NAME: vs2017-win2016 -# PYTHON_VERSION: 3.5 -# TOXENV: py35 -# windows-py37-cover: -# IMAGE_NAME: vs2017-win2016 -# PYTHON_VERSION: 3.7 -# TOXENV: py37-cover -# windows-integration-certbot: -# IMAGE_NAME: vs2017-win2016 -# PYTHON_VERSION: 3.7 -# TOXENV: integration-certbot -# PYTEST_ADDOPTS: --numprocesses 4 -# linux-py27: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 2.7 -# TOXENV: py27 -# linux-py35: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 3.5 -# TOXENV: py35 -# linux-py38-cover: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 3.8 -# TOXENV: py27-cover -# linux-py37-lint: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 3.7 -# TOXENV: lint -# linux-py35-mypy: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 3.5 -# TOXENV: mypy -# pool: -# vmImage: $(IMAGE_NAME) -# steps: -# - bash: | -# brew install augeas -# condition: startswith(variables['IMAGE_NAME'], 'macOS') -# displayName: Install MacOS dependencies -# - bash: | -# sudo apt-get update -# sudo apt-get install -y --no-install-recommends \ -# python-dev \ -# gcc \ -# libaugeas0 \ -# libssl-dev \ -# libffi-dev \ -# ca-certificates \ -# nginx-light \ -# openssl -# condition: startswith(variables['IMAGE_NAME'], 'ubuntu') -# displayName: Install Linux dependencies -# - task: UsePythonVersion@0 -# inputs: -# versionSpec: $(PYTHON_VERSION) -# addToPath: true -# - script: | -# python tools/pip_install.py -U tox coverage -# displayName: Install dependencies -# - script: | -# python -m tox -# displayName: Run tox + - job: apache_compat + pool: + vmImage: ubuntu-latest + variables: + TOXENV: apache_compat + steps: + - script: | + python tools/pip_install.py -U tox + displayName: Install dependencies + - script: | + python -m tox + displayName: Run tox + - job: test + strategy: + matrix: + macos-py27: + IMAGE_NAME: macOS-10.14 + PYTHON_VERSION: 2.7 + TOXENV: py27 + macos-py38: + IMAGE_NAME: macOS-10.14 + PYTHON_VERSION: 3.8 + TOXENV: py38 + windows-py35: + IMAGE_NAME: vs2017-win2016 + PYTHON_VERSION: 3.5 + TOXENV: py35 + windows-py37-cover: + IMAGE_NAME: vs2017-win2016 + PYTHON_VERSION: 3.7 + TOXENV: py37-cover + windows-integration-certbot: + IMAGE_NAME: vs2017-win2016 + PYTHON_VERSION: 3.7 + TOXENV: integration-certbot + PYTEST_ADDOPTS: --numprocesses 4 + linux-py27: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 2.7 + TOXENV: py27 + linux-py35: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.5 + TOXENV: py35 + linux-py38-cover: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.8 + TOXENV: py27-cover + linux-py37-lint: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.7 + TOXENV: lint + linux-py35-mypy: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.5 + TOXENV: mypy + pool: + vmImage: $(IMAGE_NAME) + steps: + - bash: | + brew install augeas + condition: startswith(variables['IMAGE_NAME'], 'macOS') + displayName: Install MacOS dependencies + - bash: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + python-dev \ + gcc \ + libaugeas0 \ + libssl-dev \ + libffi-dev \ + ca-certificates \ + nginx-light \ + openssl + condition: startswith(variables['IMAGE_NAME'], 'ubuntu') + displayName: Install Linux dependencies + - task: UsePythonVersion@0 + inputs: + versionSpec: $(PYTHON_VERSION) + addToPath: true + - script: | + python tools/pip_install.py -U tox coverage + displayName: Install dependencies + - script: | + python -m tox + displayName: Run tox From b85f1b92140c6ac439cfa244b308d459988e1985 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 15:52:25 +0200 Subject: [PATCH 012/172] Remove interactive, we are not in a terminal --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 46e73e32f..9a52b4a4b 100644 --- a/tox.ini +++ b/tox.ini @@ -170,7 +170,7 @@ commands = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t apache-compat -f certbot-compatibility-test/Dockerfile-apache . - docker run --rm -it apache-compat -c apache.tar.gz -vvvv + docker run --rm apache-compat -c apache.tar.gz -vvvv whitelist_externals = docker passenv = From 289bde4a3a732e8ff238d2b5d4388ed6f09ab2f9 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 16:37:22 +0200 Subject: [PATCH 013/172] Update dependencies --- .azure-pipelines/templates/standard-tests-suite.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests-suite.yml index 2df754679..65ffd4f1e 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests-suite.yml @@ -11,13 +11,12 @@ jobs: sudo apt-get install -y --no-install-recommends \ python-dev \ python-pip \ + git \ gcc \ libaugeas0 \ libssl-dev \ libffi-dev \ - ca-certificates \ - nginx-light \ - openssl + ca-certificates displayName: Install Linux dependencies - script: | sudo pip install --upgrade pip setuptools wheel From a2fb9ff295f0ff9f4eeea83a57f4445c8ac7a3e4 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 16:59:07 +0200 Subject: [PATCH 014/172] Prepare advanced logic --- .azure-pipelines/advanced-test.yml | 4 +- .azure-pipelines/advanced.yml | 4 +- .azure-pipelines/main.yml | 2 +- .azure-pipelines/release.yml | 4 +- ...dows-installer-tests.yml => packaging.yml} | 49 +++++++++++++++++++ ...ard-tests-suite.yml => standard-tests.yml} | 7 ++- 6 files changed, 62 insertions(+), 8 deletions(-) rename .azure-pipelines/templates/{windows-installer-tests.yml => packaging.yml} (58%) rename .azure-pipelines/templates/{standard-tests-suite.yml => standard-tests.yml} (94%) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index a97e0a802..5b0170996 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -9,5 +9,5 @@ pr: none jobs: # Any addition here should be reflected in the advanced and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-suite.yml - - template: templates/windows-installer-tests.yml + - template: templates/standard-tests.yml + - template: templates/packaging.yml diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index d390e2dfa..c572b0c52 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -14,5 +14,5 @@ schedules: jobs: # Any addition here should be reflected in the advanced-test and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-suite.yml - - template: templates/windows-installer-tests.yml + - template: templates/standard-tests.yml + - template: templates/packaging.yml diff --git a/.azure-pipelines/main.yml b/.azure-pipelines/main.yml index 2da57cb5a..1cc96caa3 100644 --- a/.azure-pipelines/main.yml +++ b/.azure-pipelines/main.yml @@ -5,4 +5,4 @@ pr: - '*.x' jobs: - - template: templates/standard-tests-suite.yml + - template: templates/standard-tests.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index 75f7eecfa..687e1ac1b 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -8,6 +8,6 @@ pr: none jobs: # Any addition here should be reflected in the advanced and advanced-test pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-suite.yml - - template: templates/windows-installer-tests.yml + - template: templates/standard-tests.yml + - template: templates/packaging.yml - template: templates/changelog.yml diff --git a/.azure-pipelines/templates/windows-installer-tests.yml b/.azure-pipelines/templates/packaging.yml similarity index 58% rename from .azure-pipelines/templates/windows-installer-tests.yml rename to .azure-pipelines/templates/packaging.yml index ebadcb2dc..67806b5a5 100644 --- a/.azure-pipelines/templates/windows-installer-tests.yml +++ b/.azure-pipelines/templates/packaging.yml @@ -59,3 +59,52 @@ jobs: set PATH=%ProgramFiles(x86)%\Certbot\bin;%PATH% venv\Scripts\python -m pytest certbot-ci\certbot_integration_tests\certbot_tests -n 4 displayName: Run certbot integration tests + - job: snap_build + pool: + vmImage: ubuntu-18.04 + steps: + - script: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends snap + sudo snap install --classic snapcraft + snap install lxd + displayName: Install dependencies + - script: | + snap/local/build_and_install.sh + displayName: Built Certbot snap + - task: CopyFiles@2 + inputs: + sourceFolder: $(System.DefaultWorkingDirectory)/windows-installer/build/nsis + contents: 'certbot_*.snap' + targetFolder: $(Build.ArtifactStagingDirectory) + - task: PublishPipelineArtifact@1 + inputs: + path: $(Build.ArtifactStagingDirectory) + artifact: snap + displayName: Publish Snap + - job: snap_run + pool: + vmImage: ubuntu-18.04 + variables: + TOXENV: integration-external,apacheconftest-external-with-pebble + steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: 3.8 + addToPath: true + - script: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends nginx-light snap + python tools/pip_install.py -U tox + displayName: Install dependencies + - task: DownloadPipelineArtifact@2 + inputs: + artifact: snap + path: $(Build.SourcesDirectory)/snap + displayName: Retrieve Certbot snap + - script: | + sudo snap install --dangerous --classic snap/*.snap + displayName: Install Certbot snap + - script: | + python -m tox + displayName: Run tox diff --git a/.azure-pipelines/templates/standard-tests-suite.yml b/.azure-pipelines/templates/standard-tests.yml similarity index 94% rename from .azure-pipelines/templates/standard-tests-suite.yml rename to .azure-pipelines/templates/standard-tests.yml index 65ffd4f1e..f47ea58f7 100644 --- a/.azure-pipelines/templates/standard-tests-suite.yml +++ b/.azure-pipelines/templates/standard-tests.yml @@ -6,7 +6,7 @@ jobs: variables: TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest steps: - - bash: | + - script: | sudo apt-get update sudo apt-get install -y --no-install-recommends \ python-dev \ @@ -81,6 +81,11 @@ jobs: IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.5 TOXENV: mypy + linux-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 2.7 + TOXENV: integration + ACME_SERVER: pebble pool: vmImage: $(IMAGE_NAME) steps: From 88d69e2251d7c8268db78f5f832d0a9c96f15305 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 17:01:09 +0200 Subject: [PATCH 015/172] Add dep --- .azure-pipelines/templates/packaging.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/templates/packaging.yml b/.azure-pipelines/templates/packaging.yml index 67806b5a5..9b82fae05 100644 --- a/.azure-pipelines/templates/packaging.yml +++ b/.azure-pipelines/templates/packaging.yml @@ -60,6 +60,7 @@ jobs: venv\Scripts\python -m pytest certbot-ci\certbot_integration_tests\certbot_tests -n 4 displayName: Run certbot integration tests - job: snap_build + dependsOn: snap_build pool: vmImage: ubuntu-18.04 steps: From 76ee725de8b65b911147759d6c6b4df04d652b61 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 17:18:34 +0200 Subject: [PATCH 016/172] Fix build dep --- .azure-pipelines/templates/packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/packaging.yml b/.azure-pipelines/templates/packaging.yml index 9b82fae05..4b50bb911 100644 --- a/.azure-pipelines/templates/packaging.yml +++ b/.azure-pipelines/templates/packaging.yml @@ -60,7 +60,6 @@ jobs: venv\Scripts\python -m pytest certbot-ci\certbot_integration_tests\certbot_tests -n 4 displayName: Run certbot integration tests - job: snap_build - dependsOn: snap_build pool: vmImage: ubuntu-18.04 steps: @@ -84,6 +83,7 @@ jobs: artifact: snap displayName: Publish Snap - job: snap_run + dependsOn: snap_build pool: vmImage: ubuntu-18.04 variables: From 14098689705a6161e81ad42f0fa4e1882efc21bf Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 17:32:54 +0200 Subject: [PATCH 017/172] Sudo --- .azure-pipelines/templates/packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/packaging.yml b/.azure-pipelines/templates/packaging.yml index 4b50bb911..5ff9d32c9 100644 --- a/.azure-pipelines/templates/packaging.yml +++ b/.azure-pipelines/templates/packaging.yml @@ -67,7 +67,7 @@ jobs: sudo apt-get update sudo apt-get install -y --no-install-recommends snap sudo snap install --classic snapcraft - snap install lxd + sudo snap install lxd displayName: Install dependencies - script: | snap/local/build_and_install.sh From 15b59d8589192d590c7b78840395479044f64202 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 17:41:31 +0200 Subject: [PATCH 018/172] Detect also Azure Pipelines --- snap/local/build_and_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/local/build_and_install.sh b/snap/local/build_and_install.sh index 4c9754d3e..833027a8c 100755 --- a/snap/local/build_and_install.sh +++ b/snap/local/build_and_install.sh @@ -1,7 +1,7 @@ #!/bin/bash set -ex -if [[ -z "$TRAVIS" ]]; then +if [[ -z "$TRAVIS" && -z "$SYSTEM_TEAMFOUNDATIONSERVERURI" ]]; then echo "This script makes global changes to the system it is run on so should only be run in CI." exit 1 fi From ebd9ffc306d19b3d107655c49a38bcb5b2cd467d Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 17:49:24 +0200 Subject: [PATCH 019/172] Fix source folder --- .azure-pipelines/templates/packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/packaging.yml b/.azure-pipelines/templates/packaging.yml index 5ff9d32c9..32ba9bb5c 100644 --- a/.azure-pipelines/templates/packaging.yml +++ b/.azure-pipelines/templates/packaging.yml @@ -74,7 +74,7 @@ jobs: displayName: Built Certbot snap - task: CopyFiles@2 inputs: - sourceFolder: $(System.DefaultWorkingDirectory)/windows-installer/build/nsis + sourceFolder: $(System.DefaultWorkingDirectory) contents: 'certbot_*.snap' targetFolder: $(Build.ArtifactStagingDirectory) - task: PublishPipelineArtifact@1 From 57a9d9375094bf6fc534bf5a9deb459f7ec7749b Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 18:36:25 +0200 Subject: [PATCH 020/172] Add extended tests --- .azure-pipelines/advanced-test.yml | 1 + .azure-pipelines/advanced.yml | 1 + .azure-pipelines/release.yml | 1 + .azure-pipelines/templates/extended-tests.yml | 157 ++++++++++++++++++ .azure-pipelines/templates/packaging.yml | 6 +- .azure-pipelines/templates/standard-tests.yml | 54 +++--- 6 files changed, 188 insertions(+), 32 deletions(-) create mode 100644 .azure-pipelines/templates/extended-tests.yml diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 5b0170996..54b695730 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -10,4 +10,5 @@ jobs: # Any addition here should be reflected in the advanced and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - template: templates/standard-tests.yml + - template: templates/extended-tests.yml - template: templates/packaging.yml diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index c572b0c52..1ff8cd1af 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -15,4 +15,5 @@ jobs: # Any addition here should be reflected in the advanced-test and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - template: templates/standard-tests.yml + - template: templates/extended-tests.yml - template: templates/packaging.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index 687e1ac1b..dc1c1c690 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -9,5 +9,6 @@ jobs: # Any addition here should be reflected in the advanced and advanced-test pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - template: templates/standard-tests.yml + - template: templates/extended-tests.yml - template: templates/packaging.yml - template: templates/changelog.yml diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests.yml new file mode 100644 index 000000000..e98bddfa2 --- /dev/null +++ b/.azure-pipelines/templates/extended-tests.yml @@ -0,0 +1,157 @@ +jobs: + - job: docker + strategy: + matrix: + nginx-compat: + TOXENV: nginx-compat + le-auto-jessie: + TOXENV: le_auto_jessie + le-auto-centos6: + TOXENV: le_auto_centos6 + le-auto-oraclelinux6: + TOXENV: le_auto_oraclelinux6 + dev: + TOXENV: docker_dev + pool: + vmImage: ubuntu-latest + steps: + - script: | + sudo apt-get update + sudo apt-get install libaugeas0 + python tools/pip_install.py -U tox + displayName: Install dependencies + - script: | + python -m tox + displayName: Run tox + - job: extended_test + strategy: + matrix: + linux-py36: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.6 + TOXENV: py35 + linux-py37: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.7 + TOXENV: py35 + linux-py37-nopin: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.7 + TOXENV: py37 + CERTBOT_NO_PIN: 1 + linux-boulder-v1-py27-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 2.7 + TOXENV: integration + ACME_SERVER: boulder-v1 + linux-boulder-v2-py27-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 2.7 + TOXENV: integration + ACME_SERVER: boulder-v2 + linux-boulder-v1-py35-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.5 + TOXENV: integration + ACME_SERVER: boulder-v1 + linux-boulder-v2-py35-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.5 + TOXENV: integration + ACME_SERVER: boulder-v2 + linux-boulder-v1-py36-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.6 + TOXENV: integration + ACME_SERVER: boulder-v1 + linux-boulder-v2-py36-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.6 + TOXENV: integration + ACME_SERVER: boulder-v2 + linux-boulder-v1-py37-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.7 + TOXENV: integration + ACME_SERVER: boulder-v1 + linux-boulder-v2-py37-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.7 + TOXENV: integration + ACME_SERVER: boulder-v2 + linux-boulder-v1-py38-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.8 + TOXENV: integration + ACME_SERVER: boulder-v1 + linux-boulder-v2-py38-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.8 + TOXENV: integration + ACME_SERVER: boulder-v2 + pool: + vmImage: $(IMAGE_NAME) + steps: + - bash: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + python-dev \ + gcc \ + libaugeas0 \ + libssl-dev \ + libffi-dev \ + ca-certificates \ + nginx-light \ + openssl + condition: startswith(variables['IMAGE_NAME'], 'ubuntu') + displayName: Install Linux dependencies + - task: UsePythonVersion@0 + inputs: + versionSpec: $(PYTHON_VERSION) + addToPath: true + - script: | + python tools/pip_install.py -U tox coverage + displayName: Install dependencies + - script: | + python -m tox + displayName: Run tox + - job: oldest_extended_test + pool: + vmImage: ubuntu-latest + container: ubuntu:14.04 + strategy: + matrix: + linux-boulder-v1-integration-certbot: + TOXENV: integration-certbot-oldest + ACME_SERVER: boulder-v1 + linux-boulder-v2-integration-certbot: + TOXENV: integration-certbot-oldest + ACME_SERVER: boulder-v2 + linux-boulder-v1-integration-nginx: + TOXENV: integration-nginx-oldest + ACME_SERVER: boulder-v1 + linux-boulder-v2-integration-nginx: + TOXENV: integration-nginx-oldest + 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 + 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 diff --git a/.azure-pipelines/templates/packaging.yml b/.azure-pipelines/templates/packaging.yml index 32ba9bb5c..d7c57d40a 100644 --- a/.azure-pipelines/templates/packaging.yml +++ b/.azure-pipelines/templates/packaging.yml @@ -75,7 +75,7 @@ jobs: - task: CopyFiles@2 inputs: sourceFolder: $(System.DefaultWorkingDirectory) - contents: 'certbot_*.snap' + contents: '*.snap' targetFolder: $(Build.ArtifactStagingDirectory) - task: PublishPipelineArtifact@1 inputs: @@ -89,10 +89,6 @@ jobs: variables: TOXENV: integration-external,apacheconftest-external-with-pebble steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: 3.8 - addToPath: true - script: | sudo apt-get update sudo apt-get install -y --no-install-recommends nginx-light snap diff --git a/.azure-pipelines/templates/standard-tests.yml b/.azure-pipelines/templates/standard-tests.yml index f47ea58f7..ae7d41461 100644 --- a/.azure-pipelines/templates/standard-tests.yml +++ b/.azure-pipelines/templates/standard-tests.yml @@ -89,30 +89,30 @@ jobs: pool: vmImage: $(IMAGE_NAME) steps: - - bash: | - brew install augeas - condition: startswith(variables['IMAGE_NAME'], 'macOS') - displayName: Install MacOS dependencies - - bash: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - python-dev \ - gcc \ - libaugeas0 \ - libssl-dev \ - libffi-dev \ - ca-certificates \ - nginx-light \ - openssl - condition: startswith(variables['IMAGE_NAME'], 'ubuntu') - displayName: Install Linux dependencies - - task: UsePythonVersion@0 - inputs: - versionSpec: $(PYTHON_VERSION) - addToPath: true - - script: | - python tools/pip_install.py -U tox coverage - displayName: Install dependencies - - script: | - python -m tox - displayName: Run tox + - bash: | + brew install augeas + condition: startswith(variables['IMAGE_NAME'], 'macOS') + displayName: Install MacOS dependencies + - bash: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + python-dev \ + gcc \ + libaugeas0 \ + libssl-dev \ + libffi-dev \ + ca-certificates \ + nginx-light \ + openssl + condition: startswith(variables['IMAGE_NAME'], 'ubuntu') + displayName: Install Linux dependencies + - task: UsePythonVersion@0 + inputs: + versionSpec: $(PYTHON_VERSION) + addToPath: true + - script: | + python tools/pip_install.py -U tox coverage + displayName: Install dependencies + - script: | + python -m tox + displayName: Run tox From 6587efba456390423ca8fab584b32c626293586b Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 18:48:57 +0200 Subject: [PATCH 021/172] Remove -it --- .azure-pipelines/templates/extended-tests.yml | 2 +- tox.ini | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests.yml index e98bddfa2..090745316 100644 --- a/.azure-pipelines/templates/extended-tests.yml +++ b/.azure-pipelines/templates/extended-tests.yml @@ -3,7 +3,7 @@ jobs: strategy: matrix: nginx-compat: - TOXENV: nginx-compat + TOXENV: nginx_compat le-auto-jessie: TOXENV: le_auto_jessie le-auto-centos6: diff --git a/tox.ini b/tox.ini index 9a52b4a4b..141b59cca 100644 --- a/tox.ini +++ b/tox.ini @@ -180,7 +180,7 @@ passenv = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t nginx-compat -f certbot-compatibility-test/Dockerfile-nginx . - docker run --rm -it nginx-compat -c nginx.tar.gz -vv -aie + docker run --rm nginx-compat -c nginx.tar.gz -vv -aie whitelist_externals = docker passenv = @@ -191,7 +191,7 @@ passenv = commands = python {toxinidir}/tests/modification-check.py docker build -f letsencrypt-auto-source/Dockerfile.xenial -t lea letsencrypt-auto-source - docker run --rm -t -i lea + docker run --rm lea whitelist_externals = docker passenv = @@ -203,7 +203,7 @@ passenv = # readily available on the Wheezy Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.jessie -t lea letsencrypt-auto-source - docker run --rm -t -i lea + docker run --rm lea whitelist_externals = docker passenv = DOCKER_* @@ -213,7 +213,7 @@ passenv = DOCKER_* # readily available on the CentOS 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=centos -t lea letsencrypt-auto-source - docker run --rm -t -i lea + docker run --rm lea whitelist_externals = docker passenv = DOCKER_* @@ -223,7 +223,7 @@ passenv = DOCKER_* # readily available on the Oracle Linux 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=oraclelinux -t lea letsencrypt-auto-source - docker run --rm -t -i lea + docker run --rm lea whitelist_externals = docker passenv = DOCKER_* From f9b00f71ac640def0c25a67a8cc98a59ccbcc025 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 19:28:18 +0200 Subject: [PATCH 022/172] Simple move --- .azure-pipelines/templates/packaging.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/templates/packaging.yml b/.azure-pipelines/templates/packaging.yml index d7c57d40a..80b47ba79 100644 --- a/.azure-pipelines/templates/packaging.yml +++ b/.azure-pipelines/templates/packaging.yml @@ -71,12 +71,8 @@ jobs: displayName: Install dependencies - script: | snap/local/build_and_install.sh - displayName: Built Certbot snap - - task: CopyFiles@2 - inputs: - sourceFolder: $(System.DefaultWorkingDirectory) - contents: '*.snap' - targetFolder: $(Build.ArtifactStagingDirectory) + mv *.snap $SYSTEM_ARTIFACTSTAGINGDIRECTORY + displayName: Build Certbot snap - task: PublishPipelineArtifact@1 inputs: path: $(Build.ArtifactStagingDirectory) From fa302fe0ab7217c2776e4a1d8b70b3a6fa144b70 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 19:35:23 +0200 Subject: [PATCH 023/172] Install docker CLI locally --- .azure-pipelines/templates/extended-tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests.yml index 090745316..d2214f648 100644 --- a/.azure-pipelines/templates/extended-tests.yml +++ b/.azure-pipelines/templates/extended-tests.yml @@ -146,9 +146,10 @@ jobs: libffi-dev \ ca-certificates \ nginx-light \ - openssl - displayName: Install Linux dependencies - - script: | + 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 From ec73fa4fa91cb129a0d5b266c56aa9246089afd8 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 19:37:23 +0200 Subject: [PATCH 024/172] Fix unit tests --- .azure-pipelines/templates/extended-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests.yml index d2214f648..799721989 100644 --- a/.azure-pipelines/templates/extended-tests.yml +++ b/.azure-pipelines/templates/extended-tests.yml @@ -29,11 +29,11 @@ jobs: linux-py36: IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.6 - TOXENV: py35 + TOXENV: py36 linux-py37: IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.7 - TOXENV: py35 + TOXENV: py37 linux-py37-nopin: IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.7 From eb2222a41d5c926dad274463386fb804f040bcd1 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 19:44:40 +0200 Subject: [PATCH 025/172] Run interactive, but without tty --- tox.ini | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 141b59cca..825a8f430 100644 --- a/tox.ini +++ b/tox.ini @@ -170,7 +170,7 @@ commands = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t apache-compat -f certbot-compatibility-test/Dockerfile-apache . - docker run --rm apache-compat -c apache.tar.gz -vvvv + docker run --rm -i apache-compat -c apache.tar.gz -vvvv whitelist_externals = docker passenv = @@ -180,7 +180,7 @@ passenv = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t nginx-compat -f certbot-compatibility-test/Dockerfile-nginx . - docker run --rm nginx-compat -c nginx.tar.gz -vv -aie + docker run --rm -i nginx-compat -c nginx.tar.gz -vv -aie whitelist_externals = docker passenv = @@ -191,7 +191,7 @@ passenv = commands = python {toxinidir}/tests/modification-check.py docker build -f letsencrypt-auto-source/Dockerfile.xenial -t lea letsencrypt-auto-source - docker run --rm lea + docker run --rm -i lea whitelist_externals = docker passenv = @@ -203,7 +203,7 @@ passenv = # readily available on the Wheezy Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.jessie -t lea letsencrypt-auto-source - docker run --rm lea + docker run --rm -i lea whitelist_externals = docker passenv = DOCKER_* @@ -213,7 +213,7 @@ passenv = DOCKER_* # readily available on the CentOS 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=centos -t lea letsencrypt-auto-source - docker run --rm lea + docker run --rm -i lea whitelist_externals = docker passenv = DOCKER_* @@ -223,7 +223,7 @@ passenv = DOCKER_* # readily available on the Oracle Linux 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=oraclelinux -t lea letsencrypt-auto-source - docker run --rm lea + docker run --rm -i lea whitelist_externals = docker passenv = DOCKER_* From dfb0eae09f460cc3a7bee959e7c9db6b9688d4d2 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 19:50:00 +0200 Subject: [PATCH 026/172] Add back -it --- tox.ini | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 825a8f430..0f515ee9c 100644 --- a/tox.ini +++ b/tox.ini @@ -170,7 +170,7 @@ commands = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t apache-compat -f certbot-compatibility-test/Dockerfile-apache . - docker run --rm -i apache-compat -c apache.tar.gz -vvvv + docker run --rm -it apache-compat -c apache.tar.gz -vvvv whitelist_externals = docker passenv = @@ -180,7 +180,7 @@ passenv = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t nginx-compat -f certbot-compatibility-test/Dockerfile-nginx . - docker run --rm -i nginx-compat -c nginx.tar.gz -vv -aie + docker run --rm -it nginx-compat -c nginx.tar.gz -vv -aie whitelist_externals = docker passenv = @@ -191,7 +191,7 @@ passenv = commands = python {toxinidir}/tests/modification-check.py docker build -f letsencrypt-auto-source/Dockerfile.xenial -t lea letsencrypt-auto-source - docker run --rm -i lea + docker run --rm -it lea whitelist_externals = docker passenv = @@ -203,7 +203,7 @@ passenv = # readily available on the Wheezy Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.jessie -t lea letsencrypt-auto-source - docker run --rm -i lea + docker run --rm -it lea whitelist_externals = docker passenv = DOCKER_* @@ -213,7 +213,7 @@ passenv = DOCKER_* # readily available on the CentOS 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=centos -t lea letsencrypt-auto-source - docker run --rm -i lea + docker run --rm -it lea whitelist_externals = docker passenv = DOCKER_* @@ -223,7 +223,7 @@ passenv = DOCKER_* # readily available on the Oracle Linux 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=oraclelinux -t lea letsencrypt-auto-source - docker run --rm -i lea + docker run --rm -it lea whitelist_externals = docker passenv = DOCKER_* From c288dfd2a966991bbfc324500a74de46249c08c3 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 19:51:25 +0200 Subject: [PATCH 027/172] Try unbuffer --- .azure-pipelines/templates/extended-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests.yml index 799721989..42f6aa554 100644 --- a/.azure-pipelines/templates/extended-tests.yml +++ b/.azure-pipelines/templates/extended-tests.yml @@ -17,11 +17,11 @@ jobs: steps: - script: | sudo apt-get update - sudo apt-get install libaugeas0 + sudo apt-get install libaugeas0 expect python tools/pip_install.py -U tox displayName: Install dependencies - script: | - python -m tox + unbuffer -p python -m tox displayName: Run tox - job: extended_test strategy: From 309a4d3c699052cb6ad9389d54c5c4c7ac2d6b13 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 19:59:23 +0200 Subject: [PATCH 028/172] Unbuffer also for apache_compat --- .azure-pipelines/templates/standard-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/standard-tests.yml b/.azure-pipelines/templates/standard-tests.yml index ae7d41461..8e5e528f1 100644 --- a/.azure-pipelines/templates/standard-tests.yml +++ b/.azure-pipelines/templates/standard-tests.yml @@ -32,10 +32,12 @@ jobs: TOXENV: apache_compat steps: - script: | + sudo apt-get update + sudo apt-get install expect python tools/pip_install.py -U tox displayName: Install dependencies - script: | - python -m tox + unbuffer -p python -m tox displayName: Run tox - job: test strategy: From e8b3c6713d8ee8a15a8b2926ac145b1ad700c516 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 20:21:09 +0200 Subject: [PATCH 029/172] Another try for snaps --- .azure-pipelines/templates/packaging.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/packaging.yml b/.azure-pipelines/templates/packaging.yml index 80b47ba79..e53837f7a 100644 --- a/.azure-pipelines/templates/packaging.yml +++ b/.azure-pipelines/templates/packaging.yml @@ -71,7 +71,7 @@ jobs: displayName: Install dependencies - script: | snap/local/build_and_install.sh - mv *.snap $SYSTEM_ARTIFACTSTAGINGDIRECTORY + mv *.snap $(Build.ArtifactStagingDirectory) displayName: Build Certbot snap - task: PublishPipelineArtifact@1 inputs: From 9b022a9351d42299a0d10a8a917ca9add320e167 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 20:39:35 +0200 Subject: [PATCH 030/172] Connect runner container to host network --- .azure-pipelines/templates/extended-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests.yml index 42f6aa554..080954ede 100644 --- a/.azure-pipelines/templates/extended-tests.yml +++ b/.azure-pipelines/templates/extended-tests.yml @@ -118,7 +118,9 @@ jobs: - job: oldest_extended_test pool: vmImage: ubuntu-latest - container: ubuntu:14.04 + container: + image: ubuntu:14.04 + options: --network=host strategy: matrix: linux-boulder-v1-integration-certbot: From f821de32583561b188dcf6d21ef14f4d81fee22e Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 20:40:58 +0200 Subject: [PATCH 031/172] Original tox.ini --- tox.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index 0f515ee9c..46e73e32f 100644 --- a/tox.ini +++ b/tox.ini @@ -191,7 +191,7 @@ passenv = commands = python {toxinidir}/tests/modification-check.py docker build -f letsencrypt-auto-source/Dockerfile.xenial -t lea letsencrypt-auto-source - docker run --rm -it lea + docker run --rm -t -i lea whitelist_externals = docker passenv = @@ -203,7 +203,7 @@ passenv = # readily available on the Wheezy Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.jessie -t lea letsencrypt-auto-source - docker run --rm -it lea + docker run --rm -t -i lea whitelist_externals = docker passenv = DOCKER_* @@ -213,7 +213,7 @@ passenv = DOCKER_* # readily available on the CentOS 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=centos -t lea letsencrypt-auto-source - docker run --rm -it lea + docker run --rm -t -i lea whitelist_externals = docker passenv = DOCKER_* @@ -223,7 +223,7 @@ passenv = DOCKER_* # readily available on the Oracle Linux 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=oraclelinux -t lea letsencrypt-auto-source - docker run --rm -it lea + docker run --rm -t -i lea whitelist_externals = docker passenv = DOCKER_* From 2a5c194da2be58c19d77f204855b9191d575cd3e Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 21:38:49 +0200 Subject: [PATCH 032/172] 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 From 93c5396e5ac3aa8e646980e4e0a5e9fb9882bccb Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 21:42:31 +0200 Subject: [PATCH 033/172] Fix coverage and use bare vms --- .azure-pipelines/templates/extended-tests.yml | 5 +---- .azure-pipelines/templates/standard-tests.yml | 1 - 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests.yml index 712fe39ce..e87d2c38e 100644 --- a/.azure-pipelines/templates/extended-tests.yml +++ b/.azure-pipelines/templates/extended-tests.yml @@ -110,7 +110,7 @@ jobs: versionSpec: $(PYTHON_VERSION) addToPath: true - script: | - python tools/pip_install.py -U tox coverage + python tools/pip_install.py -U tox displayName: Install dependencies - script: | python -m tox @@ -118,9 +118,6 @@ jobs: - job: oldest_extended_test pool: vmImage: ubuntu-latest - container: - image: ubuntu:14.04 - options: --network=host strategy: matrix: linux-boulder-v1-integration-certbot: diff --git a/.azure-pipelines/templates/standard-tests.yml b/.azure-pipelines/templates/standard-tests.yml index 6054c4aaf..8c6f98152 100644 --- a/.azure-pipelines/templates/standard-tests.yml +++ b/.azure-pipelines/templates/standard-tests.yml @@ -2,7 +2,6 @@ jobs: - job: oldest_test pool: vmImage: ubuntu-latest - container: ubuntu:14.04 variables: TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest steps: From bf832785bd99de6258961d677f49ae5d682561cc Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 22:24:41 +0200 Subject: [PATCH 034/172] Consistent paths across dockers --- tools/run_oldest_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_oldest_tests.sh b/tools/run_oldest_tests.sh index 5761ef3b7..8e28e580e 100755 --- a/tools/run_oldest_tests.sh +++ b/tools/run_oldest_tests.sh @@ -38,4 +38,4 @@ 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 +docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v "${PWD}:${PWD}" -v "${SCRIPT}:/script.sh" -e TOXENV -e ACME_SERVER -e PYTEST_ADDOPTS -w "${PWD}" --network=host ubuntu:14.04 /script.sh From 8d871a9abea9ed67e649dcee9218c35df8b3fbc9 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 22:48:16 +0200 Subject: [PATCH 035/172] Mount also tmp --- tools/run_oldest_tests.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/run_oldest_tests.sh b/tools/run_oldest_tests.sh index 8e28e580e..b1d15f2db 100755 --- a/tools/run_oldest_tests.sh +++ b/tools/run_oldest_tests.sh @@ -38,4 +38,15 @@ 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}:${PWD}" -v "${SCRIPT}:/script.sh" -e TOXENV -e ACME_SERVER -e PYTEST_ADDOPTS -w "${PWD}" --network=host ubuntu:14.04 /script.sh +docker run \ + --rm \ + -v /var/run/docker.sock:/var/run/docker.sock \ + -v "${PWD}:${PWD}" -v "${SCRIPT}:/script.sh" \ + -v /tmp:/tmp \ + -e TOXENV \ + -e ACME_SERVER \ + -e PYTEST_ADDOPTS \ + -w "${PWD}" \ + --network=host \ + ubuntu:14.04 \ + /script.sh From 0ece985caf418e91d8193875db769736a603c3a8 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 22:58:26 +0200 Subject: [PATCH 036/172] Simplify config --- .azure-pipelines/templates/extended-tests.yml | 22 ++++++------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests.yml index e87d2c38e..98137d119 100644 --- a/.azure-pipelines/templates/extended-tests.yml +++ b/.azure-pipelines/templates/extended-tests.yml @@ -24,73 +24,63 @@ jobs: unbuffer -p python -m tox displayName: Run tox - job: extended_test + variables: + ${{ if eq(variables['TOXENV'], 'integration') }}: + PYTEST_ADDOPTS: --numprocesses 4 strategy: matrix: linux-py36: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.6 TOXENV: py36 linux-py37: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.7 TOXENV: py37 linux-py37-nopin: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.7 TOXENV: py37 CERTBOT_NO_PIN: 1 linux-boulder-v1-py27-integration: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 2.7 TOXENV: integration ACME_SERVER: boulder-v1 linux-boulder-v2-py27-integration: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 2.7 TOXENV: integration ACME_SERVER: boulder-v2 linux-boulder-v1-py35-integration: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.5 TOXENV: integration ACME_SERVER: boulder-v1 linux-boulder-v2-py35-integration: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.5 TOXENV: integration ACME_SERVER: boulder-v2 linux-boulder-v1-py36-integration: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.6 TOXENV: integration ACME_SERVER: boulder-v1 linux-boulder-v2-py36-integration: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.6 TOXENV: integration ACME_SERVER: boulder-v2 linux-boulder-v1-py37-integration: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.7 TOXENV: integration ACME_SERVER: boulder-v1 linux-boulder-v2-py37-integration: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.7 TOXENV: integration ACME_SERVER: boulder-v2 linux-boulder-v1-py38-integration: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.8 TOXENV: integration ACME_SERVER: boulder-v1 linux-boulder-v2-py38-integration: - IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.8 TOXENV: integration ACME_SERVER: boulder-v2 pool: - vmImage: $(IMAGE_NAME) + vmImage: ubuntu-18.04 steps: - bash: | sudo apt-get update @@ -103,7 +93,6 @@ jobs: ca-certificates \ nginx-light \ openssl - condition: startswith(variables['IMAGE_NAME'], 'ubuntu') displayName: Install Linux dependencies - task: UsePythonVersion@0 inputs: @@ -115,10 +104,13 @@ jobs: - script: | python -m tox displayName: Run tox + - job: oldest_extended_test pool: vmImage: ubuntu-latest strategy: + variables: + PYTEST_ADDOPTS: --numprocesses 4 matrix: linux-boulder-v1-integration-certbot: TOXENV: integration-certbot-oldest From b60f656ff9fe31388f7d3c8929e7197708e64925 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 25 Apr 2020 22:59:41 +0200 Subject: [PATCH 037/172] Correct config --- .azure-pipelines/templates/extended-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests.yml index 98137d119..d01e95f80 100644 --- a/.azure-pipelines/templates/extended-tests.yml +++ b/.azure-pipelines/templates/extended-tests.yml @@ -106,11 +106,9 @@ jobs: displayName: Run tox - job: oldest_extended_test - pool: - vmImage: ubuntu-latest + variables: + PYTEST_ADDOPTS: --numprocesses 4 strategy: - variables: - PYTEST_ADDOPTS: --numprocesses 4 matrix: linux-boulder-v1-integration-certbot: TOXENV: integration-certbot-oldest @@ -124,6 +122,8 @@ jobs: linux-boulder-v2-integration-nginx: TOXENV: integration-nginx-oldest ACME_SERVER: boulder-v2 + pool: + vmImage: ubuntu-18.04 steps: - script: | tools/run_oldest_tests.sh From fae43620c5c56cb1e21ab712b242562c11145b34 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 12:09:33 +0200 Subject: [PATCH 038/172] Working oldest test custom script --- tools/run_oldest_tests.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/run_oldest_tests.sh b/tools/run_oldest_tests.sh index b1d15f2db..0e0968db3 100755 --- a/tools/run_oldest_tests.sh +++ b/tools/run_oldest_tests.sh @@ -15,13 +15,11 @@ trap cleanup EXIT SCRIPT=$(mktemp /tmp/test-script.XXXXXX) chmod +x "${SCRIPT}" -cat << EOF >> "${SCRIPT}" -#!/bin/sh +cat << "EOF" >> "${SCRIPT}" +#!/bin/bash set -e apt-get update apt-get install -y --no-install-recommends \ - python-dev \ - python-pip \ git \ gcc \ libaugeas0 \ @@ -30,12 +28,17 @@ apt-get install -y --no-install-recommends \ 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 + curl \ + make +sh <(curl -fsSL https://get.docker.com) +curl -fsSL https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz | tar xvz +cd Python-2.7.18/ +./configure --prefix /usr/local/lib/python --enable-ipv6 +make -j2 && make install +cd .. && rm -rf Python-2.7.18 && cd certbot +/usr/local/lib/python/bin/python -m ensurepip +/usr/local/lib/python/bin/python -m pip install tox +/usr/local/lib/python/bin/python -m tox EOF docker run \ From 1dfb4b348e61ed3aa22360b63a1664c067ad2e7c Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 12:46:32 +0200 Subject: [PATCH 039/172] Try PPA --- tools/run_oldest_tests.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/tools/run_oldest_tests.sh b/tools/run_oldest_tests.sh index 0e0968db3..e4f200720 100755 --- a/tools/run_oldest_tests.sh +++ b/tools/run_oldest_tests.sh @@ -20,6 +20,8 @@ cat << "EOF" >> "${SCRIPT}" set -e apt-get update apt-get install -y --no-install-recommends \ + python-dev \ + python-pip \ git \ gcc \ libaugeas0 \ @@ -29,16 +31,15 @@ apt-get install -y --no-install-recommends \ nginx-light \ openssl \ curl \ - make + software-properties-common +apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BB92C09DB82666C +add-apt-repository ppa:fkrull/deadsnakes-python2.7 +apt-get update +apt-get upgrade -y sh <(curl -fsSL https://get.docker.com) -curl -fsSL https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz | tar xvz -cd Python-2.7.18/ -./configure --prefix /usr/local/lib/python --enable-ipv6 -make -j2 && make install -cd .. && rm -rf Python-2.7.18 && cd certbot -/usr/local/lib/python/bin/python -m ensurepip -/usr/local/lib/python/bin/python -m pip install tox -/usr/local/lib/python/bin/python -m tox +python -m pip install --upgrade pip virtualenv wheel +python -m pip install tox +python -m tox EOF docker run \ From 02603db14435bd8f3d5916f7a3097c34b3c446b4 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 13:52:24 +0200 Subject: [PATCH 040/172] Factor logic with templates --- .azure-pipelines/advanced-test.yml | 6 +- .azure-pipelines/advanced.yml | 6 +- .azure-pipelines/main.yml | 2 +- .azure-pipelines/release.yml | 8 +-- .../{changelog.yml => changelog-jobs.yml} | 0 ...nded-tests.yml => extended-tests-jobs.yml} | 62 ++++--------------- .../{packaging.yml => packaging-jobs.yml} | 0 ...dard-tests.yml => standard-tests-jobs.yml} | 45 ++------------ .azure-pipelines/templates/tox-steps.yml | 31 ++++++++++ 9 files changed, 59 insertions(+), 101 deletions(-) rename .azure-pipelines/templates/{changelog.yml => changelog-jobs.yml} (100%) rename .azure-pipelines/templates/{extended-tests.yml => extended-tests-jobs.yml} (72%) rename .azure-pipelines/templates/{packaging.yml => packaging-jobs.yml} (100%) rename .azure-pipelines/templates/{standard-tests.yml => standard-tests-jobs.yml} (57%) create mode 100644 .azure-pipelines/templates/tox-steps.yml diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 54b695730..025225871 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -9,6 +9,6 @@ pr: none jobs: # Any addition here should be reflected in the advanced and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests.yml - - template: templates/extended-tests.yml - - template: templates/packaging.yml + - template: templates/standard-tests-jobs.yml + - template: templates/extended-tests-jobs.yml + - template: templates/packaging-jobs.yml diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index 1ff8cd1af..c1aebc976 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -14,6 +14,6 @@ schedules: jobs: # Any addition here should be reflected in the advanced-test and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests.yml - - template: templates/extended-tests.yml - - template: templates/packaging.yml + - template: templates/standard-tests-jobs.yml + - template: templates/extended-tests-jobs.yml + - template: templates/packaging-jobs.yml diff --git a/.azure-pipelines/main.yml b/.azure-pipelines/main.yml index 1cc96caa3..723b35d56 100644 --- a/.azure-pipelines/main.yml +++ b/.azure-pipelines/main.yml @@ -5,4 +5,4 @@ pr: - '*.x' jobs: - - template: templates/standard-tests.yml + - template: templates/standard-tests-jobs.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index dc1c1c690..3dea79418 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -8,7 +8,7 @@ pr: none jobs: # Any addition here should be reflected in the advanced and advanced-test pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests.yml - - template: templates/extended-tests.yml - - template: templates/packaging.yml - - template: templates/changelog.yml + - template: templates/standard-tests-jobs.yml + - template: templates/extended-tests-jobs.yml + - template: templates/packaging-jobs.yml + - template: templates/changelog-jobs.yml diff --git a/.azure-pipelines/templates/changelog.yml b/.azure-pipelines/templates/changelog-jobs.yml similarity index 100% rename from .azure-pipelines/templates/changelog.yml rename to .azure-pipelines/templates/changelog-jobs.yml diff --git a/.azure-pipelines/templates/extended-tests.yml b/.azure-pipelines/templates/extended-tests-jobs.yml similarity index 72% rename from .azure-pipelines/templates/extended-tests.yml rename to .azure-pipelines/templates/extended-tests-jobs.yml index d01e95f80..a909b4a67 100644 --- a/.azure-pipelines/templates/extended-tests.yml +++ b/.azure-pipelines/templates/extended-tests-jobs.yml @@ -1,29 +1,5 @@ jobs: - - job: docker - strategy: - matrix: - nginx-compat: - TOXENV: nginx_compat - le-auto-jessie: - TOXENV: le_auto_jessie - le-auto-centos6: - TOXENV: le_auto_centos6 - le-auto-oraclelinux6: - TOXENV: le_auto_oraclelinux6 - dev: - TOXENV: docker_dev - pool: - vmImage: ubuntu-latest - steps: - - script: | - sudo apt-get update - sudo apt-get install libaugeas0 expect - python tools/pip_install.py -U tox - displayName: Install dependencies - - script: | - unbuffer -p python -m tox - displayName: Run tox - - job: extended_test + - job: x_test variables: ${{ if eq(variables['TOXENV'], 'integration') }}: PYTEST_ADDOPTS: --numprocesses 4 @@ -79,33 +55,21 @@ jobs: PYTHON_VERSION: 3.8 TOXENV: integration ACME_SERVER: boulder-v2 + nginx-compat: + TOXENV: nginx_compat + le-auto-jessie: + TOXENV: le_auto_jessie + le-auto-centos6: + TOXENV: le_auto_centos6 + le-auto-oraclelinux6: + TOXENV: le_auto_oraclelinux6 + dev: + TOXENV: docker_dev pool: vmImage: ubuntu-18.04 steps: - - bash: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - python-dev \ - gcc \ - libaugeas0 \ - libssl-dev \ - libffi-dev \ - ca-certificates \ - nginx-light \ - openssl - displayName: Install Linux dependencies - - task: UsePythonVersion@0 - inputs: - versionSpec: $(PYTHON_VERSION) - addToPath: true - - script: | - python tools/pip_install.py -U tox - displayName: Install dependencies - - script: | - python -m tox - displayName: Run tox - - - job: oldest_extended_test + - template: tox-steps.yml + - job: oldest_x_test variables: PYTEST_ADDOPTS: --numprocesses 4 strategy: diff --git a/.azure-pipelines/templates/packaging.yml b/.azure-pipelines/templates/packaging-jobs.yml similarity index 100% rename from .azure-pipelines/templates/packaging.yml rename to .azure-pipelines/templates/packaging-jobs.yml diff --git a/.azure-pipelines/templates/standard-tests.yml b/.azure-pipelines/templates/standard-tests-jobs.yml similarity index 57% rename from .azure-pipelines/templates/standard-tests.yml rename to .azure-pipelines/templates/standard-tests-jobs.yml index 8c6f98152..43597ec6e 100644 --- a/.azure-pipelines/templates/standard-tests.yml +++ b/.azure-pipelines/templates/standard-tests-jobs.yml @@ -8,20 +8,6 @@ jobs: - script: | tools/run_oldest_tests.sh displayName: Run oldest tests - - job: apache_compat - pool: - vmImage: ubuntu-latest - variables: - TOXENV: apache_compat - steps: - - script: | - sudo apt-get update - sudo apt-get install expect - python tools/pip_install.py -U tox - displayName: Install dependencies - - script: | - unbuffer -p python -m tox - displayName: Run tox - job: test strategy: matrix: @@ -71,33 +57,10 @@ jobs: PYTHON_VERSION: 2.7 TOXENV: integration ACME_SERVER: pebble + apache-compat: + IMAGE_NAME: ubuntu-18.04 + TOXENV: apache_compat pool: vmImage: $(IMAGE_NAME) steps: - - bash: | - brew install augeas - condition: startswith(variables['IMAGE_NAME'], 'macOS') - displayName: Install MacOS dependencies - - bash: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - python-dev \ - gcc \ - libaugeas0 \ - libssl-dev \ - libffi-dev \ - ca-certificates \ - nginx-light \ - openssl - condition: startswith(variables['IMAGE_NAME'], 'ubuntu') - displayName: Install Linux dependencies - - task: UsePythonVersion@0 - inputs: - versionSpec: $(PYTHON_VERSION) - addToPath: true - - script: | - python tools/pip_install.py -U tox coverage - displayName: Install dependencies - - script: | - python -m tox - displayName: Run tox + - template: tox-steps.yml diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml new file mode 100644 index 000000000..99c0880ae --- /dev/null +++ b/.azure-pipelines/templates/tox-steps.yml @@ -0,0 +1,31 @@ +steps: + - bash: | + brew install augeas + condition: startswith(variables['IMAGE_NAME'], 'macOS') + displayName: Install MacOS dependencies + - bash: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends \ + python-dev \ + gcc \ + libaugeas0 \ + libssl-dev \ + libffi-dev \ + ca-certificates \ + nginx-light \ + openssl \ + expect + condition: startswith(variables['IMAGE_NAME'], 'ubuntu') + displayName: Install Linux dependencies + - task: UsePythonVersion@0 + inputs: + versionSpec: $(PYTHON_VERSION) + addToPath: true + condition: ne(coalesce(variables['PYTHON_VERSION'], 'UNSPECIFIED'), 'UNSPECIFIED') + displayName: Activate selected Python version + - script: | + python tools/pip_install.py -U tox coverage + displayName: Install runtime dependencies + - script: | + unbuffered -p python -m tox + displayName: Run tox From 2bf373b92da74d5d60b63a78f18b04690603064f Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 14:00:20 +0200 Subject: [PATCH 041/172] Conditional execution --- .azure-pipelines/templates/tox-steps.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml index 99c0880ae..0a6d0d89c 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/tox-steps.yml @@ -23,9 +23,13 @@ steps: addToPath: true condition: ne(coalesce(variables['PYTHON_VERSION'], 'UNSPECIFIED'), 'UNSPECIFIED') displayName: Activate selected Python version - - script: | + - bash: | python tools/pip_install.py -U tox coverage displayName: Install runtime dependencies - - script: | - unbuffered -p python -m tox + - bash: | + if command -v unbuffer 2> /dev/null; then + unbuffer -p python -m tox + else + python -m tox + fi displayName: Run tox From 3d081d374821ea674920959d54e25aec11235ea2 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 14:11:50 +0200 Subject: [PATCH 042/172] Use pool.vmImage --- .azure-pipelines/templates/tox-steps.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml index 0a6d0d89c..ce8795a9f 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/tox-steps.yml @@ -1,7 +1,7 @@ steps: - bash: | brew install augeas - condition: startswith(variables['IMAGE_NAME'], 'macOS') + condition: startswith(pool.vmImage, 'macOS') displayName: Install MacOS dependencies - bash: | sudo apt-get update @@ -15,7 +15,7 @@ steps: nginx-light \ openssl \ expect - condition: startswith(variables['IMAGE_NAME'], 'ubuntu') + condition: startswith(pool.vmImage, 'ubuntu') displayName: Install Linux dependencies - task: UsePythonVersion@0 inputs: @@ -27,7 +27,7 @@ steps: python tools/pip_install.py -U tox coverage displayName: Install runtime dependencies - bash: | - if command -v unbuffer 2> /dev/null; then + if command -v unbuffer > /dev/null 2> &1; then unbuffer -p python -m tox else python -m tox From 70214267ad83804ccdccea9bd22f773c448948d4 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 14:15:44 +0200 Subject: [PATCH 043/172] Use Agent.OS --- .azure-pipelines/templates/tox-steps.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml index ce8795a9f..d069ad5cb 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/tox-steps.yml @@ -1,7 +1,7 @@ steps: - bash: | brew install augeas - condition: startswith(pool.vmImage, 'macOS') + condition: eq(Agent.OS, 'Darwin') displayName: Install MacOS dependencies - bash: | sudo apt-get update @@ -15,7 +15,7 @@ steps: nginx-light \ openssl \ expect - condition: startswith(pool.vmImage, 'ubuntu') + condition: eq(Agent.OS, 'Linux') displayName: Install Linux dependencies - task: UsePythonVersion@0 inputs: From b99ec94692c8107ecdfa0d0f41997ebbdd4dabc4 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 14:18:56 +0200 Subject: [PATCH 044/172] Always use IMAGE_NAME --- .azure-pipelines/templates/extended-tests-jobs.yml | 3 ++- .azure-pipelines/templates/tox-steps.yml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/templates/extended-tests-jobs.yml b/.azure-pipelines/templates/extended-tests-jobs.yml index a909b4a67..9d8e145a2 100644 --- a/.azure-pipelines/templates/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/extended-tests-jobs.yml @@ -1,6 +1,7 @@ jobs: - job: x_test variables: + IMAGE_NAME: ubuntu-18.04 ${{ if eq(variables['TOXENV'], 'integration') }}: PYTEST_ADDOPTS: --numprocesses 4 strategy: @@ -66,7 +67,7 @@ jobs: dev: TOXENV: docker_dev pool: - vmImage: ubuntu-18.04 + vmImage: $(IMAGE_NAME) steps: - template: tox-steps.yml - job: oldest_x_test diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml index d069ad5cb..cf81397b9 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/tox-steps.yml @@ -1,7 +1,7 @@ steps: - bash: | brew install augeas - condition: eq(Agent.OS, 'Darwin') + condition: startswith(variables['IMAGE_NAME'], 'macOS') displayName: Install MacOS dependencies - bash: | sudo apt-get update @@ -15,7 +15,7 @@ steps: nginx-light \ openssl \ expect - condition: eq(Agent.OS, 'Linux') + condition: startswith(variables['IMAGE_NAME'], 'ubuntu') displayName: Install Linux dependencies - task: UsePythonVersion@0 inputs: From 466d847502aec59c3144b051129a18226117b788 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 14:21:52 +0200 Subject: [PATCH 045/172] Fix format --- .azure-pipelines/templates/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml index cf81397b9..2e6904a40 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/tox-steps.yml @@ -27,7 +27,7 @@ steps: python tools/pip_install.py -U tox coverage displayName: Install runtime dependencies - bash: | - if command -v unbuffer > /dev/null 2> &1; then + if command -v unbuffer >/dev/null 2>&1; then unbuffer -p python -m tox else python -m tox From 6bc3a2ada49f42e9e7f2faf56f90ec26e4bfa125 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 14:37:42 +0200 Subject: [PATCH 046/172] Disable Travis --- .travis.yml | 322 +--------------------------------------------------- 1 file changed, 1 insertion(+), 321 deletions(-) diff --git a/.travis.yml b/.travis.yml index afd656edf..34cd9553b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,321 +1 @@ -language: python -dist: xenial - -cache: - directories: - - $HOME/.cache/pip - -before_script: - # On Travis, the fastest parallelization for integration tests has proved to be 4. - - 'if [[ "$TOXENV" == *"integration"* ]]; then export PYTEST_ADDOPTS="--numprocesses 4"; fi' - # Use Travis retry feature for farm tests since they are flaky - - 'if [[ "$TOXENV" == "travis-test-farm"* ]]; then export TRAVIS_RETRY=travis_retry; fi' - - export TOX_TESTENV_PASSENV=TRAVIS - - 'if [[ "$SNAP" == true ]]; then snap/local/build_and_install.sh; fi' - -# Only build pushes to the master branch, PRs, and branches beginning with -# `test-`, `travis-test-`, or of the form `digit(s).digit(s).x` or -# `vdigit(s).digit(s).digit(s)`. As documented at -# https://docs.travis-ci.com/user/customizing-the-build/#safelisting-or-blocklisting-branches, -# this includes tags so pushing tags of the form `vdigit(s).digit(s).digit(s)` -# will also trigger tests. This reduces the number of simultaneous Travis runs, -# which speeds turnaround time on review since there is a cap of on the number -# of simultaneous runs. -branches: - # When changing these branches, please ensure the documentation under - # "Running tests in CI" is still correct. - only: - - master - - /^\d+\.\d+\.x$/ # this matches our point release branches - - /^v\d+\.\d+\.\d+$/ # this matches our release tags - - /^(travis-)?test-.*$/ - -# Jobs for the main test suite are always executed (including on PRs) except for pushes on master. -not-on-master: ¬-on-master - if: NOT (type = push AND branch = master) - -# Jobs for the extended test suite are executed for cron jobs and pushes to -# non-development branches. -extended-test-suite: &extended-test-suite - if: type = cron OR (type = push AND branch != master) - -matrix: - include: - # Main test suite - - stage: "Test" - python: "2.7" - env: ACME_SERVER=pebble TOXENV=integration - <<: *not-on-master - - # As documented at - # https://docs.travis-ci.com/user/build-stages/#how-to-define-build-stages, - # the previous stage will be automatically applied to all subsequent jobs - # until a new stage is defined. - - # This job is always executed, including on master - - python: "3.8" - env: TOXENV=py38-cover FYI="py38 tests + code coverage" - - - python: "3.7" - env: TOXENV=lint - <<: *not-on-master - - python: "3.5" - env: TOXENV=mypy - <<: *not-on-master - - python: "2.7" - # Ubuntu Trusty or older must be used because the oldest version of - # cryptography we support cannot be compiled against the version of - # OpenSSL in Xenial or newer. - dist: trusty - env: TOXENV='py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest' - <<: *not-on-master - - python: "2.7" - env: TOXENV=py27 - <<: *not-on-master - - python: "3.5" - env: TOXENV=py35 - <<: *not-on-master - - sudo: required - env: TOXENV=apache_compat - services: docker - addons: - <<: *not-on-master - - sudo: required - env: TOXENV=le_auto_xenial - services: docker - <<: *not-on-master - - python: "2.7" - env: TOXENV=apacheconftest-with-pebble - <<: *not-on-master - - python: "2.7" - env: TOXENV=nginxroundtrip - <<: *not-on-master - - # Extended test suite on cron jobs and pushes to tested branches other than master - - sudo: required - env: TOXENV=nginx_compat - services: docker - addons: - <<: *extended-test-suite - - python: "3.7" - env: - - TOXENV=travis-test-farm-apache2 - - secure: "f+j/Lj9s1lcuKo5sEFrlRd1kIAMnIJI4z0MTI7QF8jl9Fkmbx7KECGzw31TNgzrOSzxSapHbcueFYvNCLKST+kE/8ogMZBbwqXfEDuKpyF6BY3uYoJn+wPVE5pIb8Hhe08xPte8TTDSMIyHI3EyTfcAKrIreauoArePvh/cRvSw=" - <<: *extended-test-suite - - python: "3.7" - env: - - TOXENV=travis-test-farm-leauto-upgrades - - secure: "f+j/Lj9s1lcuKo5sEFrlRd1kIAMnIJI4z0MTI7QF8jl9Fkmbx7KECGzw31TNgzrOSzxSapHbcueFYvNCLKST+kE/8ogMZBbwqXfEDuKpyF6BY3uYoJn+wPVE5pIb8Hhe08xPte8TTDSMIyHI3EyTfcAKrIreauoArePvh/cRvSw=" - git: - depth: false # This is needed to have the history to checkout old versions of certbot-auto. - <<: *extended-test-suite - - python: "3.7" - env: - - TOXENV=travis-test-farm-certonly-standalone - - secure: "f+j/Lj9s1lcuKo5sEFrlRd1kIAMnIJI4z0MTI7QF8jl9Fkmbx7KECGzw31TNgzrOSzxSapHbcueFYvNCLKST+kE/8ogMZBbwqXfEDuKpyF6BY3uYoJn+wPVE5pIb8Hhe08xPte8TTDSMIyHI3EyTfcAKrIreauoArePvh/cRvSw=" - <<: *extended-test-suite - - python: "3.7" - env: - - TOXENV=travis-test-farm-sdists - - secure: "f+j/Lj9s1lcuKo5sEFrlRd1kIAMnIJI4z0MTI7QF8jl9Fkmbx7KECGzw31TNgzrOSzxSapHbcueFYvNCLKST+kE/8ogMZBbwqXfEDuKpyF6BY3uYoJn+wPVE5pIb8Hhe08xPte8TTDSMIyHI3EyTfcAKrIreauoArePvh/cRvSw=" - <<: *extended-test-suite - - python: "3.7" - env: TOXENV=py37 CERTBOT_NO_PIN=1 - <<: *extended-test-suite - - python: "2.7" - env: ACME_SERVER=boulder-v1 TOXENV=integration - sudo: required - services: docker - <<: *extended-test-suite - - python: "2.7" - env: ACME_SERVER=boulder-v2 TOXENV=integration - sudo: required - services: docker - <<: *extended-test-suite - - python: "2.7" - env: ACME_SERVER=boulder-v1 TOXENV=integration-certbot-oldest - # Ubuntu Trusty or older must be used because the oldest version of - # cryptography we support cannot be compiled against the version of - # OpenSSL in Xenial or newer. - dist: trusty - sudo: required - services: docker - <<: *extended-test-suite - - python: "2.7" - env: ACME_SERVER=boulder-v2 TOXENV=integration-certbot-oldest - # Ubuntu Trusty or older must be used because the oldest version of - # cryptography we support cannot be compiled against the version of - # OpenSSL in Xenial or newer. - dist: trusty - sudo: required - services: docker - <<: *extended-test-suite - - python: "2.7" - env: ACME_SERVER=boulder-v1 TOXENV=integration-nginx-oldest - # Ubuntu Trusty or older must be used because the oldest version of - # cryptography we support cannot be compiled against the version of - # OpenSSL in Xenial or newer. - dist: trusty - sudo: required - services: docker - <<: *extended-test-suite - - python: "2.7" - env: ACME_SERVER=boulder-v2 TOXENV=integration-nginx-oldest - # Ubuntu Trusty or older must be used because the oldest version of - # cryptography we support cannot be compiled against the version of - # OpenSSL in Xenial or newer. - dist: trusty - sudo: required - services: docker - <<: *extended-test-suite - - python: "3.6" - env: TOXENV=py36 - <<: *extended-test-suite - - python: "3.7" - env: TOXENV=py37 - <<: *extended-test-suite - - python: "3.5" - env: ACME_SERVER=boulder-v1 TOXENV=integration - sudo: required - services: docker - <<: *extended-test-suite - - python: "3.5" - env: ACME_SERVER=boulder-v2 TOXENV=integration - sudo: required - services: docker - <<: *extended-test-suite - - python: "3.6" - env: ACME_SERVER=boulder-v1 TOXENV=integration - sudo: required - services: docker - <<: *extended-test-suite - - python: "3.6" - env: ACME_SERVER=boulder-v2 TOXENV=integration - sudo: required - services: docker - <<: *extended-test-suite - - python: "3.7" - env: ACME_SERVER=boulder-v1 TOXENV=integration - sudo: required - services: docker - <<: *extended-test-suite - - python: "3.7" - env: ACME_SERVER=boulder-v2 TOXENV=integration - sudo: required - services: docker - <<: *extended-test-suite - - python: "3.8" - env: ACME_SERVER=boulder-v1 TOXENV=integration - <<: *extended-test-suite - - python: "3.8" - env: ACME_SERVER=boulder-v2 TOXENV=integration - <<: *extended-test-suite - - sudo: required - env: TOXENV=le_auto_jessie - services: docker - <<: *extended-test-suite - - sudo: required - env: TOXENV=le_auto_centos6 - services: docker - <<: *extended-test-suite - - sudo: required - env: TOXENV=le_auto_oraclelinux6 - services: docker - <<: *extended-test-suite - - sudo: required - env: TOXENV=docker_dev - services: docker - addons: - apt: - packages: # don't install nginx and apache - - libaugeas0 - <<: *extended-test-suite - - stage: "Snap" - sudo: required - env: SNAP=true TOXENV=integration-external,apacheconftest-external-with-pebble - addons: - apt: - packages: - - nginx-light - snaps: - - name: snapcraft - channel: stable - confinement: classic - - name: lxd - channel: stable - git: - # By default, Travis clones the repo to a depth of 50 commits which can - # break the ability to use `git describe` to set the version of the - # snap. This setting removes the --depth flag from git commands solving - # this problem. See - # https://docs.travis-ci.com/user/customizing-the-build#git-clone-depth - # for more info. - depth: false - deploy: - # This section relies on credentials stored in a SNAP_TOKEN environment - # variable in Travis. See - # https://docs.travis-ci.com/user/deployment/snaps/ for more info. - # This credential has a maximum lifetime of 1 year and the current - # credential will expire on 4/22/2021. The value of SNAP_TOKEN will - # need to be updated to use a new credential before then to prevent - # automated deploys from breaking. Remembering to do this is also - # tracked by https://github.com/certbot/certbot/issues/7931. - 'on': - # Deploy on release tags or nightly runs from any branch. We only try - # to deploy from the certbot/certbot repo to prevent errors if forks - # of this repo try to run tests. - all_branches: true - condition: -n $TRAVIS_TAG || $TRAVIS_EVENT_TYPE = cron - repo: certbot/certbot - provider: snap - snap: certbot_*.snap - channel: edge - # skip_cleanup is needed to prevent Travis from deleting the snaps we - # just built and tested. See - # https://docs.travis-ci.com/user/deployment#uploading-files-and-skip_cleanup. - skip_cleanup: true - <<: *extended-test-suite - -# container-based infrastructure -sudo: false - -addons: - apt: - packages: # Keep in sync with letsencrypt-auto-source/pieces/bootstrappers/deb_common.sh and Boulder. - - python-dev - - gcc - - libaugeas0 - - libssl-dev - - libffi-dev - - ca-certificates - # For certbot-nginx integration testing - - nginx-light - - openssl - -# tools/pip_install.py is used to pin packages to a known working version -# except in tests where the environment variable CERTBOT_NO_PIN is set. -# virtualenv is listed here explicitly to make sure it is upgraded when -# CERTBOT_NO_PIN is set to work around failures we've seen when using an older -# version of virtualenv. The option "-I" is set so when CERTBOT_NO_PIN is also -# set, pip updates dependencies it thinks are already satisfied to avoid some -# problems with its lack of real dependency resolution. -install: 'tools/pip_install.py -I tox virtualenv' -# Most of the time TRAVIS_RETRY is an empty string, and has no effect on the -# script command. It is set only to `travis_retry` during farm tests, in -# order to trigger the Travis retry feature, and compensate the inherent -# flakiness of these specific tests. -script: '$TRAVIS_RETRY tox' - -notifications: - email: false - irc: - if: NOT branch =~ ^(travis-)?test-.*$ - channels: - # This is set to a secure variable to prevent forks from sending - # notifications. This value was created by installing - # https://github.com/travis-ci/travis.rb and running - # `travis encrypt "chat.freenode.net#certbot-devel"`. - - secure: "EWW66E2+KVPZyIPR8ViENZwfcup4Gx3/dlimmAZE0WuLwxDCshBBOd3O8Rf6pBokEoZlXM5eDT6XdyJj8n0DLslgjO62pExdunXpbcMwdY7l1ELxX2/UbnDTE6UnPYa09qVBHNG7156Z6yE0x2lH4M9Ykvp0G0cubjPQHylAwo0=" - on_cancel: never - on_success: never - on_failure: always +script: None From f3ace291daf9c201c5217123da4388f668e8d6ca Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 14:41:31 +0200 Subject: [PATCH 047/172] Reduce verbosity --- tools/run_oldest_tests.sh | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/tools/run_oldest_tests.sh b/tools/run_oldest_tests.sh index e4f200720..259df3a4b 100755 --- a/tools/run_oldest_tests.sh +++ b/tools/run_oldest_tests.sh @@ -20,18 +20,8 @@ cat << "EOF" >> "${SCRIPT}" 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 \ - software-properties-common + python-dev python-pip git gcc libaugeas0 libssl-dev libffi-dev \ + ca-certificates nginx-light openssl curl software-properties-common apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BB92C09DB82666C add-apt-repository ppa:fkrull/deadsnakes-python2.7 apt-get update @@ -42,15 +32,9 @@ python -m pip install tox python -m tox EOF -docker run \ - --rm \ +docker run --rm --network=host -w "${PWD}" \ -v /var/run/docker.sock:/var/run/docker.sock \ -v "${PWD}:${PWD}" -v "${SCRIPT}:/script.sh" \ -v /tmp:/tmp \ - -e TOXENV \ - -e ACME_SERVER \ - -e PYTEST_ADDOPTS \ - -w "${PWD}" \ - --network=host \ - ubuntu:14.04 \ - /script.sh + -e TOXENV -e ACME_SERVER -e PYTEST_ADDOPTS \ + ubuntu:14.04 /script.sh From b32f64905063560471197a9dfc2acd22c9ac1734 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 14:48:20 +0200 Subject: [PATCH 048/172] Reduce verbosity --- .../templates/extended-tests-jobs.yml | 37 +++++++------------ .../templates/standard-tests-jobs.yml | 16 +++----- .azure-pipelines/templates/tox-steps.yml | 4 +- 3 files changed, 22 insertions(+), 35 deletions(-) diff --git a/.azure-pipelines/templates/extended-tests-jobs.yml b/.azure-pipelines/templates/extended-tests-jobs.yml index 9d8e145a2..ad521b202 100644 --- a/.azure-pipelines/templates/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/extended-tests-jobs.yml @@ -2,7 +2,7 @@ jobs: - job: x_test variables: IMAGE_NAME: ubuntu-18.04 - ${{ if eq(variables['TOXENV'], 'integration') }}: + ${{ if contains(variables['TOXENV'], 'integration') }}: PYTEST_ADDOPTS: --numprocesses 4 strategy: matrix: @@ -16,6 +16,18 @@ jobs: PYTHON_VERSION: 3.7 TOXENV: py37 CERTBOT_NO_PIN: 1 + linux-boulder-v1-integration-certbot: + TOXENV: integration-certbot-oldest + ACME_SERVER: boulder-v1 + linux-boulder-v2-integration-certbot: + TOXENV: integration-certbot-oldest + ACME_SERVER: boulder-v2 + linux-boulder-v1-integration-nginx: + TOXENV: integration-nginx-oldest + ACME_SERVER: boulder-v1 + linux-boulder-v2-integration-nginx: + TOXENV: integration-nginx-oldest + ACME_SERVER: boulder-v2 linux-boulder-v1-py27-integration: PYTHON_VERSION: 2.7 TOXENV: integration @@ -70,26 +82,3 @@ jobs: vmImage: $(IMAGE_NAME) steps: - template: tox-steps.yml - - job: oldest_x_test - variables: - PYTEST_ADDOPTS: --numprocesses 4 - strategy: - matrix: - linux-boulder-v1-integration-certbot: - TOXENV: integration-certbot-oldest - ACME_SERVER: boulder-v1 - linux-boulder-v2-integration-certbot: - TOXENV: integration-certbot-oldest - ACME_SERVER: boulder-v2 - linux-boulder-v1-integration-nginx: - TOXENV: integration-nginx-oldest - ACME_SERVER: boulder-v1 - linux-boulder-v2-integration-nginx: - TOXENV: integration-nginx-oldest - ACME_SERVER: boulder-v2 - pool: - vmImage: ubuntu-18.04 - steps: - - script: | - tools/run_oldest_tests.sh - displayName: Run oldest tests diff --git a/.azure-pipelines/templates/standard-tests-jobs.yml b/.azure-pipelines/templates/standard-tests-jobs.yml index 43597ec6e..c0db324df 100644 --- a/.azure-pipelines/templates/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/standard-tests-jobs.yml @@ -1,14 +1,8 @@ jobs: - - job: oldest_test - pool: - vmImage: ubuntu-latest - variables: - TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest - steps: - - script: | - tools/run_oldest_tests.sh - displayName: Run oldest tests - job: test + variables: + ${{ if contains(variables['TOXENV'], 'integration') }}: + PYTEST_ADDOPTS: --numprocesses 4 strategy: matrix: macos-py27: @@ -31,7 +25,9 @@ jobs: IMAGE_NAME: vs2017-win2016 PYTHON_VERSION: 3.7 TOXENV: integration-certbot - PYTEST_ADDOPTS: --numprocesses 4 + linux-oldest-tests: + IMAGE_NAME: ubuntu-18.04 + TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest linux-py27: IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 2.7 diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml index 2e6904a40..5d8fce877 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/tox-steps.yml @@ -27,7 +27,9 @@ steps: python tools/pip_install.py -U tox coverage displayName: Install runtime dependencies - bash: | - if command -v unbuffer >/dev/null 2>&1; then + if [[ "${TOXENV}" == *"oldest"* ]]; then + tools/run_oldest_tests.sh + elif command -v unbuffer >/dev/null 2>&1; then unbuffer -p python -m tox else python -m tox From d9ad84e68fbf9c26339eb07fbd0b71ed89e8a4f2 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 15:05:28 +0200 Subject: [PATCH 049/172] Simple move --- .azure-pipelines/templates/packaging-jobs.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.azure-pipelines/templates/packaging-jobs.yml b/.azure-pipelines/templates/packaging-jobs.yml index e53837f7a..9f389ee0d 100644 --- a/.azure-pipelines/templates/packaging-jobs.yml +++ b/.azure-pipelines/templates/packaging-jobs.yml @@ -8,13 +8,10 @@ jobs: versionSpec: 3.7 architecture: x86 addToPath: true - - script: python windows-installer/construct.py + - bash: | + python windows-installer/construct.py + mv windows-installer/build/nsis/*.exe $(Build.ArtifactStagingDirectory) displayName: Build Certbot installer - - task: CopyFiles@2 - inputs: - sourceFolder: $(System.DefaultWorkingDirectory)/windows-installer/build/nsis - contents: '*.exe' - targetFolder: $(Build.ArtifactStagingDirectory) - task: PublishPipelineArtifact@1 inputs: path: $(Build.ArtifactStagingDirectory) @@ -32,8 +29,7 @@ jobs: vmImage: $(imageName) steps: - powershell: | - $currentVersion = $PSVersionTable.PSVersion - if ($currentVersion.Major -ne 5) { + if ($PSVersionTable.PSVersion.Major -ne 5) { throw "Powershell version is not 5.x" } condition: eq(variables['imageName'], 'vs2017-win2016') From dc31bb2a19b017ec00d639b9a61c2d7a75604dc1 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 15:07:13 +0200 Subject: [PATCH 050/172] Hello World for Travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 34cd9553b..132283cbf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1 @@ -script: None +script: echo Hello World! From 997a55ed3fae874dcee66cc7b80537f4965252dd Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 16:02:00 +0200 Subject: [PATCH 051/172] Prepare notifications --- .azure-pipelines/main.yml | 9 +++++++-- .azure-pipelines/templates/notifications-jobs.yml | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .azure-pipelines/templates/notifications-jobs.yml diff --git a/.azure-pipelines/main.yml b/.azure-pipelines/main.yml index 723b35d56..4b62ef209 100644 --- a/.azure-pipelines/main.yml +++ b/.azure-pipelines/main.yml @@ -4,5 +4,10 @@ pr: - master - '*.x' -jobs: - - template: templates/standard-tests-jobs.yml +stages: + - stage: Test + jobs: + - template: templates/standard-tests-jobs.yml + - stage: Notify + jobs: + - template: templates/notifications-jobs.yml diff --git a/.azure-pipelines/templates/notifications-jobs.yml b/.azure-pipelines/templates/notifications-jobs.yml new file mode 100644 index 000000000..e1ddc06d8 --- /dev/null +++ b/.azure-pipelines/templates/notifications-jobs.yml @@ -0,0 +1,8 @@ +jobs: + - job: notify_failure + pool: + vmImage: ubuntu-latest + steps: + - bash: | + curl -i -H "Authorization: Bearer ${MATTERMOST_TOKEN}" --data "{\"channel_id\":\"${MATTERMOST_CHANNEL_ID}\",\"message\":\"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=$(Build.BuildId)&view=results\"}" -X POST "${MATTERMOST_URL}/api/v4/posts" + condition: failed() From 6260a30eb35ff3ffd71e62f444fae43cf204db57 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 16:07:10 +0200 Subject: [PATCH 052/172] Configure notification --- .azure-pipelines/templates/notifications-jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/notifications-jobs.yml b/.azure-pipelines/templates/notifications-jobs.yml index e1ddc06d8..b2b8ac9b4 100644 --- a/.azure-pipelines/templates/notifications-jobs.yml +++ b/.azure-pipelines/templates/notifications-jobs.yml @@ -4,5 +4,5 @@ jobs: vmImage: ubuntu-latest steps: - bash: | - curl -i -H "Authorization: Bearer ${MATTERMOST_TOKEN}" --data "{\"channel_id\":\"${MATTERMOST_CHANNEL_ID}\",\"message\":\"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=$(Build.BuildId)&view=results\"}" -X POST "${MATTERMOST_URL}/api/v4/posts" + curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" condition: failed() From d983b7fd9f2a2c507d7fbe334a334c4935cbb184 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 16:10:01 +0200 Subject: [PATCH 053/172] Test failure --- .../templates/standard-tests-jobs.yml | 94 +++++++++---------- .azure-pipelines/templates/tox-steps.yml | 1 + 2 files changed, 48 insertions(+), 47 deletions(-) diff --git a/.azure-pipelines/templates/standard-tests-jobs.yml b/.azure-pipelines/templates/standard-tests-jobs.yml index c0db324df..d9fd97a7c 100644 --- a/.azure-pipelines/templates/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/standard-tests-jobs.yml @@ -9,53 +9,53 @@ jobs: IMAGE_NAME: macOS-10.14 PYTHON_VERSION: 2.7 TOXENV: py27 - macos-py38: - IMAGE_NAME: macOS-10.14 - PYTHON_VERSION: 3.8 - TOXENV: py38 - windows-py35: - IMAGE_NAME: vs2017-win2016 - PYTHON_VERSION: 3.5 - TOXENV: py35 - windows-py37-cover: - IMAGE_NAME: vs2017-win2016 - PYTHON_VERSION: 3.7 - TOXENV: py37-cover - windows-integration-certbot: - IMAGE_NAME: vs2017-win2016 - PYTHON_VERSION: 3.7 - TOXENV: integration-certbot - linux-oldest-tests: - IMAGE_NAME: ubuntu-18.04 - TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest - linux-py27: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 2.7 - TOXENV: py27 - linux-py35: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 3.5 - TOXENV: py35 - linux-py38-cover: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 3.8 - TOXENV: py27-cover - linux-py37-lint: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 3.7 - TOXENV: lint - linux-py35-mypy: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 3.5 - TOXENV: mypy - linux-integration: - IMAGE_NAME: ubuntu-18.04 - PYTHON_VERSION: 2.7 - TOXENV: integration - ACME_SERVER: pebble - apache-compat: - IMAGE_NAME: ubuntu-18.04 - TOXENV: apache_compat +# macos-py38: +# IMAGE_NAME: macOS-10.14 +# PYTHON_VERSION: 3.8 +# TOXENV: py38 +# windows-py35: +# IMAGE_NAME: vs2017-win2016 +# PYTHON_VERSION: 3.5 +# TOXENV: py35 +# windows-py37-cover: +# IMAGE_NAME: vs2017-win2016 +# PYTHON_VERSION: 3.7 +# TOXENV: py37-cover +# windows-integration-certbot: +# IMAGE_NAME: vs2017-win2016 +# PYTHON_VERSION: 3.7 +# TOXENV: integration-certbot +# linux-oldest-tests: +# IMAGE_NAME: ubuntu-18.04 +# TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest +# linux-py27: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 2.7 +# TOXENV: py27 +# linux-py35: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 3.5 +# TOXENV: py35 +# linux-py38-cover: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 3.8 +# TOXENV: py27-cover +# linux-py37-lint: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 3.7 +# TOXENV: lint +# linux-py35-mypy: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 3.5 +# TOXENV: mypy +# linux-integration: +# IMAGE_NAME: ubuntu-18.04 +# PYTHON_VERSION: 2.7 +# TOXENV: integration +# ACME_SERVER: pebble +# apache-compat: +# IMAGE_NAME: ubuntu-18.04 +# TOXENV: apache_compat pool: vmImage: $(IMAGE_NAME) steps: diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml index 5d8fce877..bc39cdf80 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/tox-steps.yml @@ -27,6 +27,7 @@ steps: python tools/pip_install.py -U tox coverage displayName: Install runtime dependencies - bash: | + exit 1 if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh elif command -v unbuffer >/dev/null 2>&1; then From 9a58c76a99c2f5e5e002007cbd312774781501ff Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 16:13:21 +0200 Subject: [PATCH 054/172] Configure stage --- .azure-pipelines/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/main.yml b/.azure-pipelines/main.yml index 4b62ef209..1c3ee7004 100644 --- a/.azure-pipelines/main.yml +++ b/.azure-pipelines/main.yml @@ -11,3 +11,4 @@ stages: - stage: Notify jobs: - template: templates/notifications-jobs.yml + condition: succeededOrFailed() From ee98bfca882f161481904a60c7979c0d13021afe Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 16:16:50 +0200 Subject: [PATCH 055/172] Test without condition --- .azure-pipelines/templates/notifications-jobs.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure-pipelines/templates/notifications-jobs.yml b/.azure-pipelines/templates/notifications-jobs.yml index b2b8ac9b4..cd10a5396 100644 --- a/.azure-pipelines/templates/notifications-jobs.yml +++ b/.azure-pipelines/templates/notifications-jobs.yml @@ -5,4 +5,3 @@ jobs: steps: - bash: | curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" - condition: failed() From e8d05f6f6db7b40f8f1109ab813241b3e3094421 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 16:32:24 +0200 Subject: [PATCH 056/172] Use env --- .azure-pipelines/templates/notifications-jobs.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/notifications-jobs.yml b/.azure-pipelines/templates/notifications-jobs.yml index cd10a5396..91c4398c4 100644 --- a/.azure-pipelines/templates/notifications-jobs.yml +++ b/.azure-pipelines/templates/notifications-jobs.yml @@ -4,4 +4,7 @@ jobs: vmImage: ubuntu-latest steps: - bash: | - curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" + curl -i -H "Authorization: Bearer ${MATTERMOST_TOKEN}" --data "{\"channel_id\":\"${MATTERMOST_CHANNEL_ID}\",\"message\":\"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=${BUILD_ID}&view=results\"}" -X POST "${MATTERMOST_URL}/api/v4/posts" + env: + MATTERMOST_TOKEN: $(MATTERMOST_TOKEN) + BUILD_ID: $(Build.BuildId) \ No newline at end of file From e877c9cd424221823672909ff04a0385ab334d1f Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 16:38:09 +0200 Subject: [PATCH 057/172] Now use it --- .azure-pipelines/templates/notifications-jobs.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.azure-pipelines/templates/notifications-jobs.yml b/.azure-pipelines/templates/notifications-jobs.yml index 91c4398c4..cd10a5396 100644 --- a/.azure-pipelines/templates/notifications-jobs.yml +++ b/.azure-pipelines/templates/notifications-jobs.yml @@ -4,7 +4,4 @@ jobs: vmImage: ubuntu-latest steps: - bash: | - curl -i -H "Authorization: Bearer ${MATTERMOST_TOKEN}" --data "{\"channel_id\":\"${MATTERMOST_CHANNEL_ID}\",\"message\":\"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=${BUILD_ID}&view=results\"}" -X POST "${MATTERMOST_URL}/api/v4/posts" - env: - MATTERMOST_TOKEN: $(MATTERMOST_TOKEN) - BUILD_ID: $(Build.BuildId) \ No newline at end of file + curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" From b553a7eccce4f3bd483f96cca8ec65c67d4b4c36 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 16:50:22 +0200 Subject: [PATCH 058/172] Get env --- .azure-pipelines/templates/notifications-jobs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/templates/notifications-jobs.yml b/.azure-pipelines/templates/notifications-jobs.yml index cd10a5396..7d81c7df3 100644 --- a/.azure-pipelines/templates/notifications-jobs.yml +++ b/.azure-pipelines/templates/notifications-jobs.yml @@ -4,4 +4,5 @@ jobs: vmImage: ubuntu-latest steps: - bash: | + env curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" From 77e7f8575d0eb2585e6041ea8b5a8e91f24f646d Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 16:59:58 +0200 Subject: [PATCH 059/172] Pull together --- .azure-pipelines/main.yml | 5 +---- .azure-pipelines/templates/notifications-jobs.yml | 8 -------- .azure-pipelines/templates/notify-failure-steps.yml | 10 ++++++++++ 3 files changed, 11 insertions(+), 12 deletions(-) delete mode 100644 .azure-pipelines/templates/notifications-jobs.yml create mode 100644 .azure-pipelines/templates/notify-failure-steps.yml diff --git a/.azure-pipelines/main.yml b/.azure-pipelines/main.yml index 1c3ee7004..24d05c954 100644 --- a/.azure-pipelines/main.yml +++ b/.azure-pipelines/main.yml @@ -8,7 +8,4 @@ stages: - stage: Test jobs: - template: templates/standard-tests-jobs.yml - - stage: Notify - jobs: - - template: templates/notifications-jobs.yml - condition: succeededOrFailed() + - template: templates/notify-failure-steps.yml diff --git a/.azure-pipelines/templates/notifications-jobs.yml b/.azure-pipelines/templates/notifications-jobs.yml deleted file mode 100644 index 7d81c7df3..000000000 --- a/.azure-pipelines/templates/notifications-jobs.yml +++ /dev/null @@ -1,8 +0,0 @@ -jobs: - - job: notify_failure - pool: - vmImage: ubuntu-latest - steps: - - bash: | - env - curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/adferrand/certbot/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" diff --git a/.azure-pipelines/templates/notify-failure-steps.yml b/.azure-pipelines/templates/notify-failure-steps.yml new file mode 100644 index 000000000..4e6c06330 --- /dev/null +++ b/.azure-pipelines/templates/notify-failure-steps.yml @@ -0,0 +1,10 @@ +stages: + - stage: Notify_Failure + jobs: + - job: notify + pool: + vmImage: ubuntu-latest + steps: + - bash: | + curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/$(Build.RepositoryId)/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" + condition: failed() From 75f8dddf8814ae0004b9b2d86036ae9a1f2787e6 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 17:22:03 +0200 Subject: [PATCH 060/172] Fix variable --- .azure-pipelines/templates/notify-failure-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/notify-failure-steps.yml b/.azure-pipelines/templates/notify-failure-steps.yml index 4e6c06330..dbb6ed1df 100644 --- a/.azure-pipelines/templates/notify-failure-steps.yml +++ b/.azure-pipelines/templates/notify-failure-steps.yml @@ -6,5 +6,5 @@ stages: vmImage: ubuntu-latest steps: - bash: | - curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/$(Build.RepositoryId)/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" + curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" condition: failed() From 02e630d5a99a7fef9101e417138b494b0fc94d7f Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 18:42:56 +0200 Subject: [PATCH 061/172] Farm tests on Azure configuration --- .../templates/extended-tests-jobs.yml | 12 ++++ .azure-pipelines/templates/tox-steps.yml | 5 +- certbot/docs/contributing.rst | 2 +- tests/letstest/azure-setup.sh | 10 +++ ...t-farm.pem.enc => azure-test-farm.pem.enc} | Bin tests/letstest/travis-setup.sh | 10 --- tox.ini | 66 +++++++++--------- 7 files changed, 61 insertions(+), 44 deletions(-) create mode 100644 tests/letstest/azure-setup.sh rename tests/letstest/{travis-test-farm.pem.enc => azure-test-farm.pem.enc} (100%) delete mode 100755 tests/letstest/travis-setup.sh diff --git a/.azure-pipelines/templates/extended-tests-jobs.yml b/.azure-pipelines/templates/extended-tests-jobs.yml index ad521b202..c9229ece5 100644 --- a/.azure-pipelines/templates/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/extended-tests-jobs.yml @@ -78,6 +78,18 @@ 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: diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml index bc39cdf80..66b79513a 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/tox-steps.yml @@ -27,7 +27,10 @@ steps: python tools/pip_install.py -U tox coverage displayName: Install runtime dependencies - bash: | - exit 1 + if [[ "${TOXENV}" == *"test-farm"* ]]; then + # To be removed once farm tests are configured on Azure + exit 0 + fi if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh elif command -v unbuffer >/dev/null 2>&1; then diff --git a/certbot/docs/contributing.rst b/certbot/docs/contributing.rst index 73e681150..50297152e 100644 --- a/certbot/docs/contributing.rst +++ b/certbot/docs/contributing.rst @@ -206,7 +206,7 @@ Certbot uses both Azure Pipelines and Travis to run continuous integration tests. If you are using our Azure and Travis setup, a branch whose name starts with `test-` will run all Azure and Travis tests on that branch. If the branch name starts with `azure-test-`, it will run all of our Azure tests and none of -our Travis tests. If the branch stats with `travis-test-`, only our Travis +our Travis tests. If the branch starts with `travis-test-`, only our Travis tests will be run. Code components and layout diff --git a/tests/letstest/azure-setup.sh b/tests/letstest/azure-setup.sh new file mode 100644 index 000000000..9817ce853 --- /dev/null +++ b/tests/letstest/azure-setup.sh @@ -0,0 +1,10 @@ +#!/bin/bash -ex +# +# Preps the test farm tests to be run in Travis. + +if [ "$BUILD_REASON" = "PullRequest" ]; then + echo This script must be run in Azure on a non-pull request build + exit 1 +fi + +openssl aes-256-cbc -K "${FARMTEST_SECURE_KEY}" -iv "${FARMTEST_SECURE_IV}" -in azure-test-farm.pem.enc -out azure-test-farm.pem -d diff --git a/tests/letstest/travis-test-farm.pem.enc b/tests/letstest/azure-test-farm.pem.enc similarity index 100% rename from tests/letstest/travis-test-farm.pem.enc rename to tests/letstest/azure-test-farm.pem.enc diff --git a/tests/letstest/travis-setup.sh b/tests/letstest/travis-setup.sh deleted file mode 100755 index 261a1504f..000000000 --- a/tests/letstest/travis-setup.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -ex -# -# Preps the test farm tests to be run in Travis. - -if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - echo This script must be run in Travis on a non-pull request build - exit 1 -fi - -openssl aes-256-cbc -K "${encrypted_9a387195a62e_key}" -iv "${encrypted_9a387195a62e_iv}" -in travis-test-farm.pem.enc -out travis-test-farm.pem -d diff --git a/tox.ini b/tox.ini index 46e73e32f..54aa0169c 100644 --- a/tox.ini +++ b/tox.ini @@ -283,49 +283,51 @@ commands = passenv = DOCKER_* setenv = {[testenv:py27-oldest]setenv} -[testenv:travis-test-farm-tests-base] +[testenv:azure-test-farm-tests-base] changedir = tests/letstest commands = - ./travis-setup.sh + ./azure-setup.sh deps = -rtests/letstest/requirements.txt passenv = AWS_* - TRAVIS_* - encrypted_* + SYSTEM_DEFAULTWORKINGDIRECTORY + BUILD_SOURCEBRANCHNAME + FARMTEST_SECURE_KEY + FARMTEST_SECURE_IV setenv = AWS_DEFAULT_REGION=us-east-1 -[testenv:travis-test-farm-apache2] -changedir = {[testenv:travis-test-farm-tests-base]changedir} +[testenv:azure-test-farm-apache2] +changedir = {[testenv:azure-test-farm-tests-base]changedir} commands = - {[testenv:travis-test-farm-tests-base]commands} - python multitester.py apache2_targets.yaml travis-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --repo {env:TRAVIS_BUILD_DIR} --branch {env:TRAVIS_BRANCH} -deps = {[testenv:travis-test-farm-tests-base]deps} -passenv = {[testenv:travis-test-farm-tests-base]passenv} -setenv = {[testenv:travis-test-farm-tests-base]setenv} + {[testenv:azure-test-farm-tests-base]commands} + python multitester.py apache2_targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +deps = {[testenv:azure-test-farm-tests-base]deps} +passenv = {[testenv:azure-test-farm-tests-base]passenv} +setenv = {[testenv:azure-test-farm-tests-base]setenv} -[testenv:travis-test-farm-leauto-upgrades] -changedir = {[testenv:travis-test-farm-tests-base]changedir} +[testenv:azure-test-farm-leauto-upgrades] +changedir = {[testenv:azure-test-farm-tests-base]changedir} commands = - {[testenv:travis-test-farm-tests-base]commands} - python multitester.py targets.yaml travis-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {env:TRAVIS_BUILD_DIR} --branch {env:TRAVIS_BRANCH} -deps = {[testenv:travis-test-farm-tests-base]deps} -passenv = {[testenv:travis-test-farm-tests-base]passenv} -setenv = {[testenv:travis-test-farm-tests-base]setenv} + {[testenv:azure-test-farm-tests-base]commands} + python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +deps = {[testenv:azure-test-farm-tests-base]deps} +passenv = {[testenv:azure-test-farm-tests-base]passenv} +setenv = {[testenv:azure-test-farm-tests-base]setenv} -[testenv:travis-test-farm-certonly-standalone] -changedir = {[testenv:travis-test-farm-tests-base]changedir} +[testenv:azure-test-farm-certonly-standalone] +changedir = {[testenv:azure-test-farm-tests-base]changedir} commands = - {[testenv:travis-test-farm-tests-base]commands} - python multitester.py targets.yaml travis-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {env:TRAVIS_BUILD_DIR} --branch {env:TRAVIS_BRANCH} -deps = {[testenv:travis-test-farm-tests-base]deps} -passenv = {[testenv:travis-test-farm-tests-base]passenv} -setenv = {[testenv:travis-test-farm-tests-base]setenv} + {[testenv:azure-test-farm-tests-base]commands} + python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +deps = {[testenv:azure-test-farm-tests-base]deps} +passenv = {[testenv:azure-test-farm-tests-base]passenv} +setenv = {[testenv:azure-test-farm-tests-base]setenv} -[testenv:travis-test-farm-sdists] -changedir = {[testenv:travis-test-farm-tests-base]changedir} +[testenv:azure-test-farm-sdists] +changedir = {[testenv:azure-test-farm-tests-base]changedir} commands = - {[testenv:travis-test-farm-tests-base]commands} - python multitester.py targets.yaml travis-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --repo {env:TRAVIS_BUILD_DIR} --branch {env:TRAVIS_BRANCH} -deps = {[testenv:travis-test-farm-tests-base]deps} -passenv = {[testenv:travis-test-farm-tests-base]passenv} -setenv = {[testenv:travis-test-farm-tests-base]setenv} + {[testenv:azure-test-farm-tests-base]commands} + python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +deps = {[testenv:azure-test-farm-tests-base]deps} +passenv = {[testenv:azure-test-farm-tests-base]passenv} +setenv = {[testenv:azure-test-farm-tests-base]setenv} From 6e8ff7864d7d8a10ed3996048261c398cbef140b Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 18:59:53 +0200 Subject: [PATCH 062/172] Test failure --- .azure-pipelines/templates/tox-steps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml index 66b79513a..8c2e15b6f 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/tox-steps.yml @@ -27,6 +27,7 @@ steps: python tools/pip_install.py -U tox coverage displayName: Install runtime dependencies - bash: | + exit 1 if [[ "${TOXENV}" == *"test-farm"* ]]; then # To be removed once farm tests are configured on Azure exit 0 From eb0ac10445ac74e2943094b437dea04313888837 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 19:07:33 +0200 Subject: [PATCH 063/172] Better notify template --- .azure-pipelines/templates/notify-failure-steps.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/notify-failure-steps.yml b/.azure-pipelines/templates/notify-failure-steps.yml index dbb6ed1df..8f29899e1 100644 --- a/.azure-pipelines/templates/notify-failure-steps.yml +++ b/.azure-pipelines/templates/notify-failure-steps.yml @@ -6,5 +6,6 @@ stages: vmImage: ubuntu-latest steps: - bash: | - curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"Build has failed: https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" + MESSAGE="---\n#### Azure Pipeline: $(Build.DefinitionName)\nBuild has failed: https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results\n\n---" + curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"${MESSAGE}"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" condition: failed() From 7c986b7ecd36dcceee84ec2749a995ca73929a5f Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 19:14:44 +0200 Subject: [PATCH 064/172] Update message --- .azure-pipelines/templates/notify-failure-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/notify-failure-steps.yml b/.azure-pipelines/templates/notify-failure-steps.yml index 8f29899e1..8052a1767 100644 --- a/.azure-pipelines/templates/notify-failure-steps.yml +++ b/.azure-pipelines/templates/notify-failure-steps.yml @@ -7,5 +7,5 @@ stages: steps: - bash: | MESSAGE="---\n#### Azure Pipeline: $(Build.DefinitionName)\nBuild has failed: https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results\n\n---" - curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data '{"channel_id":"$(MATTERMOST_CHANNEL_ID)","message":"${MESSAGE}"}' -X POST "$(MATTERMOST_URL)/api/v4/posts" + curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data "{\"channel_id\":\"$(MATTERMOST_CHANNEL_ID)\",\"message\":\"${MESSAGE}\"}" -X POST "$(MATTERMOST_URL)/api/v4/posts" condition: failed() From fa9bfbe2693200e81f596a41a6ef0b225f4dcc53 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 20:17:56 +0200 Subject: [PATCH 065/172] Continue format --- .azure-pipelines/templates/notify-failure-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/notify-failure-steps.yml b/.azure-pipelines/templates/notify-failure-steps.yml index 8052a1767..e9490d041 100644 --- a/.azure-pipelines/templates/notify-failure-steps.yml +++ b/.azure-pipelines/templates/notify-failure-steps.yml @@ -6,6 +6,6 @@ stages: vmImage: ubuntu-latest steps: - bash: | - MESSAGE="---\n#### Azure Pipeline: $(Build.DefinitionName)\nBuild has failed: https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results\n\n---" + MESSAGE="---\n#### Azure Pipeline: $(Build.DefinitionName) - build $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---" curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data "{\"channel_id\":\"$(MATTERMOST_CHANNEL_ID)\",\"message\":\"${MESSAGE}\"}" -X POST "$(MATTERMOST_URL)/api/v4/posts" condition: failed() From 48550febf9d9f2461ceaa177f97a6a31e01cf18a Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 20:21:51 +0200 Subject: [PATCH 066/172] Continue format --- .azure-pipelines/templates/notify-failure-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/notify-failure-steps.yml b/.azure-pipelines/templates/notify-failure-steps.yml index e9490d041..955c16eca 100644 --- a/.azure-pipelines/templates/notify-failure-steps.yml +++ b/.azure-pipelines/templates/notify-failure-steps.yml @@ -6,6 +6,6 @@ stages: vmImage: ubuntu-latest steps: - bash: | - MESSAGE="---\n#### Azure Pipeline: $(Build.DefinitionName) - build $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---" + MESSAGE="---\n#### Azure Pipeline:\nPipeline: $(Build.DefinitionName) - Build: $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---" curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data "{\"channel_id\":\"$(MATTERMOST_CHANNEL_ID)\",\"message\":\"${MESSAGE}\"}" -X POST "$(MATTERMOST_URL)/api/v4/posts" condition: failed() From 1ca4351f50cd1feca884e0be88eb7860ede81357 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 20:25:42 +0200 Subject: [PATCH 067/172] COntinue format --- .azure-pipelines/templates/notify-failure-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/notify-failure-steps.yml b/.azure-pipelines/templates/notify-failure-steps.yml index 955c16eca..8b73dc9e4 100644 --- a/.azure-pipelines/templates/notify-failure-steps.yml +++ b/.azure-pipelines/templates/notify-failure-steps.yml @@ -6,6 +6,6 @@ stages: vmImage: ubuntu-latest steps: - bash: | - MESSAGE="---\n#### Azure Pipeline:\nPipeline: $(Build.DefinitionName) - Build: $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---" + MESSAGE="---\n#### Azure Pipeline - Pipeline: $(Build.DefinitionName) - Build: $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---" curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data "{\"channel_id\":\"$(MATTERMOST_CHANNEL_ID)\",\"message\":\"${MESSAGE}\"}" -X POST "$(MATTERMOST_URL)/api/v4/posts" condition: failed() From c2f2e4ed5037bd88ec423ed575d303e59d76cfb3 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 21:03:45 +0200 Subject: [PATCH 068/172] Final touch --- .azure-pipelines/templates/notify-failure-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/notify-failure-steps.yml b/.azure-pipelines/templates/notify-failure-steps.yml index 8b73dc9e4..159cd21b6 100644 --- a/.azure-pipelines/templates/notify-failure-steps.yml +++ b/.azure-pipelines/templates/notify-failure-steps.yml @@ -6,6 +6,6 @@ stages: vmImage: ubuntu-latest steps: - bash: | - MESSAGE="---\n#### Azure Pipeline - Pipeline: $(Build.DefinitionName) - Build: $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---" + MESSAGE="---\n##### Azure Pipeline - Pipeline: $(Build.DefinitionName) - Build: $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---" curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data "{\"channel_id\":\"$(MATTERMOST_CHANNEL_ID)\",\"message\":\"${MESSAGE}\"}" -X POST "$(MATTERMOST_URL)/api/v4/posts" condition: failed() From 2d2ff6f3ab2ec8a1b852e17cdf6095eab9eb95ad Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 21:10:27 +0200 Subject: [PATCH 069/172] Reactivate everything --- .../templates/standard-tests-jobs.yml | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/.azure-pipelines/templates/standard-tests-jobs.yml b/.azure-pipelines/templates/standard-tests-jobs.yml index d9fd97a7c..c0db324df 100644 --- a/.azure-pipelines/templates/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/standard-tests-jobs.yml @@ -9,53 +9,53 @@ jobs: IMAGE_NAME: macOS-10.14 PYTHON_VERSION: 2.7 TOXENV: py27 -# macos-py38: -# IMAGE_NAME: macOS-10.14 -# PYTHON_VERSION: 3.8 -# TOXENV: py38 -# windows-py35: -# IMAGE_NAME: vs2017-win2016 -# PYTHON_VERSION: 3.5 -# TOXENV: py35 -# windows-py37-cover: -# IMAGE_NAME: vs2017-win2016 -# PYTHON_VERSION: 3.7 -# TOXENV: py37-cover -# windows-integration-certbot: -# IMAGE_NAME: vs2017-win2016 -# PYTHON_VERSION: 3.7 -# TOXENV: integration-certbot -# linux-oldest-tests: -# IMAGE_NAME: ubuntu-18.04 -# TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest -# linux-py27: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 2.7 -# TOXENV: py27 -# linux-py35: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 3.5 -# TOXENV: py35 -# linux-py38-cover: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 3.8 -# TOXENV: py27-cover -# linux-py37-lint: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 3.7 -# TOXENV: lint -# linux-py35-mypy: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 3.5 -# TOXENV: mypy -# linux-integration: -# IMAGE_NAME: ubuntu-18.04 -# PYTHON_VERSION: 2.7 -# TOXENV: integration -# ACME_SERVER: pebble -# apache-compat: -# IMAGE_NAME: ubuntu-18.04 -# TOXENV: apache_compat + macos-py38: + IMAGE_NAME: macOS-10.14 + PYTHON_VERSION: 3.8 + TOXENV: py38 + windows-py35: + IMAGE_NAME: vs2017-win2016 + PYTHON_VERSION: 3.5 + TOXENV: py35 + windows-py37-cover: + IMAGE_NAME: vs2017-win2016 + PYTHON_VERSION: 3.7 + TOXENV: py37-cover + windows-integration-certbot: + IMAGE_NAME: vs2017-win2016 + PYTHON_VERSION: 3.7 + TOXENV: integration-certbot + linux-oldest-tests: + IMAGE_NAME: ubuntu-18.04 + TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest + linux-py27: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 2.7 + TOXENV: py27 + linux-py35: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.5 + TOXENV: py35 + linux-py38-cover: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.8 + TOXENV: py27-cover + linux-py37-lint: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.7 + TOXENV: lint + linux-py35-mypy: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 3.5 + TOXENV: mypy + linux-integration: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 2.7 + TOXENV: integration + ACME_SERVER: pebble + apache-compat: + IMAGE_NAME: ubuntu-18.04 + TOXENV: apache_compat pool: vmImage: $(IMAGE_NAME) steps: From 8be635a4df0b17bf89d72f789a3cd0b0762fd5b5 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 21:11:00 +0200 Subject: [PATCH 070/172] Remove forced failure --- .azure-pipelines/templates/tox-steps.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/tox-steps.yml index 8c2e15b6f..66b79513a 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/tox-steps.yml @@ -27,7 +27,6 @@ steps: python tools/pip_install.py -U tox coverage displayName: Install runtime dependencies - bash: | - exit 1 if [[ "${TOXENV}" == *"test-farm"* ]]; then # To be removed once farm tests are configured on Azure exit 0 From 1042743ec7fe94b03ad25e7bcda73e01d2ba134d Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 21:15:20 +0200 Subject: [PATCH 071/172] Configure pipelines --- .azure-pipelines/advanced-test.yml | 15 +++++++++------ .azure-pipelines/advanced.yml | 15 +++++++++------ .azure-pipelines/main.yml | 7 ++----- .azure-pipelines/release.yml | 17 ++++++++++------- 4 files changed, 30 insertions(+), 24 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 025225871..7e2c1293a 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -6,9 +6,12 @@ trigger: - test-* pr: none -jobs: - # Any addition here should be reflected in the advanced and release pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-jobs.yml - - template: templates/extended-tests-jobs.yml - - template: templates/packaging-jobs.yml +stages: + - stage: Build_Test_Package + jobs: + # Any addition here should be reflected in the advanced and release pipelines. + # It is advised to declare all jobs here as templates to improve maintainability. + - template: templates/standard-tests-jobs.yml + - template: templates/extended-tests-jobs.yml + - template: templates/packaging-jobs.yml + - template: templates/notify-failure-steps.yml diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index c1aebc976..8436e3c4e 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -11,9 +11,12 @@ schedules: - master always: true -jobs: - # Any addition here should be reflected in the advanced-test and release pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-jobs.yml - - template: templates/extended-tests-jobs.yml - - template: templates/packaging-jobs.yml +stages: + - stage: Build_Test_Package + jobs: + # Any addition here should be reflected in the advanced-test and release pipelines. + # It is advised to declare all jobs here as templates to improve maintainability. + - template: templates/standard-tests-jobs.yml + - template: templates/extended-tests-jobs.yml + - template: templates/packaging-jobs.yml + - template: templates/notify-failure-steps.yml diff --git a/.azure-pipelines/main.yml b/.azure-pipelines/main.yml index 24d05c954..723b35d56 100644 --- a/.azure-pipelines/main.yml +++ b/.azure-pipelines/main.yml @@ -4,8 +4,5 @@ pr: - master - '*.x' -stages: - - stage: Test - jobs: - - template: templates/standard-tests-jobs.yml - - template: templates/notify-failure-steps.yml +jobs: + - template: templates/standard-tests-jobs.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index 3dea79418..a8fc20689 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -5,10 +5,13 @@ trigger: - v* pr: none -jobs: - # Any addition here should be reflected in the advanced and advanced-test pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-jobs.yml - - template: templates/extended-tests-jobs.yml - - template: templates/packaging-jobs.yml - - template: templates/changelog-jobs.yml +stage: + - stage: Build_Test_Package + jobs: + # Any addition here should be reflected in the advanced and advanced-test pipelines. + # It is advised to declare all jobs here as templates to improve maintainability. + - template: templates/standard-tests-jobs.yml + - template: templates/extended-tests-jobs.yml + - template: templates/packaging-jobs.yml + - template: templates/changelog-jobs.yml + - template: templates/notify-failure-steps.yml From 0b3a27049bfd058c38b7d1d468c39f01144f4617 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 21:19:33 +0200 Subject: [PATCH 072/172] No notification for tests branches --- .azure-pipelines/advanced-test.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 7e2c1293a..025225871 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -6,12 +6,9 @@ trigger: - test-* pr: none -stages: - - stage: Build_Test_Package - jobs: - # Any addition here should be reflected in the advanced and release pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-jobs.yml - - template: templates/extended-tests-jobs.yml - - template: templates/packaging-jobs.yml - - template: templates/notify-failure-steps.yml +jobs: + # Any addition here should be reflected in the advanced and release pipelines. + # It is advised to declare all jobs here as templates to improve maintainability. + - template: templates/standard-tests-jobs.yml + - template: templates/extended-tests-jobs.yml + - template: templates/packaging-jobs.yml From 168fb7a6ea7a8c6ba64164dba7e5cb385533fc5f Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 21:52:06 +0200 Subject: [PATCH 073/172] Prepare deploy --- .azure-pipelines/advanced.yml | 3 +++ .azure-pipelines/release.yml | 3 +++ .../templates/deployment-jobs.yml | 22 +++++++++++++++++++ snap/snapcraft.yaml | 2 +- 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 .azure-pipelines/templates/deployment-jobs.yml diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index 8436e3c4e..e26d5a402 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -19,4 +19,7 @@ stages: - template: templates/standard-tests-jobs.yml - template: templates/extended-tests-jobs.yml - template: templates/packaging-jobs.yml + - stage: Deploy + jobs: + - template: templates/deploy-jobs.yml - template: templates/notify-failure-steps.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index a8fc20689..55b685d96 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -14,4 +14,7 @@ stage: - template: templates/extended-tests-jobs.yml - template: templates/packaging-jobs.yml - template: templates/changelog-jobs.yml + - stage: Deploy + jobs: + - template: templates/deploy-jobs.yml - template: templates/notify-failure-steps.yml diff --git a/.azure-pipelines/templates/deployment-jobs.yml b/.azure-pipelines/templates/deployment-jobs.yml new file mode 100644 index 000000000..b4de97f45 --- /dev/null +++ b/.azure-pipelines/templates/deployment-jobs.yml @@ -0,0 +1,22 @@ +jobs: + - job: publish_snap + pool: + vmImage: ubuntu-18.04 + steps: + - bash: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends snap + sudo snap install --classic snapcraft + displayName: Install dependencies + - bash: | + mkdir .snapcraft + echo $(SNAPCRAFT_LOGIN_FILE) | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg + displayName: Prepare login to Snap store + - task: DownloadPipelineArtifact@2 + inputs: + artifact: snap + path: $(Build.SourcesDirectory)/snap + displayName: Retrieve Certbot snap + - bash: | + snapcraft push --release=edge snap/*.snap + displayName: Publish to Snap store diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 2e4f68c00..9c6a519a7 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,4 +1,4 @@ -name: certbot +name: adferrand-certbot summary: Automatically configure HTTPS using Let's Encrypt description: | The objective of Certbot, Let's Encrypt, and the ACME (Automated From 35f234520e91c8b08b725b28dd05e6eb784e0057 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 21:52:30 +0200 Subject: [PATCH 074/172] Focus on packaging jobs --- .azure-pipelines/advanced.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index e26d5a402..1e3174776 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -16,8 +16,8 @@ stages: jobs: # Any addition here should be reflected in the advanced-test and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-jobs.yml - - template: templates/extended-tests-jobs.yml +# - template: templates/standard-tests-jobs.yml +# - template: templates/extended-tests-jobs.yml - template: templates/packaging-jobs.yml - stage: Deploy jobs: From b26854e38c02accb7fbdacfebf08338016715b92 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 21:53:21 +0200 Subject: [PATCH 075/172] Update template name --- .azure-pipelines/advanced.yml | 2 +- .azure-pipelines/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index 1e3174776..eac39e16d 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -21,5 +21,5 @@ stages: - template: templates/packaging-jobs.yml - stage: Deploy jobs: - - template: templates/deploy-jobs.yml + - template: templates/deployment-jobs.yml - template: templates/notify-failure-steps.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index 55b685d96..ad33a4934 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -16,5 +16,5 @@ stage: - template: templates/changelog-jobs.yml - stage: Deploy jobs: - - template: templates/deploy-jobs.yml + - template: templates/deployment-jobs.yml - template: templates/notify-failure-steps.yml From 0963be1732f4cbbb4434722b0bfd044662382de1 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 22:04:26 +0200 Subject: [PATCH 076/172] Refactor --- .azure-pipelines/advanced-test.yml | 6 +++--- .azure-pipelines/advanced.yml | 6 +++--- .azure-pipelines/main.yml | 2 +- .azure-pipelines/release.yml | 12 ++++++------ .../templates/{ => jobs}/changelog-jobs.yml | 0 .../templates/{ => jobs}/deployment-jobs.yml | 6 ++---- .../templates/{ => jobs}/extended-tests-jobs.yml | 2 +- .../templates/{ => jobs}/packaging-jobs.yml | 0 .../templates/{ => jobs}/standard-tests-jobs.yml | 2 +- .../notify-failure-stage.yml} | 4 ++-- .azure-pipelines/templates/{ => steps}/tox-steps.yml | 3 +-- 11 files changed, 20 insertions(+), 23 deletions(-) rename .azure-pipelines/templates/{ => jobs}/changelog-jobs.yml (100%) rename .azure-pipelines/templates/{ => jobs}/deployment-jobs.yml (91%) rename .azure-pipelines/templates/{ => jobs}/extended-tests-jobs.yml (98%) rename .azure-pipelines/templates/{ => jobs}/packaging-jobs.yml (100%) rename .azure-pipelines/templates/{ => jobs}/standard-tests-jobs.yml (97%) rename .azure-pipelines/templates/{notify-failure-steps.yml => stages/notify-failure-stage.yml} (91%) rename .azure-pipelines/templates/{ => steps}/tox-steps.yml (92%) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 025225871..012292ef2 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -9,6 +9,6 @@ pr: none jobs: # Any addition here should be reflected in the advanced and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-jobs.yml - - template: templates/extended-tests-jobs.yml - - template: templates/packaging-jobs.yml + - template: templates/jobs/standard-tests-jobs.yml + - template: templates/jobs/extended-tests-jobs.yml + - template: templates/jobs/packaging-jobs.yml diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index eac39e16d..747ea0b5a 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -18,8 +18,8 @@ stages: # It is advised to declare all jobs here as templates to improve maintainability. # - template: templates/standard-tests-jobs.yml # - template: templates/extended-tests-jobs.yml - - template: templates/packaging-jobs.yml + - template: templates/jobs/packaging-jobs.yml - stage: Deploy jobs: - - template: templates/deployment-jobs.yml - - template: templates/notify-failure-steps.yml + - template: templates/jobs/deployment-jobs.yml + - template: templates/stages/notify-failure-stage.yml diff --git a/.azure-pipelines/main.yml b/.azure-pipelines/main.yml index 723b35d56..836e77122 100644 --- a/.azure-pipelines/main.yml +++ b/.azure-pipelines/main.yml @@ -5,4 +5,4 @@ pr: - '*.x' jobs: - - template: templates/standard-tests-jobs.yml + - template: templates/jobs/standard-tests-jobs.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index ad33a4934..380be8d9c 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -10,11 +10,11 @@ stage: jobs: # Any addition here should be reflected in the advanced and advanced-test pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-jobs.yml - - template: templates/extended-tests-jobs.yml - - template: templates/packaging-jobs.yml - - template: templates/changelog-jobs.yml + - template: templates/jobs/standard-tests-jobs.yml + - template: templates/jobs/extended-tests-jobs.yml + - template: templates/jobs/packaging-jobs.yml + - template: templates/jobs/changelog-jobs.yml - stage: Deploy jobs: - - template: templates/deployment-jobs.yml - - template: templates/notify-failure-steps.yml + - template: templates/jobs/deployment-jobs.yml + - template: templates/stages/notify-failure-stage.yml diff --git a/.azure-pipelines/templates/changelog-jobs.yml b/.azure-pipelines/templates/jobs/changelog-jobs.yml similarity index 100% rename from .azure-pipelines/templates/changelog-jobs.yml rename to .azure-pipelines/templates/jobs/changelog-jobs.yml diff --git a/.azure-pipelines/templates/deployment-jobs.yml b/.azure-pipelines/templates/jobs/deployment-jobs.yml similarity index 91% rename from .azure-pipelines/templates/deployment-jobs.yml rename to .azure-pipelines/templates/jobs/deployment-jobs.yml index b4de97f45..a1ece1115 100644 --- a/.azure-pipelines/templates/deployment-jobs.yml +++ b/.azure-pipelines/templates/jobs/deployment-jobs.yml @@ -8,15 +8,13 @@ jobs: sudo apt-get install -y --no-install-recommends snap sudo snap install --classic snapcraft displayName: Install dependencies - - bash: | - mkdir .snapcraft - echo $(SNAPCRAFT_LOGIN_FILE) | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg - displayName: Prepare login to Snap store - task: DownloadPipelineArtifact@2 inputs: artifact: snap path: $(Build.SourcesDirectory)/snap displayName: Retrieve Certbot snap - bash: | + mkdir .snapcraft + echo $(SNAPCRAFT_LOGIN_FILE) | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg snapcraft push --release=edge snap/*.snap displayName: Publish to Snap store diff --git a/.azure-pipelines/templates/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml similarity index 98% rename from .azure-pipelines/templates/extended-tests-jobs.yml rename to .azure-pipelines/templates/jobs/extended-tests-jobs.yml index c9229ece5..9f0acff24 100644 --- a/.azure-pipelines/templates/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -93,4 +93,4 @@ jobs: pool: vmImage: $(IMAGE_NAME) steps: - - template: tox-steps.yml + - template: steps/tox-steps.yml diff --git a/.azure-pipelines/templates/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml similarity index 100% rename from .azure-pipelines/templates/packaging-jobs.yml rename to .azure-pipelines/templates/jobs/packaging-jobs.yml diff --git a/.azure-pipelines/templates/standard-tests-jobs.yml b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml similarity index 97% rename from .azure-pipelines/templates/standard-tests-jobs.yml rename to .azure-pipelines/templates/jobs/standard-tests-jobs.yml index c0db324df..0e30b820e 100644 --- a/.azure-pipelines/templates/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml @@ -59,4 +59,4 @@ jobs: pool: vmImage: $(IMAGE_NAME) steps: - - template: tox-steps.yml + - template: steps/tox-steps.yml diff --git a/.azure-pipelines/templates/notify-failure-steps.yml b/.azure-pipelines/templates/stages/notify-failure-stage.yml similarity index 91% rename from .azure-pipelines/templates/notify-failure-steps.yml rename to .azure-pipelines/templates/stages/notify-failure-stage.yml index 159cd21b6..d615416b6 100644 --- a/.azure-pipelines/templates/notify-failure-steps.yml +++ b/.azure-pipelines/templates/stages/notify-failure-stage.yml @@ -1,7 +1,7 @@ stages: - - stage: Notify_Failure + - stage: On_Failure jobs: - - job: notify + - job: notify_mattermost pool: vmImage: ubuntu-latest steps: diff --git a/.azure-pipelines/templates/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml similarity index 92% rename from .azure-pipelines/templates/tox-steps.yml rename to .azure-pipelines/templates/steps/tox-steps.yml index 66b79513a..5d7af9935 100644 --- a/.azure-pipelines/templates/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -22,9 +22,8 @@ steps: versionSpec: $(PYTHON_VERSION) addToPath: true condition: ne(coalesce(variables['PYTHON_VERSION'], 'UNSPECIFIED'), 'UNSPECIFIED') - displayName: Activate selected Python version - bash: | - python tools/pip_install.py -U tox coverage + python tools/pip_install.py -I tox virtualenv displayName: Install runtime dependencies - bash: | if [[ "${TOXENV}" == *"test-farm"* ]]; then From 16f3ab1cb3203096241929f49ceef6375488caf0 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 22:09:01 +0200 Subject: [PATCH 077/172] Reuse copy task here --- .azure-pipelines/templates/jobs/packaging-jobs.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/templates/jobs/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml index 9f389ee0d..c8ab211af 100644 --- a/.azure-pipelines/templates/jobs/packaging-jobs.yml +++ b/.azure-pipelines/templates/jobs/packaging-jobs.yml @@ -8,10 +8,13 @@ jobs: versionSpec: 3.7 architecture: x86 addToPath: true - - bash: | - python windows-installer/construct.py - mv windows-installer/build/nsis/*.exe $(Build.ArtifactStagingDirectory) + - script: python windows-installer/construct.py displayName: Build Certbot installer + - task: CopyFiles@2 + inputs: + sourceFolder: $(System.DefaultWorkingDirectory)/windows-installer/build/nsis + contents: '*.exe' + targetFolder: $(Build.ArtifactStagingDirectory) - task: PublishPipelineArtifact@1 inputs: path: $(Build.ArtifactStagingDirectory) From 28e8fc46e9ccaf0908c2d7cba3a26f5e52f3ff72 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 26 Apr 2020 22:14:01 +0200 Subject: [PATCH 078/172] Define variable group --- .azure-pipelines/templates/jobs/deployment-jobs.yml | 2 ++ .azure-pipelines/templates/jobs/extended-tests-jobs.yml | 8 ++++++-- .../templates/stages/notify-failure-stage.yml | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/jobs/deployment-jobs.yml b/.azure-pipelines/templates/jobs/deployment-jobs.yml index a1ece1115..696d34130 100644 --- a/.azure-pipelines/templates/jobs/deployment-jobs.yml +++ b/.azure-pipelines/templates/jobs/deployment-jobs.yml @@ -2,6 +2,8 @@ jobs: - job: publish_snap pool: vmImage: ubuntu-18.04 + variables: + - group: certbot-common steps: - bash: | sudo apt-get update diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 9f0acff24..4f1e60c77 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -1,9 +1,13 @@ jobs: - job: x_test variables: - IMAGE_NAME: ubuntu-18.04 + - name: IMAGE_NAME + value: ubuntu-18.04 + ${{ if contains(variables['TOXENV'], 'test-farm') }}: + - group: certbot-common ${{ if contains(variables['TOXENV'], 'integration') }}: - PYTEST_ADDOPTS: --numprocesses 4 + - name: PYTEST_ADDOPTS + value: --numprocesses 4 strategy: matrix: linux-py36: diff --git a/.azure-pipelines/templates/stages/notify-failure-stage.yml b/.azure-pipelines/templates/stages/notify-failure-stage.yml index d615416b6..07123e70e 100644 --- a/.azure-pipelines/templates/stages/notify-failure-stage.yml +++ b/.azure-pipelines/templates/stages/notify-failure-stage.yml @@ -2,6 +2,8 @@ stages: - stage: On_Failure jobs: - job: notify_mattermost + variables: + - group: certbot-common pool: vmImage: ubuntu-latest steps: From d339a7b49df5d2205b844d4dea7a7cd7ba8d98b4 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 11 Jun 2020 23:32:24 +0200 Subject: [PATCH 079/172] Add snap multiarch build --- .../templates/jobs/packaging-jobs.yml | 21 ++++++++++++------- snap/local/{build_and_install.sh => build.sh} | 9 -------- 2 files changed, 14 insertions(+), 16 deletions(-) rename snap/local/{build_and_install.sh => build.sh} (79%) mode change 100755 => 100644 diff --git a/.azure-pipelines/templates/jobs/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml index c8ab211af..6d651bdfa 100644 --- a/.azure-pipelines/templates/jobs/packaging-jobs.yml +++ b/.azure-pipelines/templates/jobs/packaging-jobs.yml @@ -59,14 +59,21 @@ jobs: venv\Scripts\python -m pytest certbot-ci\certbot_integration_tests\certbot_tests -n 4 displayName: Run certbot integration tests - job: snap_build + strategy: + matrix: + amd64: + ARCH: amd64 + i386: + ARCH: i386 + arm64: + ARCH: arm64 + armhf: + ARCH: armhf pool: vmImage: ubuntu-18.04 steps: - script: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends snap - sudo snap install --classic snapcraft - sudo snap install lxd + snap/local/build.sh ${ARCH} displayName: Install dependencies - script: | snap/local/build_and_install.sh @@ -75,7 +82,7 @@ jobs: - task: PublishPipelineArtifact@1 inputs: path: $(Build.ArtifactStagingDirectory) - artifact: snap + artifact: snap-$(arch) displayName: Publish Snap - job: snap_run dependsOn: snap_build @@ -91,11 +98,11 @@ jobs: displayName: Install dependencies - task: DownloadPipelineArtifact@2 inputs: - artifact: snap + artifact: snap-amd64 path: $(Build.SourcesDirectory)/snap displayName: Retrieve Certbot snap - script: | - sudo snap install --dangerous --classic snap/*.snap + sudo snap install --dangerous --classic snap-amd64/*.snap displayName: Install Certbot snap - script: | python -m tox diff --git a/snap/local/build_and_install.sh b/snap/local/build.sh old mode 100755 new mode 100644 similarity index 79% rename from snap/local/build_and_install.sh rename to snap/local/build.sh index 225bd54ec..ba28a30ec --- a/snap/local/build_and_install.sh +++ b/snap/local/build.sh @@ -5,11 +5,6 @@ # Usage: build_and_install.sh [amd64,arm64,armhf] set -ex -if [[ -z "$TRAVIS" && -z "$SYSTEM_TEAMFOUNDATIONSERVERURI" ]]; then - echo "This script makes global changes to the system it is run on so should only be run in CI." - exit 1 -fi - SNAP_ARCH=$1 if [[ -z "${SNAP_ARCH}" ]]; then @@ -47,7 +42,3 @@ docker run \ -e "PIP_EXTRA_INDEX_URL=http://localhost:8080" \ "adferrand/snapcraft:${DOCKER_ARCH}-stable" \ snapcraft - -if [[ "$(arch)" == "${QEMU_ARCH}" ]]; then - sudo snap install --dangerous --classic *.snap -fi From da4b3e7174ee7188b9de3c5d67b6bef1598e4c67 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 11 Jun 2020 23:37:54 +0200 Subject: [PATCH 080/172] Add +x permissions --- snap/local/build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 snap/local/build.sh diff --git a/snap/local/build.sh b/snap/local/build.sh old mode 100644 new mode 100755 From 5bf7b910a0291daa2b8bee8e64a54fd0a8bb2a48 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 11 Jun 2020 23:40:44 +0200 Subject: [PATCH 081/172] Simplify steps --- .azure-pipelines/templates/jobs/packaging-jobs.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.azure-pipelines/templates/jobs/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml index 6d651bdfa..cf6fb14f5 100644 --- a/.azure-pipelines/templates/jobs/packaging-jobs.yml +++ b/.azure-pipelines/templates/jobs/packaging-jobs.yml @@ -74,9 +74,6 @@ jobs: steps: - script: | snap/local/build.sh ${ARCH} - displayName: Install dependencies - - script: | - snap/local/build_and_install.sh mv *.snap $(Build.ArtifactStagingDirectory) displayName: Build Certbot snap - task: PublishPipelineArtifact@1 From 621fc08750b7a988e3230304f7c40f3c39a71a3a Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 11 Jun 2020 23:51:52 +0200 Subject: [PATCH 082/172] Disable deploy for now --- .azure-pipelines/advanced.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index 747ea0b5a..7592589f9 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -16,10 +16,10 @@ stages: jobs: # Any addition here should be reflected in the advanced-test and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. -# - template: templates/standard-tests-jobs.yml -# - template: templates/extended-tests-jobs.yml + - template: templates/standard-tests-jobs.yml + - template: templates/extended-tests-jobs.yml - template: templates/jobs/packaging-jobs.yml - - stage: Deploy - jobs: - - template: templates/jobs/deployment-jobs.yml +# - stage: Deploy +# jobs: +# - template: templates/jobs/deployment-jobs.yml - template: templates/stages/notify-failure-stage.yml From 1f4a0bc6023d2384a4b3a440df71fca71f66d5a6 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 11 Jun 2020 23:52:50 +0200 Subject: [PATCH 083/172] Fix --- .azure-pipelines/advanced.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index 7592589f9..8f9ff93b9 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -16,8 +16,8 @@ stages: jobs: # Any addition here should be reflected in the advanced-test and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/standard-tests-jobs.yml - - template: templates/extended-tests-jobs.yml + - template: templates/jobs/standard-tests-jobs.yml + - template: templates/jobs/extended-tests-jobs.yml - template: templates/jobs/packaging-jobs.yml # - stage: Deploy # jobs: From 46e7f1d2f2036506dedaeafec09327e9522ecbb5 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 11 Jun 2020 23:53:57 +0200 Subject: [PATCH 084/172] Fix paths --- .azure-pipelines/templates/jobs/extended-tests-jobs.yml | 2 +- .azure-pipelines/templates/jobs/standard-tests-jobs.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 4f1e60c77..db0300c28 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -97,4 +97,4 @@ jobs: pool: vmImage: $(IMAGE_NAME) steps: - - template: steps/tox-steps.yml + - template: ../steps/tox-steps.yml diff --git a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml index 0e30b820e..61697263e 100644 --- a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml @@ -59,4 +59,4 @@ jobs: pool: vmImage: $(IMAGE_NAME) steps: - - template: steps/tox-steps.yml + - template: ../steps/tox-steps.yml From b16bb36b48c176370cdb9edc5b5c82c86729c6f9 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 11 Jun 2020 23:57:47 +0200 Subject: [PATCH 085/172] Parsing --- .azure-pipelines/templates/jobs/extended-tests-jobs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index db0300c28..06d491bff 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -3,9 +3,9 @@ jobs: variables: - name: IMAGE_NAME value: ubuntu-18.04 - ${{ if contains(variables['TOXENV'], 'test-farm') }}: + - ${{ if contains(variables['TOXENV'], 'test-farm') }}: - group: certbot-common - ${{ if contains(variables['TOXENV'], 'integration') }}: + - ${{ if contains(variables['TOXENV'], 'integration') }}: - name: PYTEST_ADDOPTS value: --numprocesses 4 strategy: From 5692bc37ef542135f56f941a7d13ce6b826cc2fa Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 11 Jun 2020 23:59:41 +0200 Subject: [PATCH 086/172] Try without template --- .azure-pipelines/templates/jobs/extended-tests-jobs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 06d491bff..449097c2c 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -3,9 +3,9 @@ jobs: variables: - name: IMAGE_NAME value: ubuntu-18.04 - - ${{ if contains(variables['TOXENV'], 'test-farm') }}: + # - ${{ if contains(variables['TOXENV'], 'test-farm') }}: - group: certbot-common - - ${{ if contains(variables['TOXENV'], 'integration') }}: + # - ${{ if contains(variables['TOXENV'], 'integration') }}: - name: PYTEST_ADDOPTS value: --numprocesses 4 strategy: From 9474d532da9be2c88202873b82921390a79f0994 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 12 Jun 2020 09:04:42 +0200 Subject: [PATCH 087/172] Split in stages --- .azure-pipelines/advanced-test.yml | 20 +++++++++++++------ .azure-pipelines/advanced.yml | 12 ++++++++--- .azure-pipelines/release.yml | 4 ++-- .../templates/jobs/extended-tests-jobs.yml | 2 +- 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 012292ef2..08eab634c 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -6,9 +6,17 @@ trigger: - test-* pr: none -jobs: - # Any addition here should be reflected in the advanced and release pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/jobs/standard-tests-jobs.yml - - template: templates/jobs/extended-tests-jobs.yml - - template: templates/jobs/packaging-jobs.yml +# Any addition here should be reflected in the advanced and release pipelines. +# It is advised to declare all jobs here as templates to improve maintainability. +stages: + - stage: Test + jobs: + - template: templates/jobs/standard-tests-jobs.yml + - stage: Advanced test + jobs: + - template: templates/jobs/extended-tests-jobs.yml + dependsOn: [] + - stage: Package + jobs: + - template: templates/jobs/packaging-jobs.yml + dependsOn: [] diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index 8f9ff93b9..64597e276 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -11,14 +11,20 @@ schedules: - master always: true +# Any addition here should be reflected in the advanced-test and release pipelines. +# It is advised to declare all jobs here as templates to improve maintainability. stages: - - stage: Build_Test_Package + - stage: Test jobs: - # Any addition here should be reflected in the advanced-test and release pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - template: templates/jobs/standard-tests-jobs.yml + - stage: Advanced test + jobs: - template: templates/jobs/extended-tests-jobs.yml + dependsOn: [] + - stage: Package + jobs: - template: templates/jobs/packaging-jobs.yml + dependsOn: [] # - stage: Deploy # jobs: # - template: templates/jobs/deployment-jobs.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index 380be8d9c..7cb07332d 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -5,11 +5,11 @@ trigger: - v* pr: none +# Any addition here should be reflected in the advanced and advanced-test pipelines. +# It is advised to declare all jobs here as templates to improve maintainability. stage: - stage: Build_Test_Package jobs: - # Any addition here should be reflected in the advanced and advanced-test pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - template: templates/jobs/standard-tests-jobs.yml - template: templates/jobs/extended-tests-jobs.yml - template: templates/jobs/packaging-jobs.yml diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 449097c2c..72ae7eecf 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -1,5 +1,5 @@ jobs: - - job: x_test + - job: test variables: - name: IMAGE_NAME value: ubuntu-18.04 From 248ba553fe7bcb1d079af0ce7f4c5d727dde3127 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 12 Jun 2020 09:06:10 +0200 Subject: [PATCH 088/172] Fix names --- .azure-pipelines/advanced-test.yml | 2 +- .azure-pipelines/advanced.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 08eab634c..03e59605f 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -12,7 +12,7 @@ stages: - stage: Test jobs: - template: templates/jobs/standard-tests-jobs.yml - - stage: Advanced test + - stage: ExtendedTest jobs: - template: templates/jobs/extended-tests-jobs.yml dependsOn: [] diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index 64597e276..94571d0a8 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -17,7 +17,7 @@ stages: - stage: Test jobs: - template: templates/jobs/standard-tests-jobs.yml - - stage: Advanced test + - stage: ExtendedTest jobs: - template: templates/jobs/extended-tests-jobs.yml dependsOn: [] From 78de077724a3e8e3d3e26d6d3c446b0d777bd1a0 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 12 Jun 2020 09:34:00 +0200 Subject: [PATCH 089/172] Revert "Split in stages" This reverts commit 9474d532da9be2c88202873b82921390a79f0994. --- .azure-pipelines/advanced-test.yml | 20 ++++++------------- .azure-pipelines/advanced.yml | 12 +++-------- .azure-pipelines/release.yml | 4 ++-- .../templates/jobs/extended-tests-jobs.yml | 2 +- 4 files changed, 12 insertions(+), 26 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 03e59605f..012292ef2 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -6,17 +6,9 @@ trigger: - test-* pr: none -# Any addition here should be reflected in the advanced and release pipelines. -# It is advised to declare all jobs here as templates to improve maintainability. -stages: - - stage: Test - jobs: - - template: templates/jobs/standard-tests-jobs.yml - - stage: ExtendedTest - jobs: - - template: templates/jobs/extended-tests-jobs.yml - dependsOn: [] - - stage: Package - jobs: - - template: templates/jobs/packaging-jobs.yml - dependsOn: [] +jobs: + # Any addition here should be reflected in the advanced and release pipelines. + # It is advised to declare all jobs here as templates to improve maintainability. + - template: templates/jobs/standard-tests-jobs.yml + - template: templates/jobs/extended-tests-jobs.yml + - template: templates/jobs/packaging-jobs.yml diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index 94571d0a8..8f9ff93b9 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -11,20 +11,14 @@ schedules: - master always: true -# Any addition here should be reflected in the advanced-test and release pipelines. -# It is advised to declare all jobs here as templates to improve maintainability. stages: - - stage: Test + - stage: Build_Test_Package jobs: + # Any addition here should be reflected in the advanced-test and release pipelines. + # It is advised to declare all jobs here as templates to improve maintainability. - template: templates/jobs/standard-tests-jobs.yml - - stage: ExtendedTest - jobs: - template: templates/jobs/extended-tests-jobs.yml - dependsOn: [] - - stage: Package - jobs: - template: templates/jobs/packaging-jobs.yml - dependsOn: [] # - stage: Deploy # jobs: # - template: templates/jobs/deployment-jobs.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index 7cb07332d..380be8d9c 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -5,11 +5,11 @@ trigger: - v* pr: none -# Any addition here should be reflected in the advanced and advanced-test pipelines. -# It is advised to declare all jobs here as templates to improve maintainability. stage: - stage: Build_Test_Package jobs: + # Any addition here should be reflected in the advanced and advanced-test pipelines. + # It is advised to declare all jobs here as templates to improve maintainability. - template: templates/jobs/standard-tests-jobs.yml - template: templates/jobs/extended-tests-jobs.yml - template: templates/jobs/packaging-jobs.yml diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 72ae7eecf..449097c2c 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -1,5 +1,5 @@ jobs: - - job: test + - job: x_test variables: - name: IMAGE_NAME value: ubuntu-18.04 From 55ec7ce961319073878decfe147fe0b1ed2b974a Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 12 Jun 2020 09:34:41 +0200 Subject: [PATCH 090/172] Name --- .azure-pipelines/advanced.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index 8f9ff93b9..d5942a070 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -12,7 +12,7 @@ schedules: always: true stages: - - stage: Build_Test_Package + - stage: Test&Package jobs: # Any addition here should be reflected in the advanced-test and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. From 7ba2d96974f42d909642586af4b531d632d8eb14 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 12 Jun 2020 09:35:35 +0200 Subject: [PATCH 091/172] Fix path --- .azure-pipelines/templates/jobs/packaging-jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/jobs/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml index cf6fb14f5..0a25e7cf5 100644 --- a/.azure-pipelines/templates/jobs/packaging-jobs.yml +++ b/.azure-pipelines/templates/jobs/packaging-jobs.yml @@ -99,7 +99,7 @@ jobs: path: $(Build.SourcesDirectory)/snap displayName: Retrieve Certbot snap - script: | - sudo snap install --dangerous --classic snap-amd64/*.snap + sudo snap install --dangerous --classic snap/*.snap displayName: Install Certbot snap - script: | python -m tox From beccf72badf60aa2a928262b5b13d0f8539d4567 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 12 Jun 2020 09:37:55 +0200 Subject: [PATCH 092/172] Name --- .azure-pipelines/advanced.yml | 2 +- .azure-pipelines/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index d5942a070..b029f9d54 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -12,7 +12,7 @@ schedules: always: true stages: - - stage: Test&Package + - stage: Test_Package jobs: # Any addition here should be reflected in the advanced-test and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index 380be8d9c..b134cef08 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -6,7 +6,7 @@ trigger: pr: none stage: - - stage: Build_Test_Package + - stage: Test_Package jobs: # Any addition here should be reflected in the advanced and advanced-test pipelines. # It is advised to declare all jobs here as templates to improve maintainability. From b1813935bee09364befa5cd4443f267fe356f889 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 13 Jun 2020 15:46:36 +0200 Subject: [PATCH 093/172] Variables --- .../templates/jobs/extended-tests-jobs.yml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 449097c2c..43d9664f6 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -1,13 +1,11 @@ jobs: - job: x_test variables: - - name: IMAGE_NAME - value: ubuntu-18.04 - # - ${{ if contains(variables['TOXENV'], 'test-farm') }}: - - group: certbot-common - # - ${{ if contains(variables['TOXENV'], 'integration') }}: - - name: PYTEST_ADDOPTS - value: --numprocesses 4 + IMAGE_NAME: ubuntu-18.04 + FARMTEST_SECURE_KEY: key + FARMTEST_SECURE_IV: iv + ${{ if contains(variables['TOXENV'], 'integration') }}: + PYTEST_ADDOPTS: --numprocesses 4 strategy: matrix: linux-py36: From 5b580d0a1a632d82176aab9b6a8bb9cd9f40bc89 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 19 Jun 2020 22:07:13 +0200 Subject: [PATCH 094/172] Add missing standard jobs --- .../templates/jobs/standard-tests-jobs.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml index 61697263e..beeb63f3d 100644 --- a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml @@ -39,7 +39,7 @@ jobs: linux-py38-cover: IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.8 - TOXENV: py27-cover + TOXENV: py38-cover linux-py37-lint: IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 3.7 @@ -56,6 +56,17 @@ jobs: apache-compat: IMAGE_NAME: ubuntu-18.04 TOXENV: apache_compat + le-auto-xenial: + IMAGE_NAME: ubuntu-18.04 + TOXENV: le_auto_xenial + apacheconftest: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 2.7 + TOXENV: apacheconftest-with-pebble + nginxroundtrip: + IMAGE_NAME: ubuntu-18.04 + PYTHON_VERSION: 2.7 + TOXENV: nginxroundtrip pool: vmImage: $(IMAGE_NAME) steps: From f8add8d5024ad04634dfad407a5763bbec8af4e6 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 21:07:36 +0200 Subject: [PATCH 095/172] Consume snapcraft config and mattermost webhook --- .azure-pipelines/templates/jobs/deployment-jobs.yml | 8 ++++++-- .../templates/stages/notify-failure-stage.yml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/templates/jobs/deployment-jobs.yml b/.azure-pipelines/templates/jobs/deployment-jobs.yml index 696d34130..d0bd6e655 100644 --- a/.azure-pipelines/templates/jobs/deployment-jobs.yml +++ b/.azure-pipelines/templates/jobs/deployment-jobs.yml @@ -15,8 +15,12 @@ jobs: artifact: snap path: $(Build.SourcesDirectory)/snap displayName: Retrieve Certbot snap + - task: DownloadSecureFile@1 + name: snapcraftCfg + inputs: + secureFile: snapcraft.cfg - bash: | - mkdir .snapcraft - echo $(SNAPCRAFT_LOGIN_FILE) | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg + mkdir -p .snapcraft + ln -s .snapcraft/snapcraft.cfg $(snapcraftCfg.secureFilePath) snapcraft push --release=edge snap/*.snap displayName: Publish to Snap store diff --git a/.azure-pipelines/templates/stages/notify-failure-stage.yml b/.azure-pipelines/templates/stages/notify-failure-stage.yml index 07123e70e..75a812c91 100644 --- a/.azure-pipelines/templates/stages/notify-failure-stage.yml +++ b/.azure-pipelines/templates/stages/notify-failure-stage.yml @@ -9,5 +9,5 @@ stages: steps: - bash: | MESSAGE="---\n##### Azure Pipeline - Pipeline: $(Build.DefinitionName) - Build: $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---" - curl -i -H "Authorization: Bearer $(MATTERMOST_TOKEN)" --data "{\"channel_id\":\"$(MATTERMOST_CHANNEL_ID)\",\"message\":\"${MESSAGE}\"}" -X POST "$(MATTERMOST_URL)/api/v4/posts" + curl -i -X POST --data-urlencode 'payload={"text":"${MESSAGE}"}' "$(MATTERMOST_URL)" condition: failed() From 90fbdf4186856e72321a9af2cdafeaf0364d7d23 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 21:10:26 +0200 Subject: [PATCH 096/172] Multi snap push --- .azure-pipelines/templates/jobs/deployment-jobs.yml | 10 +++++++++- .azure-pipelines/templates/jobs/packaging-jobs.yml | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/jobs/deployment-jobs.yml b/.azure-pipelines/templates/jobs/deployment-jobs.yml index d0bd6e655..d6fd7d8c8 100644 --- a/.azure-pipelines/templates/jobs/deployment-jobs.yml +++ b/.azure-pipelines/templates/jobs/deployment-jobs.yml @@ -1,5 +1,13 @@ jobs: - job: publish_snap + strategy: + matrix: + amd64: + ARCH: amd64 + arm64: + ARCH: arm64 + armhf: + ARCH: armhf pool: vmImage: ubuntu-18.04 variables: @@ -12,7 +20,7 @@ jobs: displayName: Install dependencies - task: DownloadPipelineArtifact@2 inputs: - artifact: snap + artifact: snap-$(arch) path: $(Build.SourcesDirectory)/snap displayName: Retrieve Certbot snap - task: DownloadSecureFile@1 diff --git a/.azure-pipelines/templates/jobs/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml index 18fae075a..d192f1968 100644 --- a/.azure-pipelines/templates/jobs/packaging-jobs.yml +++ b/.azure-pipelines/templates/jobs/packaging-jobs.yml @@ -78,7 +78,7 @@ jobs: inputs: path: $(Build.ArtifactStagingDirectory) artifact: snap-$(arch) - displayName: Publish Snap + displayName: Store snap artifact - job: snap_run dependsOn: snap_build pool: From e09cbcb0d64469d3e9fd461c7a1a02dffa98a032 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 21:14:46 +0200 Subject: [PATCH 097/172] Reconfigure variables in extended jobs --- .../templates/jobs/extended-tests-jobs.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 43d9664f6..47d35453d 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -1,11 +1,11 @@ jobs: - job: x_test variables: - IMAGE_NAME: ubuntu-18.04 - FARMTEST_SECURE_KEY: key - FARMTEST_SECURE_IV: iv - ${{ 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: From d140408faf0d3ab5452312dd292ceb0ed45ab7d4 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 21:34:21 +0200 Subject: [PATCH 098/172] Configure farm tests --- .../templates/jobs/deployment-jobs.yml | 2 +- .../templates/jobs/extended-tests-jobs.yml | 49 ++++++++++++------- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/.azure-pipelines/templates/jobs/deployment-jobs.yml b/.azure-pipelines/templates/jobs/deployment-jobs.yml index d6fd7d8c8..69148a3dc 100644 --- a/.azure-pipelines/templates/jobs/deployment-jobs.yml +++ b/.azure-pipelines/templates/jobs/deployment-jobs.yml @@ -29,6 +29,6 @@ jobs: secureFile: snapcraft.cfg - bash: | mkdir -p .snapcraft - ln -s .snapcraft/snapcraft.cfg $(snapcraftCfg.secureFilePath) + ln -s $(snapcraftCfg.secureFilePath) .snapcraft/snapcraft.cfg snapcraft push --release=edge snap/*.snap displayName: Publish to Snap store diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 47d35453d..383026523 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -1,11 +1,9 @@ jobs: - job: x_test variables: - - name: IMAGE_NAME - value: ubuntu-18.04 - - group: certbot-common - - ${{ if contains(variables['TOXENV'], 'integration') }}: - PYTEST_ADDOPTS: --numprocesses 4 + IMAGE_NAME: ubuntu-18.04 + ${{ if contains(variables['TOXENV'], 'integration') }}: + PYTEST_ADDOPTS: --numprocesses 4 strategy: matrix: linux-py36: @@ -80,19 +78,36 @@ 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 From 12dce1de229e72475c2dec52e2732adfb1acec80 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 21:54:02 +0200 Subject: [PATCH 099/172] 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 From fd8e13d6e2f316f194e441b586736e501f172809 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 21:55:18 +0200 Subject: [PATCH 100/172] Fix --- .azure-pipelines/templates/jobs/extended-tests-jobs.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 47d35453d..fa91cdb22 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -5,7 +5,8 @@ jobs: value: ubuntu-18.04 - group: certbot-common - ${{ if contains(variables['TOXENV'], 'integration') }}: - PYTEST_ADDOPTS: --numprocesses 4 + name: PYTEST_ADDOPTS + value: --numprocesses 4 strategy: matrix: linux-py36: From 53b7093611bf19c16675f18f5dd651c21fedf3b9 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 22:05:39 +0200 Subject: [PATCH 101/172] Simplify config --- .azure-pipelines/templates/jobs/extended-tests-jobs.yml | 3 --- .azure-pipelines/templates/jobs/packaging-jobs.yml | 4 +--- .azure-pipelines/templates/jobs/standard-tests-jobs.yml | 3 --- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index fa91cdb22..1d0abbc19 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -4,9 +4,6 @@ jobs: - name: IMAGE_NAME value: ubuntu-18.04 - group: certbot-common - - ${{ if contains(variables['TOXENV'], 'integration') }}: - name: PYTEST_ADDOPTS - value: --numprocesses 4 strategy: matrix: linux-py36: diff --git a/.azure-pipelines/templates/jobs/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml index d192f1968..77d905da9 100644 --- a/.azure-pipelines/templates/jobs/packaging-jobs.yml +++ b/.azure-pipelines/templates/jobs/packaging-jobs.yml @@ -83,8 +83,6 @@ jobs: dependsOn: snap_build pool: vmImage: ubuntu-18.04 - variables: - TOXENV: integration-external,apacheconftest-external-with-pebble steps: - script: | sudo apt-get update @@ -100,5 +98,5 @@ jobs: sudo snap install --dangerous --classic snap/*.snap displayName: Install Certbot snap - script: | - python -m tox + python -m tox -e integration-external,apacheconftest-external-with-pebble displayName: Run tox diff --git a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml index beeb63f3d..9eb77db78 100644 --- a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml @@ -1,8 +1,5 @@ jobs: - job: test - variables: - ${{ if contains(variables['TOXENV'], 'integration') }}: - PYTEST_ADDOPTS: --numprocesses 4 strategy: matrix: macos-py27: From 636ce3af6e2bc292166552f2e92c9d2f57240593 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 22:25:08 +0200 Subject: [PATCH 102/172] Activate farm tests --- .azure-pipelines/templates/steps/tox-steps.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 52c9f623b..c73b3a961 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -34,10 +34,6 @@ steps: 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 - exit 0 - fi if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh elif command -v unbuffer >/dev/null 2>&1; then From e71f79ea93d56cf58e4e21377ddc2f76b927d308 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 23:15:12 +0200 Subject: [PATCH 103/172] Embed interactive console behavior in dockers --- .azure-pipelines/templates/steps/tox-steps.yml | 4 ---- certbot-compatibility-test/Dockerfile-apache | 2 +- certbot-compatibility-test/Dockerfile-nginx | 2 +- letsencrypt-auto-source/Dockerfile.jessie | 2 +- letsencrypt-auto-source/Dockerfile.redhat6 | 2 +- letsencrypt-auto-source/Dockerfile.xenial | 2 +- tox.ini | 12 ++++++------ 7 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index c73b3a961..88d505ac8 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -36,10 +36,6 @@ steps: - bash: | 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 fi diff --git a/certbot-compatibility-test/Dockerfile-apache b/certbot-compatibility-test/Dockerfile-apache index 5c0495966..4843a4fcf 100644 --- a/certbot-compatibility-test/Dockerfile-apache +++ b/certbot-compatibility-test/Dockerfile-apache @@ -3,4 +3,4 @@ MAINTAINER Brad Warren RUN apt-get install apache2 -y -ENTRYPOINT [ "certbot-compatibility-test", "-p", "apache" ] +CMD [ "script", "-c", "certbot-compatibility-test -p apache -c apache.tar.gz -vvvv" ] diff --git a/certbot-compatibility-test/Dockerfile-nginx b/certbot-compatibility-test/Dockerfile-nginx index 4ade03065..4ab8b2199 100644 --- a/certbot-compatibility-test/Dockerfile-nginx +++ b/certbot-compatibility-test/Dockerfile-nginx @@ -3,4 +3,4 @@ MAINTAINER Brad Warren RUN apt-get install nginx -y -ENTRYPOINT [ "certbot-compatibility-test", "-p", "nginx" ] +CMD [ "script", "-c", "certbot-compatibility-test -p nginx -c nginx.tar.gz -vv -aie" ] diff --git a/letsencrypt-auto-source/Dockerfile.jessie b/letsencrypt-auto-source/Dockerfile.jessie index 9ee37b763..8894ff5dc 100644 --- a/letsencrypt-auto-source/Dockerfile.jessie +++ b/letsencrypt-auto-source/Dockerfile.jessie @@ -32,4 +32,4 @@ COPY . /home/lea/certbot/letsencrypt-auto-source USER lea WORKDIR /home/lea -CMD ["pytest", "-v", "-s", "certbot/letsencrypt-auto-source/tests"] +CMD ["script", "-c", "pytest -v -s certbot/letsencrypt-auto-source/tests"] diff --git a/letsencrypt-auto-source/Dockerfile.redhat6 b/letsencrypt-auto-source/Dockerfile.redhat6 index 66f21bc14..02439da3a 100644 --- a/letsencrypt-auto-source/Dockerfile.redhat6 +++ b/letsencrypt-auto-source/Dockerfile.redhat6 @@ -51,4 +51,4 @@ RUN cp /home/lea/certbot/letsencrypt-auto-source/tests/${REDHAT_DIST_FLAVOR}6_te USER lea WORKDIR /home/lea -CMD ["sudo", "certbot/letsencrypt-auto-source/tests/redhat6_tests.sh"] +CMD ["sudo", "script", "-c", "certbot/letsencrypt-auto-source/tests/redhat6_tests.sh"] diff --git a/letsencrypt-auto-source/Dockerfile.xenial b/letsencrypt-auto-source/Dockerfile.xenial index 931f1c6d3..0554441dc 100644 --- a/letsencrypt-auto-source/Dockerfile.xenial +++ b/letsencrypt-auto-source/Dockerfile.xenial @@ -33,4 +33,4 @@ COPY . /home/lea/certbot/letsencrypt-auto-source USER lea WORKDIR /home/lea -CMD ["pytest", "-v", "-s", "certbot/letsencrypt-auto-source/tests"] +CMD ["script", "-c", "pytest -v -s certbot/letsencrypt-auto-source/tests"] diff --git a/tox.ini b/tox.ini index 54aa0169c..17273ae7e 100644 --- a/tox.ini +++ b/tox.ini @@ -170,7 +170,7 @@ commands = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t apache-compat -f certbot-compatibility-test/Dockerfile-apache . - docker run --rm -it apache-compat -c apache.tar.gz -vvvv + docker run --rm apache-compat whitelist_externals = docker passenv = @@ -180,7 +180,7 @@ passenv = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t nginx-compat -f certbot-compatibility-test/Dockerfile-nginx . - docker run --rm -it nginx-compat -c nginx.tar.gz -vv -aie + docker run --rm nginx-compat whitelist_externals = docker passenv = @@ -191,7 +191,7 @@ passenv = commands = python {toxinidir}/tests/modification-check.py docker build -f letsencrypt-auto-source/Dockerfile.xenial -t lea letsencrypt-auto-source - docker run --rm -t -i lea + docker run --rm lea whitelist_externals = docker passenv = @@ -203,7 +203,7 @@ passenv = # readily available on the Wheezy Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.jessie -t lea letsencrypt-auto-source - docker run --rm -t -i lea + docker run --rm lea whitelist_externals = docker passenv = DOCKER_* @@ -213,7 +213,7 @@ passenv = DOCKER_* # readily available on the CentOS 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=centos -t lea letsencrypt-auto-source - docker run --rm -t -i lea + docker run --rm lea whitelist_externals = docker passenv = DOCKER_* @@ -223,7 +223,7 @@ passenv = DOCKER_* # readily available on the Oracle Linux 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=oraclelinux -t lea letsencrypt-auto-source - docker run --rm -t -i lea + docker run --rm lea whitelist_externals = docker passenv = DOCKER_* From c779a371508e5ff7abc5fadd57985595d428157c Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Fri, 26 Jun 2020 23:33:28 +0200 Subject: [PATCH 104/172] Remove initialization of the pem file --- tests/letstest/azure-setup.sh | 10 ---------- tests/letstest/azure-test-farm.pem.enc | Bin 1680 -> 0 bytes tox.ini | 20 ++++---------------- 3 files changed, 4 insertions(+), 26 deletions(-) delete mode 100644 tests/letstest/azure-setup.sh delete mode 100644 tests/letstest/azure-test-farm.pem.enc diff --git a/tests/letstest/azure-setup.sh b/tests/letstest/azure-setup.sh deleted file mode 100644 index 9817ce853..000000000 --- a/tests/letstest/azure-setup.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -ex -# -# Preps the test farm tests to be run in Travis. - -if [ "$BUILD_REASON" = "PullRequest" ]; then - echo This script must be run in Azure on a non-pull request build - exit 1 -fi - -openssl aes-256-cbc -K "${FARMTEST_SECURE_KEY}" -iv "${FARMTEST_SECURE_IV}" -in azure-test-farm.pem.enc -out azure-test-farm.pem -d diff --git a/tests/letstest/azure-test-farm.pem.enc b/tests/letstest/azure-test-farm.pem.enc deleted file mode 100644 index f8b1d576c606b37bdbe3a83eec29cc800ee8a91d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1680 zcmV;B25PgWUK3ZX;ZSeD~a@MsC>R2Vhw9&ZJ^HRZAa#;e4JlfV_K`n4=9$ zR9AN;O;*0zS7P{g0u1bb5O0yIZvZgsi7QbZ+9SARB+rAlNJu8$aWZJ_9aJBxDyCL- zE(CIXCA-OpUGWW}JhL(zk(YBsF&1yzCcbQv!vi0T7dVjB@RR>%OSp~5y!X`3)faVV zi(`inrw}Eu7Ikvi5uYaKq#{Tj@s}>_VNPX8bLzxA{JnijfPFFwj4YSB@{J#%9^&;u z*-ao(ZC1{@Q-{|Fwr!fC>zD-*VNkMd&eQ6w|@=(dSz$aGHzI+^juRd;of zRlVmwybUV+jU_=Zg@JuUj9+j%4nVdgy4VBwVPcVhu!a zVdFx$9k|t_O#rDTV|#-VAWi>Dv=mkTN=;)!XXxX~iZ-g{R~JtrXR(2wRpFQ{3<;%A z2ZO~*^CGF+ZU2!H2;i4Z(Mlf!$h%Liw|?xTio~SZH`22pLLfB#>?buX&U!kqs5zizErXcy38IMCL$F++8h335amCg z7&EpoUU>Z8DJFzW%V-e`j@?Yd&o^$NVw%XGdC9pkTF z4gG7Fu5F$ohKkvapk$#In}c58>l|D<7o9UGcy<5QcWq^-ePwGG_nGz-p%hE&a za$+8HkNzQkgbYO|_1Djr1R|X-UIyRZU<70kt?Qy-{)CWT5Yot``$)4HsJ_ZXW&w-t z940nXpXnQXFS!0VM4uzG5e~K#<=LSbr}fveh?lEPf{qoJ!ao!I6n7nFVozh+a%Isz zhr1_!+~`NIfzy1)?7A1j$Q3zvcy+Un@yfkM~F;ro779ngvmwL9a zlpd11`!5t(BgUAbXm{IPhUOS7`wUv($Mo{^~u{idTzQb@v}w z@ug%2Jey!zKo6fz6f&IYXXBk86L^jQfVP*MFHup`4?Nar7?$I<_Dyw07I+ z4ca729~;?=njh<1rkZ3&-_xMF)@zc|^RhT{|5f5p9jTQKbtT8FJDc_Pb^*|o7QIq2 zU-PjrYB6i^J<+GTi1P>9<#!v5D)BbcZ6MS@PkJ64P?oPvhz9=R&5xOcbB^;NX zU{^db*B>m?i&?4v*-vbwT}$8VU_xHZaBOQ@{)V@Dz><5W_$}|pkY4^PEEQ0`a^2gm z$Oq*vPL;2Gyr8IG(>qyomTja+kOCt)m$tuF)3R7E2i$a-+BwK7K_h&qj=MuF6jT?M zwR5atV~lCuDzvTN&jQ$2?mPl0pN)~DT-Mb*`c<`wy8W1JF?_JbM)w3&`cL9IO2LmZYz zp!$`d=Z(w;xkm-KYiK+Wn$ev_q1Hv`jIe|gLa!VQJXv(TORhUf*063UUa`}|3-3}% zkoMbq9~g za8vX4dCi9-(59t%l0@!!4*^&|%Z*nCtvSejOVA0NIS<%=g--al-&g|zv Date: Fri, 26 Jun 2020 23:56:37 +0200 Subject: [PATCH 105/172] Some fixes --- .azure-pipelines/release.yml | 2 +- letsencrypt-auto-source/Dockerfile.redhat6 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index b134cef08..ada93f266 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -5,7 +5,7 @@ trigger: - v* pr: none -stage: +stages: - stage: Test_Package jobs: # Any addition here should be reflected in the advanced and advanced-test pipelines. diff --git a/letsencrypt-auto-source/Dockerfile.redhat6 b/letsencrypt-auto-source/Dockerfile.redhat6 index 02439da3a..dead3e0d5 100644 --- a/letsencrypt-auto-source/Dockerfile.redhat6 +++ b/letsencrypt-auto-source/Dockerfile.redhat6 @@ -51,4 +51,4 @@ RUN cp /home/lea/certbot/letsencrypt-auto-source/tests/${REDHAT_DIST_FLAVOR}6_te USER lea WORKDIR /home/lea -CMD ["sudo", "script", "-c", "certbot/letsencrypt-auto-source/tests/redhat6_tests.sh"] +CMD ["sudo", "script -c certbot/letsencrypt-auto-source/tests/redhat6_tests.sh"] From d5c7ccd306a6668ff116ecf083841af1cafa1c8f Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 00:36:05 +0200 Subject: [PATCH 106/172] Use local project for test farm --- tests/letstest/multitester.py | 44 +++++++++++++++++++++-------------- tox.ini | 13 ++++------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/tests/letstest/multitester.py b/tests/letstest/multitester.py index 09821e7dd..504676368 100644 --- a/tests/letstest/multitester.py +++ b/tests/letstest/multitester.py @@ -63,10 +63,8 @@ parser.add_argument('aws_profile', parser.add_argument('test_script', default='test_letsencrypt_auto_certonly_standalone.sh', help='path of bash script in to deploy and run') -#parser.add_argument('--script_args', -# nargs='+', -# help='space-delimited list of arguments to pass to the bash test script', -# required=False) +parser.add_argument('--path', + help='if set, this path will be used as the tested project instead of a remote GIT repo') parser.add_argument('--repo', default='https://github.com/letsencrypt/letsencrypt.git', help='certbot git repo to use') @@ -237,6 +235,12 @@ def block_until_instance_ready(booting_instance, wait_time=5, extra_wait_time=20 # Fabric Routines #------------------------------------------------------------------------------- +def local_copy(local_cxn, path): + """copy a local certbot workspace""" + local_cxn.local('cd %s && if [ -d /tmp/letsencrypt ]; then rm -rf /tmp/letsencrypt; fi' % LOGDIR) + local_cxn.local('cd %s && cp -a %s /tmp/letsencrypt && mv -f /tmp/letsencrypt letsencrypt' % (LOGDIR, path)) + local_cxn.local('cd %s && tar czf le.tar.gz letsencrypt' % LOGDIR) + def local_git_clone(local_cxn, repo_url): "clones master of repo_url" local_cxn.local('cd %s && if [ -d letsencrypt ]; then rm -rf letsencrypt; fi' % LOGDIR) @@ -420,28 +424,32 @@ def main(): # no network connection, so don't worry about closing this one. local_cxn = Connection('localhost', config=fab_config) - # Set up local copy of git repo + # Set up local copy of git repo or of a local project #------------------------------------------------------------------------------- print("Making local dir for test repo and logs: %s"%LOGDIR) local_cxn.local('mkdir %s'%LOGDIR) - # figure out what git object to test and locally create it in LOGDIR - print("Making local git repo") try: - if cl_args.pull_request != '~': - print('Testing PR %s '%cl_args.pull_request, - "MERGING into master" if cl_args.merge_master else "") - local_git_PR(local_cxn, cl_args.repo, cl_args.pull_request, cl_args.merge_master) - elif cl_args.branch != '~': - print('Testing branch %s of %s'%(cl_args.branch, cl_args.repo)) - local_git_branch(local_cxn, cl_args.repo, cl_args.branch) + if cl_args.path: + print('Testing with local project %s' % cl_args.path) + local_copy(local_cxn, cl_args.path) else: - print('Testing master of %s'%cl_args.repo) - local_git_clone(local_cxn, cl_args.repo) + # figure out what git object to test and locally create it in LOGDIR + print("Making local git repo") + if cl_args.pull_request != '~': + print('Testing PR %s '%cl_args.pull_request, + "MERGING into master" if cl_args.merge_master else "") + local_git_PR(local_cxn, cl_args.repo, cl_args.pull_request, cl_args.merge_master) + elif cl_args.branch != '~': + print('Testing branch %s of %s'%(cl_args.branch, cl_args.repo)) + local_git_branch(local_cxn, cl_args.repo, cl_args.branch) + else: + print('Testing master of %s'%cl_args.repo) + local_git_clone(local_cxn, cl_args.repo) except BaseException: - print("FAIL: trouble with git repo") + print("FAIL: trouble with git repo or local project") traceback.print_exc() - exit() + exit(1) # Set up EC2 instances diff --git a/tox.ini b/tox.ini index 829790e55..749b09db5 100644 --- a/tox.ini +++ b/tox.ini @@ -286,36 +286,33 @@ setenv = {[testenv:py27-oldest]setenv} [testenv:azure-test-farm-tests-base] changedir = tests/letstest deps = -rtests/letstest/requirements.txt -passenv = - AWS_* - SYSTEM_DEFAULTWORKINGDIRECTORY - BUILD_SOURCEBRANCHNAME +passenv = AWS_* setenv = AWS_DEFAULT_REGION=us-east-1 [testenv:azure-test-farm-apache2] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py apache2_targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +commands = python multitester.py apache2_targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --path {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-leauto-upgrades] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --path {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-certonly-standalone] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --path {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-sdists] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --path {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} From ac9f83fbad66834a5ff5c06b976684407bb429c6 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 01:29:17 +0200 Subject: [PATCH 107/172] Test --- letsencrypt-auto-source/Dockerfile.redhat6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/letsencrypt-auto-source/Dockerfile.redhat6 b/letsencrypt-auto-source/Dockerfile.redhat6 index dead3e0d5..02439da3a 100644 --- a/letsencrypt-auto-source/Dockerfile.redhat6 +++ b/letsencrypt-auto-source/Dockerfile.redhat6 @@ -51,4 +51,4 @@ RUN cp /home/lea/certbot/letsencrypt-auto-source/tests/${REDHAT_DIST_FLAVOR}6_te USER lea WORKDIR /home/lea -CMD ["sudo", "script -c certbot/letsencrypt-auto-source/tests/redhat6_tests.sh"] +CMD ["sudo", "script", "-c", "certbot/letsencrypt-auto-source/tests/redhat6_tests.sh"] From c570a5d36bbbc2ed67a1a52131d5719550907137 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 10:34:48 +0200 Subject: [PATCH 108/172] Improve script call --- certbot-compatibility-test/Dockerfile-apache | 2 +- certbot-compatibility-test/Dockerfile-nginx | 2 +- letsencrypt-auto-source/Dockerfile.jessie | 2 +- letsencrypt-auto-source/Dockerfile.redhat6 | 2 +- letsencrypt-auto-source/Dockerfile.xenial | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/certbot-compatibility-test/Dockerfile-apache b/certbot-compatibility-test/Dockerfile-apache index 4843a4fcf..c7b294cce 100644 --- a/certbot-compatibility-test/Dockerfile-apache +++ b/certbot-compatibility-test/Dockerfile-apache @@ -3,4 +3,4 @@ MAINTAINER Brad Warren RUN apt-get install apache2 -y -CMD [ "script", "-c", "certbot-compatibility-test -p apache -c apache.tar.gz -vvvv" ] +CMD [ "script", "-qec", "certbot-compatibility-test -p apache -c apache.tar.gz -vvvv" ] diff --git a/certbot-compatibility-test/Dockerfile-nginx b/certbot-compatibility-test/Dockerfile-nginx index 4ab8b2199..03eff9c7c 100644 --- a/certbot-compatibility-test/Dockerfile-nginx +++ b/certbot-compatibility-test/Dockerfile-nginx @@ -3,4 +3,4 @@ MAINTAINER Brad Warren RUN apt-get install nginx -y -CMD [ "script", "-c", "certbot-compatibility-test -p nginx -c nginx.tar.gz -vv -aie" ] +CMD [ "script", "-qec", "certbot-compatibility-test -p nginx -c nginx.tar.gz -vv -aie" ] diff --git a/letsencrypt-auto-source/Dockerfile.jessie b/letsencrypt-auto-source/Dockerfile.jessie index 8894ff5dc..843e7848c 100644 --- a/letsencrypt-auto-source/Dockerfile.jessie +++ b/letsencrypt-auto-source/Dockerfile.jessie @@ -32,4 +32,4 @@ COPY . /home/lea/certbot/letsencrypt-auto-source USER lea WORKDIR /home/lea -CMD ["script", "-c", "pytest -v -s certbot/letsencrypt-auto-source/tests"] +CMD ["script", "-qec", "pytest -v -s certbot/letsencrypt-auto-source/tests"] diff --git a/letsencrypt-auto-source/Dockerfile.redhat6 b/letsencrypt-auto-source/Dockerfile.redhat6 index 02439da3a..85b664aeb 100644 --- a/letsencrypt-auto-source/Dockerfile.redhat6 +++ b/letsencrypt-auto-source/Dockerfile.redhat6 @@ -51,4 +51,4 @@ RUN cp /home/lea/certbot/letsencrypt-auto-source/tests/${REDHAT_DIST_FLAVOR}6_te USER lea WORKDIR /home/lea -CMD ["sudo", "script", "-c", "certbot/letsencrypt-auto-source/tests/redhat6_tests.sh"] +CMD ["script", "-qec", "sudo certbot/letsencrypt-auto-source/tests/redhat6_tests.sh"] diff --git a/letsencrypt-auto-source/Dockerfile.xenial b/letsencrypt-auto-source/Dockerfile.xenial index 0554441dc..6b6e60e2e 100644 --- a/letsencrypt-auto-source/Dockerfile.xenial +++ b/letsencrypt-auto-source/Dockerfile.xenial @@ -33,4 +33,4 @@ COPY . /home/lea/certbot/letsencrypt-auto-source USER lea WORKDIR /home/lea -CMD ["script", "-c", "pytest -v -s certbot/letsencrypt-auto-source/tests"] +CMD ["script", "-qec", "pytest -v -s certbot/letsencrypt-auto-source/tests"] From 0bc569721e9327ff333c962ccba757333f07256b Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 12:44:11 +0200 Subject: [PATCH 109/172] Install util-linux --- letsencrypt-auto-source/Dockerfile.redhat6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/letsencrypt-auto-source/Dockerfile.redhat6 b/letsencrypt-auto-source/Dockerfile.redhat6 index 85b664aeb..122b8c379 100644 --- a/letsencrypt-auto-source/Dockerfile.redhat6 +++ b/letsencrypt-auto-source/Dockerfile.redhat6 @@ -9,8 +9,8 @@ ARG REDHAT_DIST_FLAVOR RUN curl -O https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm \ && rpm -ivh epel-release-latest-6.noarch.rpm -# Install pip and sudo: -RUN yum install -y python-pip sudo +# Install pip, sudo and additional utils: +RUN yum install -y python-pip sudo util-linux-ng # Update to a stable and tested version of pip. # We do not use pipstrap here because it no longer supports Python 2.6. RUN pip install pip==9.0.1 setuptools==29.0.1 wheel==0.29.0 From f17406e364178358b8da3853626addfcf703b0f5 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 20:52:43 +0200 Subject: [PATCH 110/172] Revert "Embed interactive console behavior in dockers" This reverts commit e71f79ea93d56cf58e4e21377ddc2f76b927d308. --- certbot-compatibility-test/Dockerfile-apache | 2 +- certbot-compatibility-test/Dockerfile-nginx | 2 +- letsencrypt-auto-source/Dockerfile.jessie | 2 +- letsencrypt-auto-source/Dockerfile.redhat6 | 6 ++-- letsencrypt-auto-source/Dockerfile.xenial | 2 +- tox.ini | 37 ++++++++++++++------ 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/certbot-compatibility-test/Dockerfile-apache b/certbot-compatibility-test/Dockerfile-apache index c7b294cce..5c0495966 100644 --- a/certbot-compatibility-test/Dockerfile-apache +++ b/certbot-compatibility-test/Dockerfile-apache @@ -3,4 +3,4 @@ MAINTAINER Brad Warren RUN apt-get install apache2 -y -CMD [ "script", "-qec", "certbot-compatibility-test -p apache -c apache.tar.gz -vvvv" ] +ENTRYPOINT [ "certbot-compatibility-test", "-p", "apache" ] diff --git a/certbot-compatibility-test/Dockerfile-nginx b/certbot-compatibility-test/Dockerfile-nginx index 03eff9c7c..4ade03065 100644 --- a/certbot-compatibility-test/Dockerfile-nginx +++ b/certbot-compatibility-test/Dockerfile-nginx @@ -3,4 +3,4 @@ MAINTAINER Brad Warren RUN apt-get install nginx -y -CMD [ "script", "-qec", "certbot-compatibility-test -p nginx -c nginx.tar.gz -vv -aie" ] +ENTRYPOINT [ "certbot-compatibility-test", "-p", "nginx" ] diff --git a/letsencrypt-auto-source/Dockerfile.jessie b/letsencrypt-auto-source/Dockerfile.jessie index 843e7848c..9ee37b763 100644 --- a/letsencrypt-auto-source/Dockerfile.jessie +++ b/letsencrypt-auto-source/Dockerfile.jessie @@ -32,4 +32,4 @@ COPY . /home/lea/certbot/letsencrypt-auto-source USER lea WORKDIR /home/lea -CMD ["script", "-qec", "pytest -v -s certbot/letsencrypt-auto-source/tests"] +CMD ["pytest", "-v", "-s", "certbot/letsencrypt-auto-source/tests"] diff --git a/letsencrypt-auto-source/Dockerfile.redhat6 b/letsencrypt-auto-source/Dockerfile.redhat6 index 122b8c379..66f21bc14 100644 --- a/letsencrypt-auto-source/Dockerfile.redhat6 +++ b/letsencrypt-auto-source/Dockerfile.redhat6 @@ -9,8 +9,8 @@ ARG REDHAT_DIST_FLAVOR RUN curl -O https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm \ && rpm -ivh epel-release-latest-6.noarch.rpm -# Install pip, sudo and additional utils: -RUN yum install -y python-pip sudo util-linux-ng +# Install pip and sudo: +RUN yum install -y python-pip sudo # Update to a stable and tested version of pip. # We do not use pipstrap here because it no longer supports Python 2.6. RUN pip install pip==9.0.1 setuptools==29.0.1 wheel==0.29.0 @@ -51,4 +51,4 @@ RUN cp /home/lea/certbot/letsencrypt-auto-source/tests/${REDHAT_DIST_FLAVOR}6_te USER lea WORKDIR /home/lea -CMD ["script", "-qec", "sudo certbot/letsencrypt-auto-source/tests/redhat6_tests.sh"] +CMD ["sudo", "certbot/letsencrypt-auto-source/tests/redhat6_tests.sh"] diff --git a/letsencrypt-auto-source/Dockerfile.xenial b/letsencrypt-auto-source/Dockerfile.xenial index 6b6e60e2e..931f1c6d3 100644 --- a/letsencrypt-auto-source/Dockerfile.xenial +++ b/letsencrypt-auto-source/Dockerfile.xenial @@ -33,4 +33,4 @@ COPY . /home/lea/certbot/letsencrypt-auto-source USER lea WORKDIR /home/lea -CMD ["script", "-qec", "pytest -v -s certbot/letsencrypt-auto-source/tests"] +CMD ["pytest", "-v", "-s", "certbot/letsencrypt-auto-source/tests"] diff --git a/tox.ini b/tox.ini index 749b09db5..54aa0169c 100644 --- a/tox.ini +++ b/tox.ini @@ -170,7 +170,7 @@ commands = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t apache-compat -f certbot-compatibility-test/Dockerfile-apache . - docker run --rm apache-compat + docker run --rm -it apache-compat -c apache.tar.gz -vvvv whitelist_externals = docker passenv = @@ -180,7 +180,7 @@ passenv = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t nginx-compat -f certbot-compatibility-test/Dockerfile-nginx . - docker run --rm nginx-compat + docker run --rm -it nginx-compat -c nginx.tar.gz -vv -aie whitelist_externals = docker passenv = @@ -191,7 +191,7 @@ passenv = commands = python {toxinidir}/tests/modification-check.py docker build -f letsencrypt-auto-source/Dockerfile.xenial -t lea letsencrypt-auto-source - docker run --rm lea + docker run --rm -t -i lea whitelist_externals = docker passenv = @@ -203,7 +203,7 @@ passenv = # readily available on the Wheezy Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.jessie -t lea letsencrypt-auto-source - docker run --rm lea + docker run --rm -t -i lea whitelist_externals = docker passenv = DOCKER_* @@ -213,7 +213,7 @@ passenv = DOCKER_* # readily available on the CentOS 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=centos -t lea letsencrypt-auto-source - docker run --rm lea + docker run --rm -t -i lea whitelist_externals = docker passenv = DOCKER_* @@ -223,7 +223,7 @@ passenv = DOCKER_* # readily available on the Oracle Linux 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=oraclelinux -t lea letsencrypt-auto-source - docker run --rm lea + docker run --rm -t -i lea whitelist_externals = docker passenv = DOCKER_* @@ -285,34 +285,49 @@ setenv = {[testenv:py27-oldest]setenv} [testenv:azure-test-farm-tests-base] changedir = tests/letstest +commands = + ./azure-setup.sh deps = -rtests/letstest/requirements.txt -passenv = AWS_* +passenv = + AWS_* + SYSTEM_DEFAULTWORKINGDIRECTORY + BUILD_SOURCEBRANCHNAME + FARMTEST_SECURE_KEY + FARMTEST_SECURE_IV setenv = AWS_DEFAULT_REGION=us-east-1 [testenv:azure-test-farm-apache2] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py apache2_targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --path {toxinidir} +commands = + {[testenv:azure-test-farm-tests-base]commands} + python multitester.py apache2_targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-leauto-upgrades] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --path {toxinidir} +commands = + {[testenv:azure-test-farm-tests-base]commands} + python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-certonly-standalone] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --path {toxinidir} +commands = + {[testenv:azure-test-farm-tests-base]commands} + python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-sdists] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --path {toxinidir} +commands = + {[testenv:azure-test-farm-tests-base]commands} + python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} From ef00c6ee3bb647991183c85f07b7a39d940837bf Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 20:56:04 +0200 Subject: [PATCH 111/172] Include script call in tox --- tox.ini | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tox.ini b/tox.ini index 54aa0169c..c68a10b3f 100644 --- a/tox.ini +++ b/tox.ini @@ -170,9 +170,10 @@ commands = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t apache-compat -f certbot-compatibility-test/Dockerfile-apache . - docker run --rm -it apache-compat -c apache.tar.gz -vvvv + script -qec "docker run --rm -it apache-compat -c apache.tar.gz -vvvv" whitelist_externals = docker + script passenv = DOCKER_* @@ -180,9 +181,10 @@ passenv = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t nginx-compat -f certbot-compatibility-test/Dockerfile-nginx . - docker run --rm -it nginx-compat -c nginx.tar.gz -vv -aie + script -qec "docker run --rm -it nginx-compat -c nginx.tar.gz -vv -aie" whitelist_externals = docker + script passenv = DOCKER_* @@ -191,9 +193,10 @@ passenv = commands = python {toxinidir}/tests/modification-check.py docker build -f letsencrypt-auto-source/Dockerfile.xenial -t lea letsencrypt-auto-source - docker run --rm -t -i lea + script -qec "docker run --rm -it lea" whitelist_externals = docker + script passenv = DOCKER_* TRAVIS_BRANCH @@ -203,9 +206,10 @@ passenv = # readily available on the Wheezy Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.jessie -t lea letsencrypt-auto-source - docker run --rm -t -i lea + script -qec "docker run --rm -it lea" whitelist_externals = docker + script passenv = DOCKER_* [testenv:le_auto_centos6] @@ -213,9 +217,10 @@ passenv = DOCKER_* # readily available on the CentOS 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=centos -t lea letsencrypt-auto-source - docker run --rm -t -i lea + script -qec "docker run --rm -it lea" whitelist_externals = docker + script passenv = DOCKER_* [testenv:le_auto_oraclelinux6] @@ -223,9 +228,10 @@ passenv = DOCKER_* # readily available on the Oracle Linux 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=oraclelinux -t lea letsencrypt-auto-source - docker run --rm -t -i lea + script -qec "docker run --rm -it lea" whitelist_externals = docker + script passenv = DOCKER_* [testenv:docker_dev] From 9e490c2e127889c896bfdb0327926d8c54daa2d9 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 21:33:19 +0200 Subject: [PATCH 112/172] Real copy --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 88d505ac8..08ab619ca 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -31,7 +31,7 @@ steps: secureFile: azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | - ln -s $(testFarmPem.secureFilePath) azure-test-farm.pem + cp $(testFarmPem.secureFilePath) azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | if [[ "${TOXENV}" == *"oldest"* ]]; then From e70eb4e49e6d1a47b01f36e39253554f393c7822 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 21:47:36 +0200 Subject: [PATCH 113/172] Fix calls --- tox.ini | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/tox.ini b/tox.ini index c68a10b3f..62f91cd30 100644 --- a/tox.ini +++ b/tox.ini @@ -291,49 +291,35 @@ setenv = {[testenv:py27-oldest]setenv} [testenv:azure-test-farm-tests-base] changedir = tests/letstest -commands = - ./azure-setup.sh deps = -rtests/letstest/requirements.txt passenv = AWS_* - SYSTEM_DEFAULTWORKINGDIRECTORY - BUILD_SOURCEBRANCHNAME - FARMTEST_SECURE_KEY - FARMTEST_SECURE_IV setenv = AWS_DEFAULT_REGION=us-east-1 [testenv:azure-test-farm-apache2] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = - {[testenv:azure-test-farm-tests-base]commands} - python multitester.py apache2_targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +commands = python multitester.py apache2_targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --path {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-leauto-upgrades] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = - {[testenv:azure-test-farm-tests-base]commands} - python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --path {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-certonly-standalone] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = - {[testenv:azure-test-farm-tests-base]commands} - python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --path {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-sdists] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = - {[testenv:azure-test-farm-tests-base]commands} - python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --repo {env:SYSTEM_DEFAULTWORKINGDIRECTORY} --branch {env:BUILD_SOURCEBRANCHNAME} +commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --path {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} From 4d5b83afc8ea8eaa8b37c14573e0e88aa6bfd01a Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 21:51:06 +0200 Subject: [PATCH 114/172] Fix snap name --- snap/snapcraft.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index f3efea88c..14c1fc9e7 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -1,4 +1,4 @@ -name: adferrand-certbot +name: certbot summary: Automatically configure HTTPS using Let's Encrypt description: | The objective of Certbot, Let's Encrypt, and the ACME (Automated From 2d8c7ce4863e8e08b3a9b8cf3a3fc6e817e9781d Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 21:54:41 +0200 Subject: [PATCH 115/172] Put auth file in the right place --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 08ab619ca..f3555abf2 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -31,7 +31,7 @@ steps: secureFile: azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | - cp $(testFarmPem.secureFilePath) azure-test-farm.pem + cp $(testFarmPem.secureFilePath) tests/letstest/azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | if [[ "${TOXENV}" == *"oldest"* ]]; then From e49d6ca3c3afdee95a4f828973a314ce07097bc5 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 22:43:36 +0200 Subject: [PATCH 116/172] Prevent daemons to start upon install --- .azure-pipelines/templates/steps/tox-steps.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index f3555abf2..b65940882 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -4,6 +4,11 @@ steps: condition: startswith(variables['IMAGE_NAME'], 'macOS') displayName: Install MacOS dependencies - bash: | + sudo bash -c 'cat > /usr/sbin/policy-rc.d << EOF + #!/bin/sh + echo "All runlevel operations denied by policy" >&2 + exit 101 + EOF' sudo apt-get update sudo apt-get install -y --no-install-recommends \ python-dev \ From 54fba182bf1c49ba63ce877054fd724918992984 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sat, 27 Jun 2020 23:44:25 +0200 Subject: [PATCH 117/172] Try another fix --- .azure-pipelines/templates/steps/tox-steps.yml | 5 ----- docker-compose.yml | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index b65940882..f3555abf2 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -4,11 +4,6 @@ steps: condition: startswith(variables['IMAGE_NAME'], 'macOS') displayName: Install MacOS dependencies - bash: | - sudo bash -c 'cat > /usr/sbin/policy-rc.d << EOF - #!/bin/sh - echo "All runlevel operations denied by policy" >&2 - exit 101 - EOF' sudo apt-get update sudo apt-get install -y --no-install-recommends \ python-dev \ diff --git a/docker-compose.yml b/docker-compose.yml index 75a5b9aab..ed2d959a6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,8 +12,8 @@ services: context: . dockerfile: Dockerfile-dev ports: - - "80:80" - - "443:443" + - "8080:80" + - "4443:443" volumes: - .:/opt/certbot/src - /opt/certbot/venv From 4643f9bd2a9758cac7f4e19e72e33cfc914d69cd Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 11:02:04 +0200 Subject: [PATCH 118/172] Focus on farm tests --- .azure-pipelines/advanced-test.yml | 4 +- .../templates/jobs/extended-tests-jobs.yml | 144 +++++++++--------- 2 files changed, 74 insertions(+), 74 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 012292ef2..628937740 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -9,6 +9,6 @@ pr: none jobs: # Any addition here should be reflected in the advanced and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/jobs/standard-tests-jobs.yml +# - template: templates/jobs/standard-tests-jobs.yml - template: templates/jobs/extended-tests-jobs.yml - - template: templates/jobs/packaging-jobs.yml +# - template: templates/jobs/packaging-jobs.yml diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 1d0abbc19..7fba72193 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -6,78 +6,78 @@ jobs: - group: certbot-common strategy: matrix: - linux-py36: - PYTHON_VERSION: 3.6 - TOXENV: py36 - linux-py37: - PYTHON_VERSION: 3.7 - TOXENV: py37 - linux-py37-nopin: - PYTHON_VERSION: 3.7 - TOXENV: py37 - CERTBOT_NO_PIN: 1 - linux-boulder-v1-integration-certbot: - TOXENV: integration-certbot-oldest - ACME_SERVER: boulder-v1 - linux-boulder-v2-integration-certbot: - TOXENV: integration-certbot-oldest - ACME_SERVER: boulder-v2 - linux-boulder-v1-integration-nginx: - TOXENV: integration-nginx-oldest - ACME_SERVER: boulder-v1 - linux-boulder-v2-integration-nginx: - TOXENV: integration-nginx-oldest - ACME_SERVER: boulder-v2 - linux-boulder-v1-py27-integration: - PYTHON_VERSION: 2.7 - TOXENV: integration - ACME_SERVER: boulder-v1 - linux-boulder-v2-py27-integration: - PYTHON_VERSION: 2.7 - TOXENV: integration - ACME_SERVER: boulder-v2 - linux-boulder-v1-py35-integration: - PYTHON_VERSION: 3.5 - TOXENV: integration - ACME_SERVER: boulder-v1 - linux-boulder-v2-py35-integration: - PYTHON_VERSION: 3.5 - TOXENV: integration - ACME_SERVER: boulder-v2 - linux-boulder-v1-py36-integration: - PYTHON_VERSION: 3.6 - TOXENV: integration - ACME_SERVER: boulder-v1 - linux-boulder-v2-py36-integration: - PYTHON_VERSION: 3.6 - TOXENV: integration - ACME_SERVER: boulder-v2 - linux-boulder-v1-py37-integration: - PYTHON_VERSION: 3.7 - TOXENV: integration - ACME_SERVER: boulder-v1 - linux-boulder-v2-py37-integration: - PYTHON_VERSION: 3.7 - TOXENV: integration - ACME_SERVER: boulder-v2 - linux-boulder-v1-py38-integration: - PYTHON_VERSION: 3.8 - TOXENV: integration - ACME_SERVER: boulder-v1 - linux-boulder-v2-py38-integration: - PYTHON_VERSION: 3.8 - TOXENV: integration - ACME_SERVER: boulder-v2 - nginx-compat: - TOXENV: nginx_compat - le-auto-jessie: - TOXENV: le_auto_jessie - le-auto-centos6: - TOXENV: le_auto_centos6 - le-auto-oraclelinux6: - TOXENV: le_auto_oraclelinux6 - dev: - TOXENV: docker_dev +# linux-py36: +# PYTHON_VERSION: 3.6 +# TOXENV: py36 +# linux-py37: +# PYTHON_VERSION: 3.7 +# TOXENV: py37 +# linux-py37-nopin: +# PYTHON_VERSION: 3.7 +# TOXENV: py37 +# CERTBOT_NO_PIN: 1 +# linux-boulder-v1-integration-certbot: +# TOXENV: integration-certbot-oldest +# ACME_SERVER: boulder-v1 +# linux-boulder-v2-integration-certbot: +# TOXENV: integration-certbot-oldest +# ACME_SERVER: boulder-v2 +# linux-boulder-v1-integration-nginx: +# TOXENV: integration-nginx-oldest +# ACME_SERVER: boulder-v1 +# linux-boulder-v2-integration-nginx: +# TOXENV: integration-nginx-oldest +# ACME_SERVER: boulder-v2 +# linux-boulder-v1-py27-integration: +# PYTHON_VERSION: 2.7 +# TOXENV: integration +# ACME_SERVER: boulder-v1 +# linux-boulder-v2-py27-integration: +# PYTHON_VERSION: 2.7 +# TOXENV: integration +# ACME_SERVER: boulder-v2 +# linux-boulder-v1-py35-integration: +# PYTHON_VERSION: 3.5 +# TOXENV: integration +# ACME_SERVER: boulder-v1 +# linux-boulder-v2-py35-integration: +# PYTHON_VERSION: 3.5 +# TOXENV: integration +# ACME_SERVER: boulder-v2 +# linux-boulder-v1-py36-integration: +# PYTHON_VERSION: 3.6 +# TOXENV: integration +# ACME_SERVER: boulder-v1 +# linux-boulder-v2-py36-integration: +# PYTHON_VERSION: 3.6 +# TOXENV: integration +# ACME_SERVER: boulder-v2 +# linux-boulder-v1-py37-integration: +# PYTHON_VERSION: 3.7 +# TOXENV: integration +# ACME_SERVER: boulder-v1 +# linux-boulder-v2-py37-integration: +# PYTHON_VERSION: 3.7 +# TOXENV: integration +# ACME_SERVER: boulder-v2 +# linux-boulder-v1-py38-integration: +# PYTHON_VERSION: 3.8 +# TOXENV: integration +# ACME_SERVER: boulder-v1 +# linux-boulder-v2-py38-integration: +# PYTHON_VERSION: 3.8 +# TOXENV: integration +# ACME_SERVER: boulder-v2 +# nginx-compat: +# TOXENV: nginx_compat +# le-auto-jessie: +# TOXENV: le_auto_jessie +# le-auto-centos6: +# TOXENV: le_auto_centos6 +# le-auto-oraclelinux6: +# TOXENV: le_auto_oraclelinux6 +# dev: +# TOXENV: docker_dev farmtest-apache2: PYTHON_VERSION: 3.7 TOXENV: azure-test-farm-apache2 From 43069a9ed5b9ac5323c3a66da3e18de945774f9c Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 11:02:47 +0200 Subject: [PATCH 119/172] Explicit non existent file --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index f3555abf2..0c820724f 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -28,7 +28,7 @@ steps: - task: DownloadSecureFile@1 name: testFarmPem inputs: - secureFile: azure-test-farm.pem + secureFile: azure-test-farm.pem-nonexistent condition: contains(variables['TOXENV'], 'test-farm') - bash: | cp $(testFarmPem.secureFilePath) tests/letstest/azure-test-farm.pem From 4ce6122e3ef2f1fbc253ae49dd379a8a5ee19564 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 11:04:36 +0200 Subject: [PATCH 120/172] Stat --- .azure-pipelines/templates/steps/tox-steps.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 0c820724f..30d879b81 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -28,12 +28,13 @@ steps: - task: DownloadSecureFile@1 name: testFarmPem inputs: - secureFile: azure-test-farm.pem-nonexistent + secureFile: azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | cp $(testFarmPem.secureFilePath) tests/letstest/azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | + stat tests/letstest/azure-test-farm.pem if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh else From eda44c3bf316b1fc1939d5258b7a7fdaf27ba71b Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 11:07:56 +0200 Subject: [PATCH 121/172] Audit network --- .azure-pipelines/templates/steps/tox-steps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 30d879b81..ff2c438cc 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -35,6 +35,7 @@ steps: condition: contains(variables['TOXENV'], 'test-farm') - bash: | stat tests/letstest/azure-test-farm.pem + netstat -plnt if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh else From e236dd835860a73e7762f2b0c610ba7e41b91cf0 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 11:10:59 +0200 Subject: [PATCH 122/172] Audit network root --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index ff2c438cc..4e0c7cc5d 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -35,7 +35,7 @@ steps: condition: contains(variables['TOXENV'], 'test-farm') - bash: | stat tests/letstest/azure-test-farm.pem - netstat -plnt + sudo netstat -antlp if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh else From 0798b29efe4e99e8c23351334292d19fe5836697 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 11:17:23 +0200 Subject: [PATCH 123/172] Stop nginx --- .azure-pipelines/templates/steps/tox-steps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 4e0c7cc5d..89ec72f46 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -15,6 +15,7 @@ steps: nginx-light \ openssl \ expect + sudo systemctl stop nginx condition: startswith(variables['IMAGE_NAME'], 'ubuntu') displayName: Install Linux dependencies - task: UsePythonVersion@0 From 28bfcf77c758f5f218dbf8e8165974a9cd9a6f3d Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 11:21:37 +0200 Subject: [PATCH 124/172] Default ports --- .azure-pipelines/templates/steps/tox-steps.yml | 2 -- docker-compose.yml | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 89ec72f46..23427f2b2 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -35,8 +35,6 @@ steps: cp $(testFarmPem.secureFilePath) tests/letstest/azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | - stat tests/letstest/azure-test-farm.pem - sudo netstat -antlp if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh else diff --git a/docker-compose.yml b/docker-compose.yml index ed2d959a6..75a5b9aab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,8 +12,8 @@ services: context: . dockerfile: Dockerfile-dev ports: - - "8080:80" - - "4443:443" + - "80:80" + - "443:443" volumes: - .:/opt/certbot/src - /opt/certbot/venv From d867193d77c3108e670f1e2a873b6e17bb56f17c Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 13:01:11 +0200 Subject: [PATCH 125/172] Explicit keyname --- tests/letstest/multitester.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/letstest/multitester.py b/tests/letstest/multitester.py index 504676368..eade6b125 100644 --- a/tests/letstest/multitester.py +++ b/tests/letstest/multitester.py @@ -95,7 +95,8 @@ cl_args = parser.parse_args() #------------------------------------------------------------------------------- # assumes naming: = .pem KEYFILE = cl_args.key_file -KEYNAME = os.path.split(cl_args.key_file)[1].split('.pem')[0] +#KEYNAME = os.path.split(cl_args.key_file)[1].split('.pem')[0] +KEYNAME = 'travis-test-farm' PROFILE = None if cl_args.aws_profile == 'SET_BY_ENV' else cl_args.aws_profile # Globals From 3eecd7154682888662d7771db58731ca8cc34213 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 19:33:07 +0200 Subject: [PATCH 126/172] Add env variables for farm tests --- .azure-pipelines/templates/steps/tox-steps.yml | 3 +++ tests/letstest/multitester.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 23427f2b2..51684d9be 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -40,4 +40,7 @@ steps: else python -m tox fi + env: + AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) + AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) displayName: Run tox diff --git a/tests/letstest/multitester.py b/tests/letstest/multitester.py index eade6b125..504676368 100644 --- a/tests/letstest/multitester.py +++ b/tests/letstest/multitester.py @@ -95,8 +95,7 @@ cl_args = parser.parse_args() #------------------------------------------------------------------------------- # assumes naming: = .pem KEYFILE = cl_args.key_file -#KEYNAME = os.path.split(cl_args.key_file)[1].split('.pem')[0] -KEYNAME = 'travis-test-farm' +KEYNAME = os.path.split(cl_args.key_file)[1].split('.pem')[0] PROFILE = None if cl_args.aws_profile == 'SET_BY_ENV' else cl_args.aws_profile # Globals From a244d1798625230d255d14e7d942cc146ba8f33e Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 19:51:05 +0200 Subject: [PATCH 127/172] Test failure --- .azure-pipelines/advanced-test.yml | 18 ++++++++++++------ .azure-pipelines/templates/steps/tox-steps.yml | 1 + 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 628937740..559cf5787 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -6,9 +6,15 @@ trigger: - test-* pr: none -jobs: - # Any addition here should be reflected in the advanced and release pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. -# - template: templates/jobs/standard-tests-jobs.yml - - template: templates/jobs/extended-tests-jobs.yml -# - template: templates/jobs/packaging-jobs.yml +stages: + - stage: Test_Package + jobs: + # Any addition here should be reflected in the advanced-test and release pipelines. + # It is advised to declare all jobs here as templates to improve maintainability. + # - template: templates/jobs/standard-tests-jobs.yml + - template: templates/jobs/extended-tests-jobs.yml + # - template: templates/jobs/packaging-jobs.yml +# - stage: Deploy +# jobs: +# - template: templates/jobs/deployment-jobs.yml + - template: templates/stages/notify-failure-stage.yml diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 51684d9be..3b8646cdf 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -35,6 +35,7 @@ steps: cp $(testFarmPem.secureFilePath) tests/letstest/azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | + exit 1 if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh else From 3aafcd796a8e2d7177049555e64b6daee481bef9 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 19:55:44 +0200 Subject: [PATCH 128/172] Fix interpolation of the message --- .azure-pipelines/templates/stages/notify-failure-stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/stages/notify-failure-stage.yml b/.azure-pipelines/templates/stages/notify-failure-stage.yml index 75a812c91..91de3d2c4 100644 --- a/.azure-pipelines/templates/stages/notify-failure-stage.yml +++ b/.azure-pipelines/templates/stages/notify-failure-stage.yml @@ -9,5 +9,5 @@ stages: steps: - bash: | MESSAGE="---\n##### Azure Pipeline - Pipeline: $(Build.DefinitionName) - Build: $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---" - curl -i -X POST --data-urlencode 'payload={"text":"${MESSAGE}"}' "$(MATTERMOST_URL)" + curl -i -X POST --data-urlencode "payload={\"text\":\"${MESSAGE}\"}" "$(MATTERMOST_URL)" condition: failed() From 122f3d1832e0ec4f9c59a845842eb1ef1f81f5e7 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 20:47:45 +0200 Subject: [PATCH 129/172] Improve message --- .azure-pipelines/templates/stages/notify-failure-stage.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/stages/notify-failure-stage.yml b/.azure-pipelines/templates/stages/notify-failure-stage.yml index 91de3d2c4..9a7f8b1fc 100644 --- a/.azure-pipelines/templates/stages/notify-failure-stage.yml +++ b/.azure-pipelines/templates/stages/notify-failure-stage.yml @@ -8,6 +8,11 @@ stages: vmImage: ubuntu-latest steps: - bash: | - MESSAGE="---\n##### Azure Pipeline - Pipeline: $(Build.DefinitionName) - Build: $(Build.BuildId)\n:warning: __[Build has failed](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)__ :warning:\n\n---" + MESSAGE="\ + ---\n\ + ##### Azure Pipeline + *Repo* $(Build.Repository.ID) - *Pipeline* $(Build.DefinitionName) #$(Build.BuildNumber) - *Branch/PR* $(Build.SourceBranchName)\n\ + :warning: __Pipeline has failed__: [Link to the build](https://dev.azure.com/$(Build.Repository.ID)/_build/results?buildId=$(Build.BuildId)&view=results)\n\n\ + ---" curl -i -X POST --data-urlencode "payload={\"text\":\"${MESSAGE}\"}" "$(MATTERMOST_URL)" condition: failed() From ee4e6b35401c28b438934a25de6f63402333d817 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 21:02:23 +0200 Subject: [PATCH 130/172] Revert "Test failure" This reverts commit a244d1798625230d255d14e7d942cc146ba8f33e. --- .azure-pipelines/advanced-test.yml | 18 ++++++------------ .azure-pipelines/templates/steps/tox-steps.yml | 1 - 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 559cf5787..628937740 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -6,15 +6,9 @@ trigger: - test-* pr: none -stages: - - stage: Test_Package - jobs: - # Any addition here should be reflected in the advanced-test and release pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - # - template: templates/jobs/standard-tests-jobs.yml - - template: templates/jobs/extended-tests-jobs.yml - # - template: templates/jobs/packaging-jobs.yml -# - stage: Deploy -# jobs: -# - template: templates/jobs/deployment-jobs.yml - - template: templates/stages/notify-failure-stage.yml +jobs: + # Any addition here should be reflected in the advanced and release pipelines. + # It is advised to declare all jobs here as templates to improve maintainability. +# - template: templates/jobs/standard-tests-jobs.yml + - template: templates/jobs/extended-tests-jobs.yml +# - template: templates/jobs/packaging-jobs.yml diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 3b8646cdf..51684d9be 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -35,7 +35,6 @@ steps: cp $(testFarmPem.secureFilePath) tests/letstest/azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | - exit 1 if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh else From 916452f7906be6eab4b9970b856461fb42f5fece Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 21:03:53 +0200 Subject: [PATCH 131/172] Reactivate everything --- .azure-pipelines/advanced-test.yml | 4 +- .azure-pipelines/advanced.yml | 6 +- .../templates/jobs/extended-tests-jobs.yml | 144 +++++++++--------- .../templates/steps/tox-steps.yml | 2 +- 4 files changed, 78 insertions(+), 78 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 628937740..012292ef2 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -9,6 +9,6 @@ pr: none jobs: # Any addition here should be reflected in the advanced and release pipelines. # It is advised to declare all jobs here as templates to improve maintainability. -# - template: templates/jobs/standard-tests-jobs.yml + - template: templates/jobs/standard-tests-jobs.yml - template: templates/jobs/extended-tests-jobs.yml -# - template: templates/jobs/packaging-jobs.yml + - template: templates/jobs/packaging-jobs.yml diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index b029f9d54..5ee31d55d 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -19,7 +19,7 @@ stages: - template: templates/jobs/standard-tests-jobs.yml - template: templates/jobs/extended-tests-jobs.yml - template: templates/jobs/packaging-jobs.yml -# - stage: Deploy -# jobs: -# - template: templates/jobs/deployment-jobs.yml + - stage: Deploy + jobs: + - template: templates/jobs/deployment-jobs.yml - template: templates/stages/notify-failure-stage.yml diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 7fba72193..1d0abbc19 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -6,78 +6,78 @@ jobs: - group: certbot-common strategy: matrix: -# linux-py36: -# PYTHON_VERSION: 3.6 -# TOXENV: py36 -# linux-py37: -# PYTHON_VERSION: 3.7 -# TOXENV: py37 -# linux-py37-nopin: -# PYTHON_VERSION: 3.7 -# TOXENV: py37 -# CERTBOT_NO_PIN: 1 -# linux-boulder-v1-integration-certbot: -# TOXENV: integration-certbot-oldest -# ACME_SERVER: boulder-v1 -# linux-boulder-v2-integration-certbot: -# TOXENV: integration-certbot-oldest -# ACME_SERVER: boulder-v2 -# linux-boulder-v1-integration-nginx: -# TOXENV: integration-nginx-oldest -# ACME_SERVER: boulder-v1 -# linux-boulder-v2-integration-nginx: -# TOXENV: integration-nginx-oldest -# ACME_SERVER: boulder-v2 -# linux-boulder-v1-py27-integration: -# PYTHON_VERSION: 2.7 -# TOXENV: integration -# ACME_SERVER: boulder-v1 -# linux-boulder-v2-py27-integration: -# PYTHON_VERSION: 2.7 -# TOXENV: integration -# ACME_SERVER: boulder-v2 -# linux-boulder-v1-py35-integration: -# PYTHON_VERSION: 3.5 -# TOXENV: integration -# ACME_SERVER: boulder-v1 -# linux-boulder-v2-py35-integration: -# PYTHON_VERSION: 3.5 -# TOXENV: integration -# ACME_SERVER: boulder-v2 -# linux-boulder-v1-py36-integration: -# PYTHON_VERSION: 3.6 -# TOXENV: integration -# ACME_SERVER: boulder-v1 -# linux-boulder-v2-py36-integration: -# PYTHON_VERSION: 3.6 -# TOXENV: integration -# ACME_SERVER: boulder-v2 -# linux-boulder-v1-py37-integration: -# PYTHON_VERSION: 3.7 -# TOXENV: integration -# ACME_SERVER: boulder-v1 -# linux-boulder-v2-py37-integration: -# PYTHON_VERSION: 3.7 -# TOXENV: integration -# ACME_SERVER: boulder-v2 -# linux-boulder-v1-py38-integration: -# PYTHON_VERSION: 3.8 -# TOXENV: integration -# ACME_SERVER: boulder-v1 -# linux-boulder-v2-py38-integration: -# PYTHON_VERSION: 3.8 -# TOXENV: integration -# ACME_SERVER: boulder-v2 -# nginx-compat: -# TOXENV: nginx_compat -# le-auto-jessie: -# TOXENV: le_auto_jessie -# le-auto-centos6: -# TOXENV: le_auto_centos6 -# le-auto-oraclelinux6: -# TOXENV: le_auto_oraclelinux6 -# dev: -# TOXENV: docker_dev + linux-py36: + PYTHON_VERSION: 3.6 + TOXENV: py36 + linux-py37: + PYTHON_VERSION: 3.7 + TOXENV: py37 + linux-py37-nopin: + PYTHON_VERSION: 3.7 + TOXENV: py37 + CERTBOT_NO_PIN: 1 + linux-boulder-v1-integration-certbot: + TOXENV: integration-certbot-oldest + ACME_SERVER: boulder-v1 + linux-boulder-v2-integration-certbot: + TOXENV: integration-certbot-oldest + ACME_SERVER: boulder-v2 + linux-boulder-v1-integration-nginx: + TOXENV: integration-nginx-oldest + ACME_SERVER: boulder-v1 + linux-boulder-v2-integration-nginx: + TOXENV: integration-nginx-oldest + ACME_SERVER: boulder-v2 + linux-boulder-v1-py27-integration: + PYTHON_VERSION: 2.7 + TOXENV: integration + ACME_SERVER: boulder-v1 + linux-boulder-v2-py27-integration: + PYTHON_VERSION: 2.7 + TOXENV: integration + ACME_SERVER: boulder-v2 + linux-boulder-v1-py35-integration: + PYTHON_VERSION: 3.5 + TOXENV: integration + ACME_SERVER: boulder-v1 + linux-boulder-v2-py35-integration: + PYTHON_VERSION: 3.5 + TOXENV: integration + ACME_SERVER: boulder-v2 + linux-boulder-v1-py36-integration: + PYTHON_VERSION: 3.6 + TOXENV: integration + ACME_SERVER: boulder-v1 + linux-boulder-v2-py36-integration: + PYTHON_VERSION: 3.6 + TOXENV: integration + ACME_SERVER: boulder-v2 + linux-boulder-v1-py37-integration: + PYTHON_VERSION: 3.7 + TOXENV: integration + ACME_SERVER: boulder-v1 + linux-boulder-v2-py37-integration: + PYTHON_VERSION: 3.7 + TOXENV: integration + ACME_SERVER: boulder-v2 + linux-boulder-v1-py38-integration: + PYTHON_VERSION: 3.8 + TOXENV: integration + ACME_SERVER: boulder-v1 + linux-boulder-v2-py38-integration: + PYTHON_VERSION: 3.8 + TOXENV: integration + ACME_SERVER: boulder-v2 + nginx-compat: + TOXENV: nginx_compat + le-auto-jessie: + TOXENV: le_auto_jessie + le-auto-centos6: + TOXENV: le_auto_centos6 + le-auto-oraclelinux6: + TOXENV: le_auto_oraclelinux6 + dev: + TOXENV: docker_dev farmtest-apache2: PYTHON_VERSION: 3.7 TOXENV: azure-test-farm-apache2 diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 51684d9be..7d43126f5 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -32,7 +32,7 @@ steps: secureFile: azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | - cp $(testFarmPem.secureFilePath) tests/letstest/azure-test-farm.pem + ln -s $(testFarmPem.secureFilePath) tests/letstest/azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | if [[ "${TOXENV}" == *"oldest"* ]]; then From 4dcb7ad7b773b333f7b2afae20e86174ae7e7303 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 22:01:33 +0200 Subject: [PATCH 132/172] Smarter build of oldest tests --- tools/run_oldest_tests.sh | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/tools/run_oldest_tests.sh b/tools/run_oldest_tests.sh index 259df3a4b..0dad46928 100755 --- a/tools/run_oldest_tests.sh +++ b/tools/run_oldest_tests.sh @@ -12,29 +12,28 @@ function cleanup() { trap cleanup EXIT -SCRIPT=$(mktemp /tmp/test-script.XXXXXX) -chmod +x "${SCRIPT}" +DOCKERFILE=$(mktemp /tmp/Dockerfile.XXXXXX) -cat << "EOF" >> "${SCRIPT}" -#!/bin/bash -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 software-properties-common -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BB92C09DB82666C -add-apt-repository ppa:fkrull/deadsnakes-python2.7 -apt-get update -apt-get upgrade -y -sh <(curl -fsSL https://get.docker.com) -python -m pip install --upgrade pip virtualenv wheel -python -m pip install tox -python -m tox +cat << "EOF" >> "${DOCKERFILE}" +FROM ubuntu:14.04 +RUN 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 software-properties-common \ + && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BB92C09DB82666C \ + && add-apt-repository ppa:fkrull/deadsnakes-python2.7 \ + && apt-get update \ + && apt-get upgrade -y \ + && curl -fsSL https://get.docker.com | bash /dev/stdin \ + && python -m pip install --upgrade pip virtualenv wheel \ + && python -m pip install tox \ + && rm -rf /var/lib/apt/lists/* EOF +docker build -f "${DOCKERFILE}" -t oldest-worker "${DIR}" docker run --rm --network=host -w "${PWD}" \ -v /var/run/docker.sock:/var/run/docker.sock \ -v "${PWD}:${PWD}" -v "${SCRIPT}:/script.sh" \ -v /tmp:/tmp \ -e TOXENV -e ACME_SERVER -e PYTEST_ADDOPTS \ - ubuntu:14.04 /script.sh + oldest-worker python -m tox From 6a41063a5b35e3193ed8885143488de9a262a1cc Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 22:40:59 +0200 Subject: [PATCH 133/172] Move oldest tests to Xenial, and use pipstrap to stabilize the env --- acme/setup.py | 4 ++-- tools/oldest_constraints.txt | 2 +- tools/run_oldest_tests.sh | 16 +++++++--------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/acme/setup.py b/acme/setup.py index 3d0cbf126..b42c4d451 100644 --- a/acme/setup.py +++ b/acme/setup.py @@ -17,8 +17,8 @@ install_requires = [ # 1.1.0+ is required to avoid the warnings described at # https://github.com/certbot/josepy/issues/13. 'josepy>=1.1.0', - # Connection.set_tlsext_host_name (>=0.13) - 'PyOpenSSL>=0.13.1', + # Connection.set_tlsext_host_name (>=0.13) + matching Xenial requirements (>=0.15.1) + 'PyOpenSSL>=0.15.1', 'pyrfc3339', 'pytz', 'requests[security]>=2.6.0', # security extras added in 2.4.1 diff --git a/tools/oldest_constraints.txt b/tools/oldest_constraints.txt index 402f3fef1..ff4b8361a 100644 --- a/tools/oldest_constraints.txt +++ b/tools/oldest_constraints.txt @@ -12,7 +12,6 @@ ndg-httpsclient==0.3.2 ply==3.4 pyasn1==0.1.9 pycparser==2.14 -pyOpenSSL==0.13.1 pyRFC3339==1.0 python-augeas==0.5.0 oauth2client==4.0.0 @@ -49,6 +48,7 @@ requests[security]==2.6.0 # Ubuntu Xenial constraints ConfigArgParse==0.10.0 +pyOpenSSL==0.15.1 funcsigs==0.4 zope.hookable==4.0.4 diff --git a/tools/run_oldest_tests.sh b/tools/run_oldest_tests.sh index 0dad46928..7f27e9a79 100755 --- a/tools/run_oldest_tests.sh +++ b/tools/run_oldest_tests.sh @@ -15,22 +15,20 @@ trap cleanup EXIT DOCKERFILE=$(mktemp /tmp/Dockerfile.XXXXXX) cat << "EOF" >> "${DOCKERFILE}" -FROM ubuntu:14.04 +FROM ubuntu:16.04 +COPY pipstrap.py /tmp/pipstrap.py RUN 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 software-properties-common \ - && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5BB92C09DB82666C \ - && add-apt-repository ppa:fkrull/deadsnakes-python2.7 \ - && apt-get update \ - && apt-get upgrade -y \ + python-dev python-pip python-setuptools \ + gcc libaugeas0 libssl-dev libffi-dev \ + git ca-certificates nginx-light openssl curl \ && curl -fsSL https://get.docker.com | bash /dev/stdin \ - && python -m pip install --upgrade pip virtualenv wheel \ + && python /tmp/pipstrap.py \ && python -m pip install tox \ && rm -rf /var/lib/apt/lists/* EOF -docker build -f "${DOCKERFILE}" -t oldest-worker "${DIR}" +docker build -f "${DOCKERFILE}" -t oldest-worker ./letsencrypt-auto-source/pieces docker run --rm --network=host -w "${PWD}" \ -v /var/run/docker.sock:/var/run/docker.sock \ -v "${PWD}:${PWD}" -v "${SCRIPT}:/script.sh" \ From 04cda0e761c627c5378db4ed14fac999461ae405 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Sun, 28 Jun 2020 23:22:59 +0200 Subject: [PATCH 134/172] Split oldest tests --- .azure-pipelines/templates/jobs/standard-tests-jobs.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml index 9eb77db78..70d4a57d4 100644 --- a/.azure-pipelines/templates/jobs/standard-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/standard-tests-jobs.yml @@ -22,9 +22,12 @@ jobs: IMAGE_NAME: vs2017-win2016 PYTHON_VERSION: 3.7 TOXENV: integration-certbot - linux-oldest-tests: + linux-oldest-tests-1: IMAGE_NAME: ubuntu-18.04 - TOXENV: py27-{acme,apache,apache-v2,certbot,dns,nginx}-oldest + TOXENV: py27-{acme,apache,apache-v2,certbot}-oldest + linux-oldest-tests-2: + IMAGE_NAME: ubuntu-18.04 + TOXENV: py27-{dns,nginx}-oldest linux-py27: IMAGE_NAME: ubuntu-18.04 PYTHON_VERSION: 2.7 From 9bdd9b816c7b94a981d3cc87434e0f3e39d04a01 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 11:18:20 +0200 Subject: [PATCH 135/172] Reorganize pipelines to refer to unitary stages --- .azure-pipelines/advanced-test.yml | 8 ++--- .azure-pipelines/advanced.yml | 12 ++----- .azure-pipelines/release.yml | 14 ++------ .../templates/jobs/changelog-jobs.yml | 14 -------- .../templates/jobs/deployment-jobs.yml | 34 ------------------ .../templates/stages/changelog-stage.yml | 16 +++++++++ .../templates/stages/deploy-stage.yml | 36 +++++++++++++++++++ .../stages/test-and-package-stage.yml | 6 ++++ 8 files changed, 65 insertions(+), 75 deletions(-) delete mode 100644 .azure-pipelines/templates/jobs/changelog-jobs.yml delete mode 100644 .azure-pipelines/templates/jobs/deployment-jobs.yml create mode 100644 .azure-pipelines/templates/stages/changelog-stage.yml create mode 100644 .azure-pipelines/templates/stages/deploy-stage.yml create mode 100644 .azure-pipelines/templates/stages/test-and-package-stage.yml diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 012292ef2..109f31ac2 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -6,9 +6,5 @@ trigger: - test-* pr: none -jobs: - # Any addition here should be reflected in the advanced and release pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/jobs/standard-tests-jobs.yml - - template: templates/jobs/extended-tests-jobs.yml - - template: templates/jobs/packaging-jobs.yml +stages: + - template: templates/stages/test-and-package-stage.yml diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/advanced.yml index 5ee31d55d..12b290120 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/advanced.yml @@ -12,14 +12,6 @@ schedules: always: true stages: - - stage: Test_Package - jobs: - # Any addition here should be reflected in the advanced-test and release pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/jobs/standard-tests-jobs.yml - - template: templates/jobs/extended-tests-jobs.yml - - template: templates/jobs/packaging-jobs.yml - - stage: Deploy - jobs: - - template: templates/jobs/deployment-jobs.yml + - template: templates/stages/test-and-package-stage.yml + - template: templates/stages/deploy-stage.yml - template: templates/stages/notify-failure-stage.yml diff --git a/.azure-pipelines/release.yml b/.azure-pipelines/release.yml index ada93f266..8520d5f49 100644 --- a/.azure-pipelines/release.yml +++ b/.azure-pipelines/release.yml @@ -6,15 +6,7 @@ trigger: pr: none stages: - - stage: Test_Package - jobs: - # Any addition here should be reflected in the advanced and advanced-test pipelines. - # It is advised to declare all jobs here as templates to improve maintainability. - - template: templates/jobs/standard-tests-jobs.yml - - template: templates/jobs/extended-tests-jobs.yml - - template: templates/jobs/packaging-jobs.yml - - template: templates/jobs/changelog-jobs.yml - - stage: Deploy - jobs: - - template: templates/jobs/deployment-jobs.yml + - template: templates/stages/test-and-package-stage.yml + - template: templates/stages/changelog-stage.yml + - template: templates/stages/deploy-stage.yml - template: templates/stages/notify-failure-stage.yml diff --git a/.azure-pipelines/templates/jobs/changelog-jobs.yml b/.azure-pipelines/templates/jobs/changelog-jobs.yml deleted file mode 100644 index 4a65e2c2b..000000000 --- a/.azure-pipelines/templates/jobs/changelog-jobs.yml +++ /dev/null @@ -1,14 +0,0 @@ -jobs: - - job: changelog - pool: - vmImage: vs2017-win2016 - steps: - - bash: | - CERTBOT_VERSION="$(cd certbot && python -c "import certbot; print(certbot.__version__)" && cd ~-)" - "${BUILD_REPOSITORY_LOCALPATH}\tools\extract_changelog.py" "${CERTBOT_VERSION}" >> "${BUILD_ARTIFACTSTAGINGDIRECTORY}/release_notes.md" - displayName: Prepare changelog - - task: PublishPipelineArtifact@1 - inputs: - path: $(Build.ArtifactStagingDirectory) - artifact: changelog - displayName: Publish changelog diff --git a/.azure-pipelines/templates/jobs/deployment-jobs.yml b/.azure-pipelines/templates/jobs/deployment-jobs.yml deleted file mode 100644 index 69148a3dc..000000000 --- a/.azure-pipelines/templates/jobs/deployment-jobs.yml +++ /dev/null @@ -1,34 +0,0 @@ -jobs: - - job: publish_snap - strategy: - matrix: - amd64: - ARCH: amd64 - arm64: - ARCH: arm64 - armhf: - ARCH: armhf - pool: - vmImage: ubuntu-18.04 - variables: - - group: certbot-common - steps: - - bash: | - sudo apt-get update - sudo apt-get install -y --no-install-recommends snap - sudo snap install --classic snapcraft - displayName: Install dependencies - - task: DownloadPipelineArtifact@2 - inputs: - artifact: snap-$(arch) - path: $(Build.SourcesDirectory)/snap - displayName: Retrieve Certbot snap - - task: DownloadSecureFile@1 - name: snapcraftCfg - inputs: - secureFile: snapcraft.cfg - - bash: | - mkdir -p .snapcraft - ln -s $(snapcraftCfg.secureFilePath) .snapcraft/snapcraft.cfg - snapcraft push --release=edge snap/*.snap - displayName: Publish to Snap store diff --git a/.azure-pipelines/templates/stages/changelog-stage.yml b/.azure-pipelines/templates/stages/changelog-stage.yml new file mode 100644 index 000000000..ca4cad47b --- /dev/null +++ b/.azure-pipelines/templates/stages/changelog-stage.yml @@ -0,0 +1,16 @@ +stages: + - stage: Changelog + jobs: + - job: prepare + pool: + vmImage: vs2017-win2016 + steps: + - bash: | + CERTBOT_VERSION="$(cd certbot && python -c "import certbot; print(certbot.__version__)" && cd ~-)" + "${BUILD_REPOSITORY_LOCALPATH}\tools\extract_changelog.py" "${CERTBOT_VERSION}" >> "${BUILD_ARTIFACTSTAGINGDIRECTORY}/release_notes.md" + displayName: Prepare changelog + - task: PublishPipelineArtifact@1 + inputs: + path: $(Build.ArtifactStagingDirectory) + artifact: changelog + displayName: Publish changelog diff --git a/.azure-pipelines/templates/stages/deploy-stage.yml b/.azure-pipelines/templates/stages/deploy-stage.yml new file mode 100644 index 000000000..8e78b5e52 --- /dev/null +++ b/.azure-pipelines/templates/stages/deploy-stage.yml @@ -0,0 +1,36 @@ +stages: + - stage: Deploy + jobs: + - job: publish_snap + strategy: + matrix: + amd64: + ARCH: amd64 + arm64: + ARCH: arm64 + armhf: + ARCH: armhf + pool: + vmImage: ubuntu-18.04 + variables: + - group: certbot-common + steps: + - bash: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends snap + sudo snap install --classic snapcraft + displayName: Install dependencies + - task: DownloadPipelineArtifact@2 + inputs: + artifact: snap-$(arch) + path: $(Build.SourcesDirectory)/snap + displayName: Retrieve Certbot snap + - task: DownloadSecureFile@1 + name: snapcraftCfg + inputs: + secureFile: snapcraft.cfg + - bash: | + mkdir -p .snapcraft + ln -s $(snapcraftCfg.secureFilePath) .snapcraft/snapcraft.cfg + snapcraft push --release=edge snap/*.snap + displayName: Publish to Snap store diff --git a/.azure-pipelines/templates/stages/test-and-package-stage.yml b/.azure-pipelines/templates/stages/test-and-package-stage.yml new file mode 100644 index 000000000..b46a6d679 --- /dev/null +++ b/.azure-pipelines/templates/stages/test-and-package-stage.yml @@ -0,0 +1,6 @@ +stages: + - stage: TestAndPackage + jobs: + - template: templates/jobs/standard-tests-jobs.yml + - template: templates/jobs/extended-tests-jobs.yml + - template: templates/jobs/packaging-jobs.yml From c556bb72cb6b65a5834aed3d957f932b52b53c3e Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 11:48:27 +0200 Subject: [PATCH 136/172] Update .azure-pipelines/templates/jobs/extended-tests-jobs.yml Co-authored-by: Brad Warren --- .azure-pipelines/templates/jobs/extended-tests-jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 1d0abbc19..dded4081a 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -1,5 +1,5 @@ jobs: - - job: x_test + - job: extended_test variables: - name: IMAGE_NAME value: ubuntu-18.04 From bb75444711c46d7e5c1fa0a08cd31acea45e2fbd Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 11:47:35 +0200 Subject: [PATCH 137/172] Fix snap -> snapd --- .azure-pipelines/templates/stages/deploy-stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/stages/deploy-stage.yml b/.azure-pipelines/templates/stages/deploy-stage.yml index 8e78b5e52..772faa181 100644 --- a/.azure-pipelines/templates/stages/deploy-stage.yml +++ b/.azure-pipelines/templates/stages/deploy-stage.yml @@ -17,7 +17,7 @@ stages: steps: - bash: | sudo apt-get update - sudo apt-get install -y --no-install-recommends snap + sudo apt-get install -y --no-install-recommends snapd sudo snap install --classic snapcraft displayName: Install dependencies - task: DownloadPipelineArtifact@2 From 36d6bc6c8a54fe33a23c5aa315dbc0e9a0598cd4 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 11:50:57 +0200 Subject: [PATCH 138/172] Fixes --- .azure-pipelines/templates/jobs/extended-tests-jobs.yml | 8 ++++---- snap/local/build.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index dded4081a..e1723f8a4 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -16,16 +16,16 @@ jobs: PYTHON_VERSION: 3.7 TOXENV: py37 CERTBOT_NO_PIN: 1 - linux-boulder-v1-integration-certbot: + linux-boulder-v1-integration-certbot-oldest: TOXENV: integration-certbot-oldest ACME_SERVER: boulder-v1 - linux-boulder-v2-integration-certbot: + linux-boulder-v2-integration-certbot-oldest: TOXENV: integration-certbot-oldest ACME_SERVER: boulder-v2 - linux-boulder-v1-integration-nginx: + linux-boulder-v1-integration-nginx-oldest: TOXENV: integration-nginx-oldest ACME_SERVER: boulder-v1 - linux-boulder-v2-integration-nginx: + linux-boulder-v2-integration-nginx-oldest: TOXENV: integration-nginx-oldest ACME_SERVER: boulder-v2 linux-boulder-v1-py27-integration: diff --git a/snap/local/build.sh b/snap/local/build.sh index c296246e2..bbe5ba323 100755 --- a/snap/local/build.sh +++ b/snap/local/build.sh @@ -2,7 +2,7 @@ # Cross-compile the Certbot snap from local sources for the specified architecture, # and install it if this architecture is also the the current machine one. # This script is designed for CI tests purpose. -# Usage: build_and_install.sh [amd64,arm64,armhf] +# Usage: build.sh [amd64,arm64,armhf] set -ex SNAP_ARCH=$1 From 4a941efd089f34420945e66537482ce1dbaa0a60 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 11:51:33 +0200 Subject: [PATCH 139/172] Update .azure-pipelines/templates/jobs/extended-tests-jobs.yml Co-authored-by: Brad Warren --- .azure-pipelines/templates/jobs/extended-tests-jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index e1723f8a4..51f3e2173 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -76,7 +76,7 @@ jobs: TOXENV: le_auto_centos6 le-auto-oraclelinux6: TOXENV: le_auto_oraclelinux6 - dev: + docker-dev: TOXENV: docker_dev farmtest-apache2: PYTHON_VERSION: 3.7 From 71fbcb53a104cf14be6cc832f59415ba713c4fca Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 11:54:53 +0200 Subject: [PATCH 140/172] Use not instead of coalesce --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 7d43126f5..2878ecbde 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -22,7 +22,7 @@ steps: inputs: versionSpec: $(PYTHON_VERSION) addToPath: true - condition: ne(coalesce(variables['PYTHON_VERSION'], 'UNSPECIFIED'), 'UNSPECIFIED') + condition: not(variables['PYTHON_VERSION']) - bash: | python tools/pip_install.py -I tox virtualenv displayName: Install runtime dependencies From fb6a24862045f941520c0556979c1d4576be129a Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 12:04:34 +0200 Subject: [PATCH 141/172] Try another approach --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 2878ecbde..caf9194c0 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -22,7 +22,7 @@ steps: inputs: versionSpec: $(PYTHON_VERSION) addToPath: true - condition: not(variables['PYTHON_VERSION']) + condition: not(eq(variables['PYTHON_VERSION'], '')) - bash: | python tools/pip_install.py -I tox virtualenv displayName: Install runtime dependencies From def19b3705915e57f72b520896aef8f261d25f36 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 12:09:13 +0200 Subject: [PATCH 142/172] Simplify condition --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index caf9194c0..eb155994e 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -22,7 +22,7 @@ steps: inputs: versionSpec: $(PYTHON_VERSION) addToPath: true - condition: not(eq(variables['PYTHON_VERSION'], '')) + condition: ne(variables['PYTHON_VERSION'], '') - bash: | python tools/pip_install.py -I tox virtualenv displayName: Install runtime dependencies From 70ffd68f635946f99000af195c9b2d3915d4883c Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 12:37:25 +0200 Subject: [PATCH 143/172] Improve farm tests, add comment --- .../templates/steps/tox-steps.yml | 7 +++ tests/letstest/multitester.py | 50 +++++++------------ tox.ini | 8 +-- 3 files changed, 30 insertions(+), 35 deletions(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index eb155994e..2db18ca01 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -23,6 +23,13 @@ steps: versionSpec: $(PYTHON_VERSION) addToPath: true condition: ne(variables['PYTHON_VERSION'], '') + # tools/pip_install.py is used to pin packages to a known working version + # except in tests where the environment variable CERTBOT_NO_PIN is set. + # virtualenv is listed here explicitly to make sure it is upgraded when + # CERTBOT_NO_PIN is set to work around failures we've seen when using an older + # version of virtualenv. The option "-I" is set so when CERTBOT_NO_PIN is also + # set, pip updates dependencies it thinks are already satisfied to avoid some + # problems with its lack of real dependency resolution. - bash: | python tools/pip_install.py -I tox virtualenv displayName: Install runtime dependencies diff --git a/tests/letstest/multitester.py b/tests/letstest/multitester.py index 504676368..5ed5ae549 100644 --- a/tests/letstest/multitester.py +++ b/tests/letstest/multitester.py @@ -63,8 +63,6 @@ parser.add_argument('aws_profile', parser.add_argument('test_script', default='test_letsencrypt_auto_certonly_standalone.sh', help='path of bash script in to deploy and run') -parser.add_argument('--path', - help='if set, this path will be used as the tested project instead of a remote GIT repo') parser.add_argument('--repo', default='https://github.com/letsencrypt/letsencrypt.git', help='certbot git repo to use') @@ -235,27 +233,21 @@ def block_until_instance_ready(booting_instance, wait_time=5, extra_wait_time=20 # Fabric Routines #------------------------------------------------------------------------------- -def local_copy(local_cxn, path): - """copy a local certbot workspace""" - local_cxn.local('cd %s && if [ -d /tmp/letsencrypt ]; then rm -rf /tmp/letsencrypt; fi' % LOGDIR) - local_cxn.local('cd %s && cp -a %s /tmp/letsencrypt && mv -f /tmp/letsencrypt letsencrypt' % (LOGDIR, path)) - local_cxn.local('cd %s && tar czf le.tar.gz letsencrypt' % LOGDIR) - def local_git_clone(local_cxn, repo_url): - "clones master of repo_url" + """clones master of repo_url""" local_cxn.local('cd %s && if [ -d letsencrypt ]; then rm -rf letsencrypt; fi' % LOGDIR) local_cxn.local('cd %s && git clone %s letsencrypt'% (LOGDIR, repo_url)) local_cxn.local('cd %s && tar czf le.tar.gz letsencrypt'% LOGDIR) def local_git_branch(local_cxn, repo_url, branch_name): - "clones branch of repo_url" + """clones branch of repo_url""" local_cxn.local('cd %s && if [ -d letsencrypt ]; then rm -rf letsencrypt; fi' % LOGDIR) local_cxn.local('cd %s && git clone %s letsencrypt --branch %s --single-branch'% (LOGDIR, repo_url, branch_name)) local_cxn.local('cd %s && tar czf le.tar.gz letsencrypt' % LOGDIR) def local_git_PR(local_cxn, repo_url, PRnumstr, merge_master=True): - "clones specified pull request from repo_url and optionally merges into master" + """clones specified pull request from repo_url and optionally merges into master""" local_cxn.local('cd %s && if [ -d letsencrypt ]; then rm -rf letsencrypt; fi' % LOGDIR) local_cxn.local('cd %s && git clone %s letsencrypt' % (LOGDIR, repo_url)) local_cxn.local('cd %s && cd letsencrypt && ' @@ -268,20 +260,20 @@ def local_git_PR(local_cxn, repo_url, PRnumstr, merge_master=True): local_cxn.local('cd %s && tar czf le.tar.gz letsencrypt' % LOGDIR) def local_repo_to_remote(cxn): - "copies local tarball of repo to remote" + """copies local tarball of repo to remote""" filename = 'le.tar.gz' local_path = os.path.join(LOGDIR, filename) cxn.put(local=local_path, remote='') cxn.run('tar xzf %s' % filename) def local_repo_clean(local_cxn): - "delete tarball" + """delete tarball""" filename = 'le.tar.gz' local_path = os.path.join(LOGDIR, filename) local_cxn.local('rm %s' % local_path) def deploy_script(cxn, scriptpath, *args): - "copies to remote and executes local script" + """copies to remote and executes local script""" cxn.put(local=scriptpath, remote='', preserve_mode=True) scriptfile = os.path.split(scriptpath)[1] args_str = ' '.join(args) @@ -424,30 +416,26 @@ def main(): # no network connection, so don't worry about closing this one. local_cxn = Connection('localhost', config=fab_config) - # Set up local copy of git repo or of a local project + # Set up local copy of git repo #------------------------------------------------------------------------------- print("Making local dir for test repo and logs: %s"%LOGDIR) local_cxn.local('mkdir %s'%LOGDIR) try: - if cl_args.path: - print('Testing with local project %s' % cl_args.path) - local_copy(local_cxn, cl_args.path) + # figure out what git object to test and locally create it in LOGDIR + print("Making local git repo") + if cl_args.pull_request != '~': + print('Testing PR %s ' % cl_args.pull_request, + "MERGING into master" if cl_args.merge_master else "") + local_git_PR(local_cxn, cl_args.repo, cl_args.pull_request, cl_args.merge_master) + elif cl_args.branch != '~': + print('Testing branch %s of %s' % (cl_args.branch, cl_args.repo)) + local_git_branch(local_cxn, cl_args.repo, cl_args.branch) else: - # figure out what git object to test and locally create it in LOGDIR - print("Making local git repo") - if cl_args.pull_request != '~': - print('Testing PR %s '%cl_args.pull_request, - "MERGING into master" if cl_args.merge_master else "") - local_git_PR(local_cxn, cl_args.repo, cl_args.pull_request, cl_args.merge_master) - elif cl_args.branch != '~': - print('Testing branch %s of %s'%(cl_args.branch, cl_args.repo)) - local_git_branch(local_cxn, cl_args.repo, cl_args.branch) - else: - print('Testing master of %s'%cl_args.repo) - local_git_clone(local_cxn, cl_args.repo) + print('Testing current branch of %s' % cl_args.repo) + local_git_clone(local_cxn, cl_args.repo) except BaseException: - print("FAIL: trouble with git repo or local project") + print("FAIL: trouble with git repo") traceback.print_exc() exit(1) diff --git a/tox.ini b/tox.ini index 62f91cd30..4ed58fec4 100644 --- a/tox.ini +++ b/tox.ini @@ -298,28 +298,28 @@ setenv = AWS_DEFAULT_REGION=us-east-1 [testenv:azure-test-farm-apache2] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py apache2_targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --path {toxinidir} +commands = python multitester.py apache2_targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-leauto-upgrades] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --path {toxinidir} +commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-certonly-standalone] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --path {toxinidir} +commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} [testenv:azure-test-farm-sdists] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --path {toxinidir} +commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --repo {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} From 9a07ee541b9c5bba67b0bdaf9e3a843c207b8911 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 12:41:08 +0200 Subject: [PATCH 144/172] Make test-farm generic --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- tox.ini | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 2db18ca01..926d8f289 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -39,7 +39,7 @@ steps: secureFile: azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | - ln -s $(testFarmPem.secureFilePath) tests/letstest/azure-test-farm.pem + export AWS_C2_PEM_FILE="$(testFarmPem.secureFilePath)" condition: contains(variables['TOXENV'], 'test-farm') - bash: | if [[ "${TOXENV}" == *"oldest"* ]]; then diff --git a/tox.ini b/tox.ini index 4ed58fec4..2c92d8cf2 100644 --- a/tox.ini +++ b/tox.ini @@ -296,30 +296,30 @@ passenv = AWS_* setenv = AWS_DEFAULT_REGION=us-east-1 -[testenv:azure-test-farm-apache2] +[testenv:test-farm-apache2] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py apache2_targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir} +commands = python multitester.py apache2_targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} -[testenv:azure-test-farm-leauto-upgrades] +[testenv:test-farm-leauto-upgrades] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {toxinidir} +commands = python multitester.py targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} -[testenv:azure-test-farm-certonly-standalone] +[testenv:test-farm-certonly-standalone] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {toxinidir} +commands = python multitester.py targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} -[testenv:azure-test-farm-sdists] +[testenv:test-farm-sdists] changedir = {[testenv:azure-test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml azure-test-farm.pem SET_BY_ENV scripts/test_sdists.sh --repo {toxinidir} +commands = python multitester.py targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_sdists.sh --repo {toxinidir} deps = {[testenv:azure-test-farm-tests-base]deps} passenv = {[testenv:azure-test-farm-tests-base]passenv} setenv = {[testenv:azure-test-farm-tests-base]setenv} From a6ecf68456b9c484f192e691a3b90b0763b83652 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 12:44:26 +0200 Subject: [PATCH 145/172] Fix position of jobs --- .../templates/stages/test-and-package-stage.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.azure-pipelines/templates/stages/test-and-package-stage.yml b/.azure-pipelines/templates/stages/test-and-package-stage.yml index b46a6d679..26010644d 100644 --- a/.azure-pipelines/templates/stages/test-and-package-stage.yml +++ b/.azure-pipelines/templates/stages/test-and-package-stage.yml @@ -1,6 +1,6 @@ stages: - stage: TestAndPackage jobs: - - template: templates/jobs/standard-tests-jobs.yml - - template: templates/jobs/extended-tests-jobs.yml - - template: templates/jobs/packaging-jobs.yml + - template: ../jobs/standard-tests-jobs.yml + - template: ../jobs/extended-tests-jobs.yml + - template: ../jobs/packaging-jobs.yml From 6e02f3d365a491c1ee7d0881278e7a1418c513d9 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 12:47:44 +0200 Subject: [PATCH 146/172] Remove unused logic in run_oldest_tests --- tools/run_oldest_tests.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/run_oldest_tests.sh b/tools/run_oldest_tests.sh index 7f27e9a79..2d007888d 100755 --- a/tools/run_oldest_tests.sh +++ b/tools/run_oldest_tests.sh @@ -3,10 +3,10 @@ set -e DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -pushd "${DIR}/../" || exit 1 +pushd "${DIR}/../" function cleanup() { - rm -f "${SCRIPT}" + rm -f "${DOCKERFILE}" popd } @@ -31,7 +31,6 @@ EOF docker build -f "${DOCKERFILE}" -t oldest-worker ./letsencrypt-auto-source/pieces docker run --rm --network=host -w "${PWD}" \ -v /var/run/docker.sock:/var/run/docker.sock \ - -v "${PWD}:${PWD}" -v "${SCRIPT}:/script.sh" \ - -v /tmp:/tmp \ + -v "${PWD}:${PWD}" -v /tmp:/tmp \ -e TOXENV -e ACME_SERVER -e PYTEST_ADDOPTS \ oldest-worker python -m tox From 4d127e1d827c31125a2131d2f191bbfe6f9832ff Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 12:49:19 +0200 Subject: [PATCH 147/172] Fix toxenv names --- .azure-pipelines/templates/jobs/extended-tests-jobs.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index 51f3e2173..9f0a3ab9b 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -80,16 +80,16 @@ jobs: TOXENV: docker_dev farmtest-apache2: PYTHON_VERSION: 3.7 - TOXENV: azure-test-farm-apache2 + TOXENV: test-farm-apache2 farmtest-leauto-upgrades: PYTHON_VERSION: 3.7 - TOXENV: azure-test-farm-leauto-upgrades + TOXENV: test-farm-leauto-upgrades farmtest-certonly-standalone: PYTHON_VERSION: 3.7 - TOXENV: azure-test-farm-certonly-standalone + TOXENV: test-farm-certonly-standalone farmtest-sdists: PYTHON_VERSION: 3.7 - TOXENV: azure-test-farm-sdists + TOXENV: test-farm-sdists pool: vmImage: $(IMAGE_NAME) steps: From 2da124cc7a7f6543527db310067835f9c422bee9 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 12:52:40 +0200 Subject: [PATCH 148/172] Fix test-farm logic --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 926d8f289..fc4612466 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -39,7 +39,7 @@ steps: secureFile: azure-test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | - export AWS_C2_PEM_FILE="$(testFarmPem.secureFilePath)" + ln -s $(testFarmPem.secureFilePath) tests/letstest/test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | if [[ "${TOXENV}" == *"oldest"* ]]; then From e9bf443a56b97710932cbe959088ae5bde21755c Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 12:58:51 +0200 Subject: [PATCH 149/172] Export variable --- .azure-pipelines/templates/steps/tox-steps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index fc4612466..92d417782 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -50,4 +50,5 @@ steps: env: AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) + AWS_C2_PEM_FILE: $(testFarmPem.secureFilePath) displayName: Run tox From 168678b631f15c99b4c941de13f50087203add96 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 21:18:07 +0200 Subject: [PATCH 150/172] Simply use docker run -t instead of docker run -it --- tox.ini | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/tox.ini b/tox.ini index 2c92d8cf2..02f21f700 100644 --- a/tox.ini +++ b/tox.ini @@ -170,10 +170,9 @@ commands = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t apache-compat -f certbot-compatibility-test/Dockerfile-apache . - script -qec "docker run --rm -it apache-compat -c apache.tar.gz -vvvv" + docker run --rm -t apache-compat -c apache.tar.gz -vvvv whitelist_externals = docker - script passenv = DOCKER_* @@ -181,10 +180,9 @@ passenv = commands = docker build -t certbot-compatibility-test -f certbot-compatibility-test/Dockerfile . docker build -t nginx-compat -f certbot-compatibility-test/Dockerfile-nginx . - script -qec "docker run --rm -it nginx-compat -c nginx.tar.gz -vv -aie" + docker run --rm -t nginx-compat -c nginx.tar.gz -vv -aie whitelist_externals = docker - script passenv = DOCKER_* @@ -193,10 +191,9 @@ passenv = commands = python {toxinidir}/tests/modification-check.py docker build -f letsencrypt-auto-source/Dockerfile.xenial -t lea letsencrypt-auto-source - script -qec "docker run --rm -it lea" + docker run --rm -t lea whitelist_externals = docker - script passenv = DOCKER_* TRAVIS_BRANCH @@ -206,10 +203,9 @@ passenv = # readily available on the Wheezy Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.jessie -t lea letsencrypt-auto-source - script -qec "docker run --rm -it lea" + docker run --rm -t lea whitelist_externals = docker - script passenv = DOCKER_* [testenv:le_auto_centos6] @@ -217,10 +213,9 @@ passenv = DOCKER_* # readily available on the CentOS 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=centos -t lea letsencrypt-auto-source - script -qec "docker run --rm -it lea" + docker run --rm -t lea whitelist_externals = docker - script passenv = DOCKER_* [testenv:le_auto_oraclelinux6] @@ -228,10 +223,9 @@ passenv = DOCKER_* # readily available on the Oracle Linux 6 Docker image. commands = docker build -f letsencrypt-auto-source/Dockerfile.redhat6 --build-arg REDHAT_DIST_FLAVOR=oraclelinux -t lea letsencrypt-auto-source - script -qec "docker run --rm -it lea" + docker run --rm -t lea whitelist_externals = docker - script passenv = DOCKER_* [testenv:docker_dev] From 9eb10d6df6ba3feb269970600dcc4ebdb4840c07 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 21:23:55 +0200 Subject: [PATCH 151/172] Remove a dependency not needed --- .azure-pipelines/templates/steps/tox-steps.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 92d417782..e58f5e495 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -13,8 +13,7 @@ steps: libffi-dev \ ca-certificates \ nginx-light \ - openssl \ - expect + openssl sudo systemctl stop nginx condition: startswith(variables['IMAGE_NAME'], 'ubuntu') displayName: Install Linux dependencies From 1750e73270d68fe0585d77e883bc4ad98a418a13 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 21:58:11 +0200 Subject: [PATCH 152/172] Rebrand advanced pipeline into nightly pipeline, running only master on schedule. Move release branch tests to advanced-test pipeline. --- .azure-pipelines/advanced-test.yml | 6 +++++- .azure-pipelines/{advanced.yml => nightly.yml} | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) rename .azure-pipelines/{advanced.yml => nightly.yml} (68%) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 109f31ac2..6c212d577 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -1,5 +1,6 @@ -# Advanced pipeline for running our full test suite on demand. +# Advanced pipeline for running our full test suite on demand and for release branches. trigger: + - '*.x' # When changing these triggers, please ensure the documentation under # "Running tests in CI" is still correct. - azure-test-* @@ -8,3 +9,6 @@ pr: none stages: - template: templates/stages/test-and-package-stage.yml + # Notify failures only for release branches. + - template: templates/stages/notify-failure-stage.yml + condition: and(failed(), endsWith(variables['Build.SourceBranchName', '.x']) diff --git a/.azure-pipelines/advanced.yml b/.azure-pipelines/nightly.yml similarity index 68% rename from .azure-pipelines/advanced.yml rename to .azure-pipelines/nightly.yml index 12b290120..6475db27a 100644 --- a/.azure-pipelines/advanced.yml +++ b/.azure-pipelines/nightly.yml @@ -1,8 +1,6 @@ -# Advanced pipeline for running our full test suite on protected branches. -trigger: - - '*.x' +# Nightly pipeline running each day for master. +trigger: none pr: none -# This pipeline is also nightly run on master schedules: - cron: "0 4 * * *" displayName: Nightly build From edaf3ebc621f52fb7bdad8629389800b87868def Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 22:13:08 +0200 Subject: [PATCH 153/172] Remove Travis references in contributing.rst. Run full tests only branches starting with `test-` --- .azure-pipelines/advanced-test.yml | 1 - .azure-pipelines/templates/stages/deploy-stage.yml | 7 +++++++ certbot/docs/contributing.rst | 12 ++++-------- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 6c212d577..34668f5ce 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -3,7 +3,6 @@ trigger: - '*.x' # When changing these triggers, please ensure the documentation under # "Running tests in CI" is still correct. - - azure-test-* - test-* pr: none diff --git a/.azure-pipelines/templates/stages/deploy-stage.yml b/.azure-pipelines/templates/stages/deploy-stage.yml index 772faa181..903c5f820 100644 --- a/.azure-pipelines/templates/stages/deploy-stage.yml +++ b/.azure-pipelines/templates/stages/deploy-stage.yml @@ -1,6 +1,13 @@ stages: - stage: Deploy jobs: + # This job relies on a snapcraft.yaml preconfigured with credential, + # stored as a secure file in Azure Pipeline. + # This credential has a maximum lifetime of 1 year and the current + # credential will expire on 4/22/2021. The content of snapcraft.yaml + # will need to be updated to use a new credential before then to + # prevent automated deploys from breaking. Remembering to do this is + # also tracked by https://github.com/certbot/certbot/issues/7931. - job: publish_snap strategy: matrix: diff --git a/certbot/docs/contributing.rst b/certbot/docs/contributing.rst index 50297152e..85e9b6d12 100644 --- a/certbot/docs/contributing.rst +++ b/certbot/docs/contributing.rst @@ -137,7 +137,7 @@ of output can make it hard to find specific failures when they happen. Running automated integration tests ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Generally it is sufficient to open a pull request and let Github and Travis run +Generally it is sufficient to open a pull request and let Github and Azure Pipelines run integration tests for you. However, you may want to run them locally before submitting your pull request. You need Docker and docker-compose installed and working. @@ -202,12 +202,8 @@ using an HTTP-01 challenge on a machine with Python 3: Running tests in CI ~~~~~~~~~~~~~~~~~~~ -Certbot uses both Azure Pipelines and Travis to run continuous integration -tests. If you are using our Azure and Travis setup, a branch whose name starts -with `test-` will run all Azure and Travis tests on that branch. If the branch -name starts with `azure-test-`, it will run all of our Azure tests and none of -our Travis tests. If the branch starts with `travis-test-`, only our Travis -tests will be run. +Certbot uses Azure Pipelines to run continuous integration tests. If you are using our +Azure setup, a branch whose name starts with `test-` will run all tests on that branch. Code components and layout ========================== @@ -455,7 +451,7 @@ Steps: containing your pull request to squash or amend commits. We use `squash merges `_ on PRs and rewriting commits makes changes harder to track between reviews. -6. Did your tests pass on Travis? If they didn't, fix any errors. +6. Did your tests pass on Azure Pipelines? If they didn't, fix any errors. .. _ask for help: From 07fa8d75484ae450d4c8d574a49a1530e32204ce Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 22:15:44 +0200 Subject: [PATCH 154/172] Remove travis config. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 132283cbf..000000000 --- a/.travis.yml +++ /dev/null @@ -1 +0,0 @@ -script: echo Hello World! From 4f4c1fc499761357e69b9f4ae939627eb487594c Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 22:23:17 +0200 Subject: [PATCH 155/172] Use expressions --- .azure-pipelines/advanced-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 34668f5ce..9fc1ec64c 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -9,5 +9,5 @@ pr: none stages: - template: templates/stages/test-and-package-stage.yml # Notify failures only for release branches. - - template: templates/stages/notify-failure-stage.yml - condition: and(failed(), endsWith(variables['Build.SourceBranchName', '.x']) + - ${{ if endsWith(variables['Build.SourceBranchName'], '.x') }}: + - template: templates/stages/notify-failure-stage.yml From c000c9dc269e1eedb3fe3ef5e1998df87947d144 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 22:26:07 +0200 Subject: [PATCH 156/172] Check expression --- .azure-pipelines/advanced-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 9fc1ec64c..762482e42 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -9,5 +9,5 @@ pr: none stages: - template: templates/stages/test-and-package-stage.yml # Notify failures only for release branches. - - ${{ if endsWith(variables['Build.SourceBranchName'], '.x') }}: + - ${{ if startsWith(variables['Build.SourceBranchName'], 'test-') }}: - template: templates/stages/notify-failure-stage.yml From f88ef7643f49763c551f44b20364cadf863483c7 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Tue, 30 Jun 2020 22:26:45 +0200 Subject: [PATCH 157/172] Expression is valid. This reverts commit c000c9dc269e1eedb3fe3ef5e1998df87947d144. --- .azure-pipelines/advanced-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 762482e42..9fc1ec64c 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -9,5 +9,5 @@ pr: none stages: - template: templates/stages/test-and-package-stage.yml # Notify failures only for release branches. - - ${{ if startsWith(variables['Build.SourceBranchName'], 'test-') }}: + - ${{ if endsWith(variables['Build.SourceBranchName'], '.x') }}: - template: templates/stages/notify-failure-stage.yml From 2c67c10d70cb4cfd237f4d9b09f6d81e8a177449 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 00:20:26 +0200 Subject: [PATCH 158/172] Update .azure-pipelines/advanced-test.yml Co-authored-by: Brad Warren --- .azure-pipelines/advanced-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/advanced-test.yml b/.azure-pipelines/advanced-test.yml index 9fc1ec64c..10ff79289 100644 --- a/.azure-pipelines/advanced-test.yml +++ b/.azure-pipelines/advanced-test.yml @@ -9,5 +9,5 @@ pr: none stages: - template: templates/stages/test-and-package-stage.yml # Notify failures only for release branches. - - ${{ if endsWith(variables['Build.SourceBranchName'], '.x') }}: + - ${{ if not(startsWith(variables['Build.SourceBranchName'], 'test-')) }}: - template: templates/stages/notify-failure-stage.yml From c9fca3958b51968b8194f98bced46c22146420f7 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 00:20:44 +0200 Subject: [PATCH 159/172] Update .azure-pipelines/templates/stages/deploy-stage.yml Co-authored-by: Brad Warren --- .azure-pipelines/templates/stages/deploy-stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/stages/deploy-stage.yml b/.azure-pipelines/templates/stages/deploy-stage.yml index 903c5f820..5a99d5c8d 100644 --- a/.azure-pipelines/templates/stages/deploy-stage.yml +++ b/.azure-pipelines/templates/stages/deploy-stage.yml @@ -4,7 +4,7 @@ stages: # This job relies on a snapcraft.yaml preconfigured with credential, # stored as a secure file in Azure Pipeline. # This credential has a maximum lifetime of 1 year and the current - # credential will expire on 4/22/2021. The content of snapcraft.yaml + # credential will expire on 6/25/2021. The content of snapcraft.cfg # will need to be updated to use a new credential before then to # prevent automated deploys from breaking. Remembering to do this is # also tracked by https://github.com/certbot/certbot/issues/7931. From 95ffdd45ecc46dfa3aca0e755f587f49f4793b98 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 00:20:55 +0200 Subject: [PATCH 160/172] Update .azure-pipelines/templates/stages/deploy-stage.yml Co-authored-by: Brad Warren --- .azure-pipelines/templates/stages/deploy-stage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/stages/deploy-stage.yml b/.azure-pipelines/templates/stages/deploy-stage.yml index 5a99d5c8d..1a6dbcad0 100644 --- a/.azure-pipelines/templates/stages/deploy-stage.yml +++ b/.azure-pipelines/templates/stages/deploy-stage.yml @@ -1,7 +1,7 @@ stages: - stage: Deploy jobs: - # This job relies on a snapcraft.yaml preconfigured with credential, + # This job relies on a snapcraft.cfg preconfigured with credential, # stored as a secure file in Azure Pipeline. # This credential has a maximum lifetime of 1 year and the current # credential will expire on 6/25/2021. The content of snapcraft.cfg From 77eaa9a50beadafe8686cda1d43eae3ba4bb9f47 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 00:23:17 +0200 Subject: [PATCH 161/172] Remove Azure references in tox.ini --- tox.ini | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/tox.ini b/tox.ini index 02f21f700..b995f974e 100644 --- a/tox.ini +++ b/tox.ini @@ -283,7 +283,7 @@ commands = passenv = DOCKER_* setenv = {[testenv:py27-oldest]setenv} -[testenv:azure-test-farm-tests-base] +[testenv:test-farm-tests-base] changedir = tests/letstest deps = -rtests/letstest/requirements.txt passenv = @@ -291,29 +291,29 @@ passenv = setenv = AWS_DEFAULT_REGION=us-east-1 [testenv:test-farm-apache2] -changedir = {[testenv:azure-test-farm-tests-base]changedir} +changedir = {[testenv:test-farm-tests-base]changedir} commands = python multitester.py apache2_targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir} -deps = {[testenv:azure-test-farm-tests-base]deps} -passenv = {[testenv:azure-test-farm-tests-base]passenv} -setenv = {[testenv:azure-test-farm-tests-base]setenv} +deps = {[testenv:test-farm-tests-base]deps} +passenv = {[testenv:test-farm-tests-base]passenv} +setenv = {[testenv:test-farm-tests-base]setenv} [testenv:test-farm-leauto-upgrades] -changedir = {[testenv:azure-test-farm-tests-base]changedir} +changedir = {[testenv:test-farm-tests-base]changedir} commands = python multitester.py targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {toxinidir} -deps = {[testenv:azure-test-farm-tests-base]deps} -passenv = {[testenv:azure-test-farm-tests-base]passenv} -setenv = {[testenv:azure-test-farm-tests-base]setenv} +deps = {[testenv:test-farm-tests-base]deps} +passenv = {[testenv:test-farm-tests-base]passenv} +setenv = {[testenv:test-farm-tests-base]setenv} [testenv:test-farm-certonly-standalone] -changedir = {[testenv:azure-test-farm-tests-base]changedir} +changedir = {[testenv:test-farm-tests-base]changedir} commands = python multitester.py targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {toxinidir} -deps = {[testenv:azure-test-farm-tests-base]deps} -passenv = {[testenv:azure-test-farm-tests-base]passenv} -setenv = {[testenv:azure-test-farm-tests-base]setenv} +deps = {[testenv:test-farm-tests-base]deps} +passenv = {[testenv:test-farm-tests-base]passenv} +setenv = {[testenv:test-farm-tests-base]setenv} [testenv:test-farm-sdists] -changedir = {[testenv:azure-test-farm-tests-base]changedir} +changedir = {[testenv:test-farm-tests-base]changedir} commands = python multitester.py targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_sdists.sh --repo {toxinidir} -deps = {[testenv:azure-test-farm-tests-base]deps} -passenv = {[testenv:azure-test-farm-tests-base]passenv} -setenv = {[testenv:azure-test-farm-tests-base]setenv} +deps = {[testenv:test-farm-tests-base]deps} +passenv = {[testenv:test-farm-tests-base]passenv} +setenv = {[testenv:test-farm-tests-base]setenv} From 174d4005caf76d5ed4591e87f9717e7b42af6fbf Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 00:25:37 +0200 Subject: [PATCH 162/172] Use AWS_EC2_PEM_FILE, without default value --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- tox.ini | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index e58f5e495..181dfa638 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -49,5 +49,5 @@ steps: env: AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) - AWS_C2_PEM_FILE: $(testFarmPem.secureFilePath) + AWS_EC2_PEM_FILE: $(testFarmPem.secureFilePath) displayName: Run tox diff --git a/tox.ini b/tox.ini index b995f974e..c5de8b047 100644 --- a/tox.ini +++ b/tox.ini @@ -292,28 +292,28 @@ setenv = AWS_DEFAULT_REGION=us-east-1 [testenv:test-farm-apache2] changedir = {[testenv:test-farm-tests-base]changedir} -commands = python multitester.py apache2_targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir} +commands = python multitester.py apache2_targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir} deps = {[testenv:test-farm-tests-base]deps} passenv = {[testenv:test-farm-tests-base]passenv} setenv = {[testenv:test-farm-tests-base]setenv} [testenv:test-farm-leauto-upgrades] changedir = {[testenv:test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {toxinidir} +commands = python multitester.py targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_leauto_upgrades.sh --repo {toxinidir} deps = {[testenv:test-farm-tests-base]deps} passenv = {[testenv:test-farm-tests-base]passenv} setenv = {[testenv:test-farm-tests-base]setenv} [testenv:test-farm-certonly-standalone] changedir = {[testenv:test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {toxinidir} +commands = python multitester.py targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_letsencrypt_auto_certonly_standalone.sh --repo {toxinidir} deps = {[testenv:test-farm-tests-base]deps} passenv = {[testenv:test-farm-tests-base]passenv} setenv = {[testenv:test-farm-tests-base]setenv} [testenv:test-farm-sdists] changedir = {[testenv:test-farm-tests-base]changedir} -commands = python multitester.py targets.yaml {env:AWS_C2_PEM_FILE:test-farm.pem} SET_BY_ENV scripts/test_sdists.sh --repo {toxinidir} +commands = python multitester.py targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_sdists.sh --repo {toxinidir} deps = {[testenv:test-farm-tests-base]deps} passenv = {[testenv:test-farm-tests-base]passenv} setenv = {[testenv:test-farm-tests-base]setenv} From 119103d7bc1a05cccc270edd9f1f35b44ee084c1 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 00:28:20 +0200 Subject: [PATCH 163/172] Update .azure-pipelines/templates/jobs/packaging-jobs.yml Co-authored-by: Brad Warren --- .azure-pipelines/templates/jobs/packaging-jobs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/jobs/packaging-jobs.yml b/.azure-pipelines/templates/jobs/packaging-jobs.yml index 77d905da9..97904b0ba 100644 --- a/.azure-pipelines/templates/jobs/packaging-jobs.yml +++ b/.azure-pipelines/templates/jobs/packaging-jobs.yml @@ -86,7 +86,7 @@ jobs: steps: - script: | sudo apt-get update - sudo apt-get install -y --no-install-recommends nginx-light snap + sudo apt-get install -y --no-install-recommends nginx-light snapd python tools/pip_install.py -U tox displayName: Install dependencies - task: DownloadPipelineArtifact@2 From 5fecae8bc0dcd56a40b0602ba0926634d5b80281 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 00:51:14 +0200 Subject: [PATCH 164/172] Specific fix considering that the CI is now Azure --- certbot/README.rst | 6 +++--- tests/lock_test.py | 6 +++--- tests/modification-check.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/certbot/README.rst b/certbot/README.rst index 39da06c8a..f0ad6e8cb 100644 --- a/certbot/README.rst +++ b/certbot/README.rst @@ -73,9 +73,9 @@ ACME working area in github: https://github.com/ietf-wg-acme/acme |build-status| -.. |build-status| image:: https://travis-ci.com/certbot/certbot.svg?branch=master - :target: https://travis-ci.com/certbot/certbot - :alt: Travis CI status +.. |build-status| image:: https://img.shields.io/azure-devops/build/certbot/ba534f81-a483-4b9b-9b4e-a60bec8fee72/2/master + :target: https://dev.azure.com/certbot/certbot/_build?definitionId=2 + :alt: Azure Pipelines CI status .. Do not modify this comment unless you know what you're doing. tag:links-end diff --git a/tests/lock_test.py b/tests/lock_test.py index 29a77ae17..ac90e7177 100644 --- a/tests/lock_test.py +++ b/tests/lock_test.py @@ -59,9 +59,9 @@ def set_up(): command = set_up_command(config_dir, logs_dir, work_dir, nginx_dir) dirs = [logs_dir, config_dir, work_dir] - # Travis and Circle CI set CI to true so we - # will always test Nginx's lock during CI - if os.environ.get('CI') == 'true' or util.exe_exists('nginx'): + # A specific environment variable for Azure Pipelines is SYSTEM_TEAMFOUNDATIONSERVERURI. + # If set, then we know we are on a CI job, and we test Nginx's lock. + if os.environ.get('SYSTEM_TEAMFOUNDATIONSERVERURI') == 'true' or util.exe_exists('nginx'): dirs.append(nginx_dir) else: logger.warning('Skipping Nginx lock tests') diff --git a/tests/modification-check.py b/tests/modification-check.py index 811f369d4..473e0900b 100755 --- a/tests/modification-check.py +++ b/tests/modification-check.py @@ -57,7 +57,7 @@ def validate_scripts_content(repo_path, temp_cwd): 'letsencrypt-auto-source/pieces/fetch.py')), temp_cwd) # Compare file against current version in the target branch - branch = os.environ.get('TRAVIS_BRANCH', 'master') + branch = os.environ.get('BUILD_SOURCEBRANCHNAME', 'master') url = ( 'https://raw.githubusercontent.com/certbot/certbot/{0}/certbot-auto' .format(branch)) From 6503d75446305cd80cb59f62f690a20eed49abaa Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 21:29:49 +0200 Subject: [PATCH 165/172] Audit env --- .azure-pipelines/templates/steps/tox-steps.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 181dfa638..0baa78ce0 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -41,6 +41,7 @@ steps: ln -s $(testFarmPem.secureFilePath) tests/letstest/test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | + env if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh else From 63a5c868fcc4b25f986b6eff0b36a2c7751b2af3 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 22:41:30 +0200 Subject: [PATCH 166/172] Setting TARGET_BRANCH --- .azure-pipelines/templates/steps/tox-steps.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 0baa78ce0..0b76a9f57 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -51,4 +51,8 @@ steps: AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) AWS_EC2_PEM_FILE: $(testFarmPem.secureFilePath) + ${{ if variables['System.PullRequest.TargetBranch'] }}: + TARGET_BRANCH: $(System.PullRequest.TargetBranch) + ${{ if not(variables['System.PullRequest.TargetBranch']) }}: + TARGET_BRANCH: $(Build.SourceBranchName) displayName: Run tox From 6627a33d97d1ca4cb363505d5d885f4d42637821 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 22:46:13 +0200 Subject: [PATCH 167/172] Runtime expression --- .azure-pipelines/templates/steps/tox-steps.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 0b76a9f57..427c52d31 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -41,6 +41,8 @@ steps: ln -s $(testFarmPem.secureFilePath) tests/letstest/test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | + export TARGET_BRANCH="${BUILD_SOURCEBRANCHNAME}" + [ -z "${SYSTEM_PULLREQUEST_TARGETBRANCH}" ] || export TARGET_BRANCH="${SYSTEM_PULLREQUEST_TARGETBRANCH}" env if [[ "${TOXENV}" == *"oldest"* ]]; then tools/run_oldest_tests.sh @@ -51,8 +53,4 @@ steps: AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) AWS_EC2_PEM_FILE: $(testFarmPem.secureFilePath) - ${{ if variables['System.PullRequest.TargetBranch'] }}: - TARGET_BRANCH: $(System.PullRequest.TargetBranch) - ${{ if not(variables['System.PullRequest.TargetBranch']) }}: - TARGET_BRANCH: $(Build.SourceBranchName) displayName: Run tox From a9e269223730fe8787b41930af074f6ad7b705aa Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 23:01:30 +0200 Subject: [PATCH 168/172] Pass a generic TARGET_BRANCH for modification-check --- tests/modification-check.py | 2 +- tox.ini | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/modification-check.py b/tests/modification-check.py index 473e0900b..7a69fb1db 100755 --- a/tests/modification-check.py +++ b/tests/modification-check.py @@ -57,7 +57,7 @@ def validate_scripts_content(repo_path, temp_cwd): 'letsencrypt-auto-source/pieces/fetch.py')), temp_cwd) # Compare file against current version in the target branch - branch = os.environ.get('BUILD_SOURCEBRANCHNAME', 'master') + branch = os.environ.get('TARGET_BRANCH', 'master') url = ( 'https://raw.githubusercontent.com/certbot/certbot/{0}/certbot-auto' .format(branch)) diff --git a/tox.ini b/tox.ini index c5de8b047..a009ba219 100644 --- a/tox.ini +++ b/tox.ini @@ -165,6 +165,7 @@ commands = [testenv:modification] commands = python {toxinidir}/tests/modification-check.py +passenv = TARGET_BRANCH [testenv:apache_compat] commands = @@ -196,7 +197,7 @@ whitelist_externals = docker passenv = DOCKER_* - TRAVIS_BRANCH + TARGET_BRANCH [testenv:le_auto_jessie] # At the moment, this tests under Python 2.7 only, as only that version is From ed331d16abcf53da0affa014435953e91d377367 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Wed, 1 Jul 2020 23:16:40 +0200 Subject: [PATCH 169/172] Check only for nginx installation in lock_test to decide to do the test --- tests/lock_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/lock_test.py b/tests/lock_test.py index ac90e7177..56399c874 100644 --- a/tests/lock_test.py +++ b/tests/lock_test.py @@ -59,9 +59,9 @@ def set_up(): command = set_up_command(config_dir, logs_dir, work_dir, nginx_dir) dirs = [logs_dir, config_dir, work_dir] - # A specific environment variable for Azure Pipelines is SYSTEM_TEAMFOUNDATIONSERVERURI. - # If set, then we know we are on a CI job, and we test Nginx's lock. - if os.environ.get('SYSTEM_TEAMFOUNDATIONSERVERURI') == 'true' or util.exe_exists('nginx'): + # If Nginx is installed, do the test, otherwise skip it. + # Issue https://github.com/certbot/certbot/issues/8121 tracks the work to remove this control. + if util.exe_exists('nginx'): dirs.append(nginx_dir) else: logger.warning('Skipping Nginx lock tests') From 0d7f1217c13201ac4c04be21b9079714dd88437d Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 2 Jul 2020 19:59:55 +0200 Subject: [PATCH 170/172] Use a more consistent variable for calculating source branch --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 427c52d31..9cb84aa3a 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -41,7 +41,7 @@ steps: ln -s $(testFarmPem.secureFilePath) tests/letstest/test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | - export TARGET_BRANCH="${BUILD_SOURCEBRANCHNAME}" + export TARGET_BRANCH="${BUILD_SOURCEBRANCH/refs\/(heads|tags)\//}" [ -z "${SYSTEM_PULLREQUEST_TARGETBRANCH}" ] || export TARGET_BRANCH="${SYSTEM_PULLREQUEST_TARGETBRANCH}" env if [[ "${TOXENV}" == *"oldest"* ]]; then From 2501bc1c0b8ae35036b5ee9fb7694ad84034265e Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 2 Jul 2020 20:54:37 +0200 Subject: [PATCH 171/172] Escape-ception ? --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 9cb84aa3a..4267d7bbf 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -41,7 +41,7 @@ steps: ln -s $(testFarmPem.secureFilePath) tests/letstest/test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | - export TARGET_BRANCH="${BUILD_SOURCEBRANCH/refs\/(heads|tags)\//}" + export TARGET_BRANCH="${BUILD_SOURCEBRANCH/refs\\/(heads|tags)\\//}" [ -z "${SYSTEM_PULLREQUEST_TARGETBRANCH}" ] || export TARGET_BRANCH="${SYSTEM_PULLREQUEST_TARGETBRANCH}" env if [[ "${TOXENV}" == *"oldest"* ]]; then From 160fa00930d39b599a2963ac81bfdf5babdf9512 Mon Sep 17 00:00:00 2001 From: Adrien Ferrand Date: Thu, 2 Jul 2020 21:02:28 +0200 Subject: [PATCH 172/172] Sed, give me your strength! --- .azure-pipelines/templates/steps/tox-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azure-pipelines/templates/steps/tox-steps.yml b/.azure-pipelines/templates/steps/tox-steps.yml index 4267d7bbf..f3b0fc62d 100644 --- a/.azure-pipelines/templates/steps/tox-steps.yml +++ b/.azure-pipelines/templates/steps/tox-steps.yml @@ -41,7 +41,7 @@ steps: ln -s $(testFarmPem.secureFilePath) tests/letstest/test-farm.pem condition: contains(variables['TOXENV'], 'test-farm') - bash: | - export TARGET_BRANCH="${BUILD_SOURCEBRANCH/refs\\/(heads|tags)\\//}" + export TARGET_BRANCH="`echo "${BUILD_SOURCEBRANCH}" | sed -E 's!refs/(heads|tags)/!!g'`" [ -z "${SYSTEM_PULLREQUEST_TARGETBRANCH}" ] || export TARGET_BRANCH="${SYSTEM_PULLREQUEST_TARGETBRANCH}" env if [[ "${TOXENV}" == *"oldest"* ]]; then