From e2b7b62b9897e2696491f6186236e0a0b762423b Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 23 Feb 2022 15:10:48 -0800 Subject: [PATCH] remove test_sdists.sh (#9213) The reason I want to do this is many of the targets of `test_sdists.sh` use Python 3.6 which [has reached its EOL](https://www.python.org/dev/peps/pep-0494/#lifespan). We could instead just stop running the test on these systems or install a newer version of Python 3 outside of OS packaging, but instead I decided to look into why we have these tests to begin with. I introduced these tests many years ago in https://github.com/certbot/certbot/pull/4089 as a fix for https://github.com/certbot/certbot/issues/4044. Essentially the problem was the way packagers ran tests and the way we ran tests were slightly different. This difference could cause test failures when distros tried to run tests on our packages. Since I did this, [we've switched to telling packagers to run tests using `pytest` like we do](https://github.com/certbot/certbot/blob/5e76669c5026732d1440e39e93b58220ef7bd354/certbot/docs/packaging.rst#notes-for-package-maintainers) and we've greatly reduced our reliance on OS packaging through things like `snap`. Because of this, I think we should stop running this test, reducing our reliance on the heavy "test farm tests", and simplifying our CI pipeline. I think future problems here is quite unlikely and even if we have them, it should only affect tests on our non-primary distribution mechanisms which I think is a very minor concern. When reviewing this PR, it's probably worth noting that I just replaced `targets.yaml` with the contents of `apache2_targets.yaml` since the Apache 2 tests are the only runs we're running with this change. --- .../templates/jobs/extended-tests-jobs.yml | 8 +-- letstest/letstest/multitester.py | 4 +- letstest/scripts/test_sdists.sh | 52 ------------------- letstest/targets/apache2_targets.yaml | 39 -------------- letstest/targets/targets.yaml | 30 ++--------- tox.ini | 10 +--- 6 files changed, 8 insertions(+), 135 deletions(-) delete mode 100755 letstest/scripts/test_sdists.sh delete mode 100644 letstest/targets/apache2_targets.yaml diff --git a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml index e10f2790e..31325ae6c 100644 --- a/.azure-pipelines/templates/jobs/extended-tests-jobs.yml +++ b/.azure-pipelines/templates/jobs/extended-tests-jobs.yml @@ -65,15 +65,9 @@ jobs: le-modification: IMAGE_NAME: ubuntu-18.04 TOXENV: modification - macos-farmtest-apache2: - # We run one of these test farm tests on macOS to help ensure the - # tests continue to work on the platform. - IMAGE_NAME: macOS-10.15 + farmtest-apache2: PYTHON_VERSION: 3.8 TOXENV: test-farm-apache2 - farmtest-sdists: - PYTHON_VERSION: 3.7 - TOXENV: test-farm-sdists pool: vmImage: $(IMAGE_NAME) steps: diff --git a/letstest/letstest/multitester.py b/letstest/letstest/multitester.py index 437f34dc9..a74e3f01d 100644 --- a/letstest/letstest/multitester.py +++ b/letstest/letstest/multitester.py @@ -22,7 +22,7 @@ Usage: >aws ec2 create-key-pair --profile HappyHacker --key-name MyKeyPair \ --query 'KeyMaterial' --output text > MyKeyPair.pem then: ->letstest targets/targets.yaml MyKeyPair.pem HappyHacker scripts/test_sdists.sh +>letstest targets/targets.yaml MyKeyPair.pem HappyHacker scripts/test_apache2.sh see: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html https://docs.aws.amazon.com/cli/latest/userguide/cli-ec2-keypairs.html @@ -56,7 +56,7 @@ parser.add_argument('key_file', parser.add_argument('aws_profile', help='profile for AWS (i.e. as in ~/.aws/certificates)') parser.add_argument('test_script', - default='test_sdists.sh', + default='test_apache2.sh', help='path of bash script in to deploy and run') parser.add_argument('--repo', default='https://github.com/letsencrypt/letsencrypt.git', diff --git a/letstest/scripts/test_sdists.sh b/letstest/scripts/test_sdists.sh deleted file mode 100755 index addc59095..000000000 --- a/letstest/scripts/test_sdists.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/bin/sh -xe - -cd letsencrypt - -BOOTSTRAP_SCRIPT="letstest/scripts/bootstrap_os_packages.sh" -VENV_PATH=venv - -# install OS packages -. $BOOTSTRAP_SCRIPT - -# setup venv -python3 -m venv $VENV_PATH -$VENV_PATH/bin/python3 tools/pipstrap.py -. "$VENV_PATH/bin/activate" -# pytest is needed to run tests on our packages so we install a pinned version here. -tools/pip_install.py pytest - -# setup constraints -TEMP_DIR=$(mktemp -d) -CONSTRAINTS="$TEMP_DIR/constraints.txt" -cp tools/requirements.txt "$CONSTRAINTS" - -# We pin cryptography to 3.1.1 and pyopenssl to 19.1.0 specifically for CentOS 7 / RHEL 7 -# because these systems ship only with OpenSSL 1.0.2, and this OpenSSL version support has been -# dropped on cryptography>=3.2 and pyopenssl>=20.0.0. -# Using this old version of OpenSSL would break the cryptography and pyopenssl wheels builds. -if [ -f /etc/redhat-release ] && [ "$(. /etc/os-release 2> /dev/null && echo "$VERSION_ID" | cut -d '.' -f1)" -eq 7 ]; then - sed -i 's|cryptography==.*|cryptography==3.1.1|g' "$CONSTRAINTS" - sed -i 's|pyopenssl==.*|pyopenssl==19.1.0|g' "$CONSTRAINTS" -fi - -PLUGINS="certbot-apache certbot-nginx" -# build sdists -for pkg_dir in acme certbot $PLUGINS; do - cd $pkg_dir - python setup.py clean - rm -rf build dist - python setup.py sdist - mv dist/* $TEMP_DIR - cd - -done - -VERSION=$(python letstest/scripts/version.py) -# test sdists -cd $TEMP_DIR -for pkg in acme certbot $PLUGINS; do - tar -xvf "$pkg-$VERSION.tar.gz" - cd "$pkg-$VERSION" - PIP_CONSTRAINT=../constraints.txt PIP_NO_BINARY=:all: pip install . - python -m pytest - cd - -done diff --git a/letstest/targets/apache2_targets.yaml b/letstest/targets/apache2_targets.yaml deleted file mode 100644 index 1812b3645..000000000 --- a/letstest/targets/apache2_targets.yaml +++ /dev/null @@ -1,39 +0,0 @@ -# These images are located in us-east-1. -# -# All machines must currently use x86_64 since Pebble does not currently -# publish images for other architectures. - -targets: - #----------------------------------------------------------------------------- - #Ubuntu - - ami: ami-0c2d5393cb5b518f6 - name: ubuntu21.10 - type: ubuntu - virt: hvm - user: ubuntu - - ami: ami-0758470213bdd23b1 - name: ubuntu20.04 - type: ubuntu - virt: hvm - user: ubuntu - - ami: ami-095192256fe1477ad - name: ubuntu18.04LTS - type: ubuntu - virt: hvm - user: ubuntu - #----------------------------------------------------------------------------- - # Debian - - ami: ami-01db78123b2b99496 - name: debian10 - type: ubuntu - virt: hvm - user: admin - #----------------------------------------------------------------------------- - # CentOS - # This AMI was found on - # https://web.archive.org/web/20211126215532/https://wiki.centos.org/Cloud/AWS. - - ami: ami-00e87074e52e6c9f9 - name: centos7 - type: centos - virt: hvm - user: centos diff --git a/letstest/targets/targets.yaml b/letstest/targets/targets.yaml index 35379c2cc..1812b3645 100644 --- a/letstest/targets/targets.yaml +++ b/letstest/targets/targets.yaml @@ -1,4 +1,7 @@ # These images are located in us-east-1. +# +# All machines must currently use x86_64 since Pebble does not currently +# publish images for other architectures. targets: #----------------------------------------------------------------------------- @@ -25,37 +28,12 @@ targets: type: ubuntu virt: hvm user: admin - - ami: ami-0dcd54b7d2fff584f - name: debian10_arm64 - type: ubuntu - virt: hvm - user: admin - machine_type: a1.medium - #----------------------------------------------------------------------------- - # RHEL - # These AMIs were found using the commands given at - # https://web.archive.org/web/20220129184532/https://access.redhat.com/solutions/15356. - - ami: ami-005b7876121b7244d - name: RHEL7 - type: centos - virt: hvm - user: ec2-user - - ami: ami-0c322300a1dd5dc79 - name: RHEL8 - type: centos - virt: hvm - user: ec2-user #----------------------------------------------------------------------------- # CentOS - # These AMIs were found on + # This AMI was found on # https://web.archive.org/web/20211126215532/https://wiki.centos.org/Cloud/AWS. - ami: ami-00e87074e52e6c9f9 name: centos7 type: centos virt: hvm user: centos - - ami: ami-0ee70e88eed976a1b - name: centos_stream8 - type: centos - virt: hvm - user: centos diff --git a/tox.ini b/tox.ini index 5203b5b92..25396d3dd 100644 --- a/tox.ini +++ b/tox.ini @@ -263,14 +263,6 @@ setenv = AWS_DEFAULT_REGION=us-east-1 changedir = {[testenv:test-farm-tests-base]changedir} commands = {[testenv:test-farm-tests-base]commands} - {toxinidir}/tools/retry.sh letstest targets/apache2_targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir} -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 = - {[testenv:test-farm-tests-base]commands} - {toxinidir}/tools/retry.sh letstest targets/targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_sdists.sh --repo {toxinidir} + {toxinidir}/tools/retry.sh letstest targets/targets.yaml {env:AWS_EC2_PEM_FILE} SET_BY_ENV scripts/test_apache2.sh --repo {toxinidir} passenv = {[testenv:test-farm-tests-base]passenv} setenv = {[testenv:test-farm-tests-base]setenv}