From fbeabd4dcfa666fa281ef016c909ba80fb4119e2 Mon Sep 17 00:00:00 2001 From: Erica Portnoy Date: Fri, 17 Apr 2026 13:22:30 -0700 Subject: [PATCH] switch extended tests to new format; remove setup_tox and run_tox actions --- .github/actions/run_tox/action.yml | 41 ------------------ .github/actions/setup_tox/action.yml | 52 ----------------------- .github/workflows/extended_tests_jobs.yml | 31 +++----------- .github/workflows/standard_tests_jobs.yml | 2 +- .github/workflows/tox_steps.yml | 3 ++ 5 files changed, 11 insertions(+), 118 deletions(-) delete mode 100644 .github/actions/run_tox/action.yml delete mode 100644 .github/actions/setup_tox/action.yml diff --git a/.github/actions/run_tox/action.yml b/.github/actions/run_tox/action.yml deleted file mode 100644 index ed6dff61e..000000000 --- a/.github/actions/run_tox/action.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Run tox - -inputs: - AWS_ACCESS_KEY_ID: - description: 'access key ID for AWS' - AWS_SECRET_ACCESS_KEY: - description: 'access key for AWS' - AWS_TEST_FARM_PEM: - description: 'contents of AWS PEM file to be placed in $AWS_EC2_PEM_FILE from environment' - PIP_USE_PEP517: - description: 'a pip flag' - TOXENV: - description: 'the tox environment to run' - CFLAGS: - description: 'needed to help pip find augeas headers on mac' - -runs: - using: composite - steps: - - name: Create test farm pem file - if: contains(inputs.TOXENV, 'test-farm') - env: - PEM_CONTENTS: "${{ inputs.AWS_TEST_FARM_PEM }}" - run: |- - set -e - echo "${PEM_CONTENTS}" >> $AWS_EC2_PEM_FILE - shell: bash - - name: Run tox - env: - AWS_ACCESS_KEY_ID: "${{ inputs.AWS_ACCESS_KEY_ID }}" - AWS_SECRET_ACCESS_KEY: "${{ inputs.AWS_SECRET_ACCESS_KEY }}" - PIP_USE_PEP517: "${{ inputs.PIP_USE_PEP517 }}" - TOXENV: "${{ inputs.TOXENV }}" - CFLAGS: "${{ inputs.CFLAGS }}" - run: |- - set -e - export TARGET_BRANCH="`echo "${BUILD_SOURCEBRANCH}" | sed -E 's!refs/(heads|tags)/!!g'`" - [ -z "${SYSTEM_PULLREQUEST_TARGETBRANCH}" ] || export TARGET_BRANCH="${SYSTEM_PULLREQUEST_TARGETBRANCH}" - env - python3 -m tox run - shell: bash diff --git a/.github/actions/setup_tox/action.yml b/.github/actions/setup_tox/action.yml deleted file mode 100644 index 52750e668..000000000 --- a/.github/actions/setup_tox/action.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Setup tox - -inputs: - AWS_TEST_FARM_PEM: - description: 'Contents of keyfile for AWS' - AWS_EC2_PEM_FILE: - description: 'Location of keyfile for AWS' - PYTHON_VERSION: - description: 'Python version to run tests with' - required: true - -runs: - using: composite - steps: - # We run brew update because we've seen attempts to install an older version - # of a package fail. See - # https://github.com/actions/virtual-environments/issues/3165. - # - # We untap homebrew/core and homebrew/cask and unset HOMEBREW_NO_INSTALL_FROM_API (which - # is maybe set by the CI macOS env) because GitHub has been having issues, making these jobs - # fail on git clones: https://github.com/orgs/Homebrew/discussions/4612. - - name: Install MacOS dependencies - if: runner.os == 'macOS' - run: |- - set -e - unset HOMEBREW_NO_INSTALL_FROM_API - brew untap homebrew/core homebrew/cask - brew update - brew install augeas - BREW_PREFIX=$(brew --prefix) - CFLAGS="$CFLAGS -I$BREW_PREFIX/include -L$BREW_PREFIX/lib" - echo "CFLAGS=$CFLAGS" >> $GITHUB_OUTPUT - shell: bash - - name: Install Linux dependencies - if: runner.os == 'Linux' - run: |- - set -e - sudo apt-get update - sudo apt-get install -y --no-install-recommends \ - libaugeas-dev \ - nginx-light - sudo systemctl stop nginx - sudo sysctl net.ipv4.ip_unprivileged_port_start=0 - shell: bash - - uses: actions/setup-python@v6.2.0 - with: - python-version: "${{ inputs.PYTHON_VERSION }}" - - name: Install runtime dependencies - run: |- - set -e - python3 tools/pip_install.py tox - shell: bash diff --git a/.github/workflows/extended_tests_jobs.yml b/.github/workflows/extended_tests_jobs.yml index b0c5429de..937dc57ff 100644 --- a/.github/workflows/extended_tests_jobs.yml +++ b/.github/workflows/extended_tests_jobs.yml @@ -5,13 +5,8 @@ on: jobs: test: - name: extended_test ${{ matrix.TOXENV }} ${{ matrix.PYTHON_VERSION }} permissions: contents: read - runs-on: - - 'ubuntu-22.04' - env: - uploadCoverage: ${{ inputs.uploadCoverage }} strategy: fail-fast: false matrix: @@ -45,22 +40,10 @@ jobs: TOXENV: integration-dns-rfc2136 - PYTHON_VERSION: '3.12' TOXENV: test-farm-apache2 - steps: - - name: Checkout - uses: actions/checkout@v6.0.2 - - name: Setup tox - uses: "./.github/actions/setup_tox" - with: - PYTHON_VERSION: "${{ matrix.PYTHON_VERSION }}" - - name: Run tox - uses: "./.github/actions/run_tox" - env: - AWS_EC2_PEM_FILE: ${{ github.workspace }}/GHAKeyPair.pem - with: - AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}" - AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}" - AWS_TEST_FARM_PEM: "${{ secrets.AWS_TEST_FARM_PEM }}" - PIP_USE_PEP517: "${{ matrix.PIP_USE_PEP517 }}" - TOXENV: "${{ matrix.TOXENV }}" - - name: Upload coverage - uses: "./.github/actions/upload_coverage" + uses: "./.github/workflows/tox_steps.yml" + with: + PYTHON_VERSION: "${{ matrix.PYTHON_VERSION }}" + TOXENV: "${{ matrix.TOXENV }}" + uploadCoverage: "${{ inputs.uploadCoverage }}" + IMAGE_NAME: "${{ matrix.IMAGE_NAME }}" + test_name: "extended_test" diff --git a/.github/workflows/standard_tests_jobs.yml b/.github/workflows/standard_tests_jobs.yml index 4d1b2a3d9..12f3f86b9 100644 --- a/.github/workflows/standard_tests_jobs.yml +++ b/.github/workflows/standard_tests_jobs.yml @@ -9,7 +9,6 @@ on: default: false jobs: test: - name: test ${{ inputs.IMAGE_NAME }}-${{ inputs.TOXENV }} permissions: contents: read strategy: @@ -44,6 +43,7 @@ jobs: TOXENV: "${{ matrix.TOXENV }}" uploadCoverage: "${{ inputs.uploadCoverage }}" IMAGE_NAME: "${{ matrix.IMAGE_NAME }}" + test_name: "test" test_sphinx_builds: permissions: contents: read diff --git a/.github/workflows/tox_steps.yml b/.github/workflows/tox_steps.yml index a7bd7ac5d..f6e4e2c06 100644 --- a/.github/workflows/tox_steps.yml +++ b/.github/workflows/tox_steps.yml @@ -23,12 +23,15 @@ on: AWS_TEST_FARM_PEM: description: 'contents of AWS PEM file to be placed in $AWS_EC2_PEM_FILE from environment' type: string + test_name: + type: string env: uploadCoverage: ${{ inputs.uploadCoverage }} jobs: tox_all: + name: ${{ inputs.test_name }} ${{ inputs.IMAGE_NAME }}-${{ inputs.TOXENV }} runs-on: - "${{ inputs.IMAGE_NAME }}" steps: