From 06b0093f90fe9c5827c4314484186fbdc5a71d70 Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Wed, 14 Sep 2022 16:34:49 +0100 Subject: [PATCH 1/4] Initial run on macOS on GHA. --- .github/workflows/test.yaml | 7 ++- azure-pipelines/macos_test_jobs.yml | 23 -------- azure-pipelines/run_test_steps.yml | 86 ---------------------------- azure-pipelines/tests_pipeline.yml | 33 ----------- src/twisted/newsfragments/11664.misc | 0 5 files changed, 6 insertions(+), 143 deletions(-) delete mode 100644 azure-pipelines/macos_test_jobs.yml delete mode 100644 azure-pipelines/run_test_steps.yml delete mode 100644 azure-pipelines/tests_pipeline.yml create mode 100644 src/twisted/newsfragments/11664.misc diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b5e5a78f221..e10c9cde747 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -122,6 +122,11 @@ jobs: # Just Python 3.9 with default settings. - python-version: '3.9' + # newest macOS and newest Python supported version. + - python-version: '3.10' + runs-on: 'macos-12' + job-name: 'macos-default-tests' + # Windows, minimum Python version with select reactor. - python-version: '3.7' runs-on: 'windows-2022' @@ -225,7 +230,7 @@ jobs: # If one of the above steps fails, fire up tmate for remote debugging. # This is fired for manual trigger or via the environment variable. - name: Tmate debug session - if: ${{ !cancelled() && (env.TMATE_DEBUG == 'yes' || github.event_name == 'workflow_dispatch' && inputs.debug_enabled ) }} + if: ${{ failure() && (env.TMATE_DEBUG == 'yes' || github.event_name == 'workflow_dispatch' && inputs.debug_enabled ) }} uses: mxschmitt/action-tmate@v3 with: limit-access-to-actor: true diff --git a/azure-pipelines/macos_test_jobs.yml b/azure-pipelines/macos_test_jobs.yml deleted file mode 100644 index 0dd96a51f66..00000000000 --- a/azure-pipelines/macos_test_jobs.yml +++ /dev/null @@ -1,23 +0,0 @@ -# -# This is just a template, and not a main pipeline definition. -# -parameters: -- name: imageName - type: string - default: 'macOS-latest' -# Must be a mapping of id-suitable-name -> actual version number with dot -- name: pythonVersions - type: object - - -jobs: -- ${{ each pyver in parameters.pythonVersions }}: - - job: ${{ format('macos_{0}', pyver.key) }} - displayName: ${{ format('MacOS Py{0}', pyver.value) }} - pool: - vmImage: ${{ parameters.imageName }} - steps: - - template: 'run_test_steps.yml' - parameters: - platform: macos - pythonVersion: ${{ pyver.value }} diff --git a/azure-pipelines/run_test_steps.yml b/azure-pipelines/run_test_steps.yml deleted file mode 100644 index 039d2c7dbe7..00000000000 --- a/azure-pipelines/run_test_steps.yml +++ /dev/null @@ -1,86 +0,0 @@ -# -# This is just a template, and not a main pipeline definition. -# -parameters: - -- name: platform - type: string - values: - - macos - - windows - -- name: pythonVersion - type: string - values: - - '3.7' - - '3.8' - - '3.9' - - '3.10' - -- name: windowsReactor - type: string - default: select - values: - - select - - iocp - -- name: allowFailure - type: boolean - default: false - -steps: -- checkout: self - clean: true - # A minimum depth of 2 is required, as the HEAD is the auto-merge commit - # and we need the last commit from the PR to report the coverage. - fetchDepth: 2 - -- task: UsePythonVersion@0 - displayName: "Use Python ${{ parameters.pythonVersion }}" - inputs: - versionSpec: "${{ parameters.pythonVersion }}" - -- script: | - python --version - python -c "import sys; print(sys.prefix)" - python -c "import sys; print(sys.exec_prefix)" - python -c "import sys; print(sys.executable)" - python -c "import struct; print(struct.calcsize('P') * 8)" - python -c "print('\nENVIRONMENT VARIABLES\n=====================\n\n')" - python -c "import os; [ print(e,v) for (e,v) in os.environ.items() ]" - displayName: 'Get Python Information' - -- script: 'python -m pip install -U pip setuptools tox coverage coveralls' - displayName: 'Update pip & install tox' - -- ${{ if eq(parameters.platform, 'macos') }}: - - script: 'python -m tox -e alldeps-withcov-posix' - displayName: 'Run tests' - continueOnError: ${{ parameters.allowFailure }} - env: - TRIAL_ARGS: "-j 4" - -- ${{ if eq(parameters.platform, 'windows') }}: - - script: 'python -m tox -e alldeps-withcov-windows' - displayName: 'Run tests' - continueOnError: ${{ parameters.allowFailure }} - env: - TRIAL_ARGS: --reactor=${{ parameters.windowsReactor }} - -- bash: | - # sub-process coverage are generated in separate files so we combine them - # to get an unified coverage for the local run. - # The XML is generate to be used with 3rd party tools like diff-cover. - python -m coverage combine - python -m coverage xml -o coverage.xml -i - python -m coverage report - - displayName: 'Prepare coverage' - condition: always() - continueOnError: true - -- bash: | - bash <(curl -s https://codecov.io/bash) -X search -X gcov -f coverage.xml -n "${{ parameters.platform }}-${{ parameters.pythonVersion }}" - displayName: 'Report to Codecov' - condition: always() - continueOnError: true diff --git a/azure-pipelines/tests_pipeline.yml b/azure-pipelines/tests_pipeline.yml deleted file mode 100644 index c07ac11b31c..00000000000 --- a/azure-pipelines/tests_pipeline.yml +++ /dev/null @@ -1,33 +0,0 @@ -# -# This is the main pipeline enabled in Azure DevOps -# To update the name of this file you will need admin access to Azure. -# -# If the status failed to be reported, check the logs at -# https://dev.azure.com/twistedmatrix/twisted/_build?view=runs -# -# Click on the PR description for more details. -# Don't clock on the icon from the "Stages" column -# -trigger: - batch: true - branches: - include: - - trunk - -pr: - branches: - include: - - trunk - -variables: - INFRASTRUCTURE: "AZUREPIPELINES" - TRIAL_REPORTER: "verbose" - CI: "true" - -jobs: - -# Keep MacOS to latest CPython that we support. -- template: 'macos_test_jobs.yml' - parameters: - pythonVersions: - py39: "3.10" diff --git a/src/twisted/newsfragments/11664.misc b/src/twisted/newsfragments/11664.misc new file mode 100644 index 00000000000..e69de29bb2d From 6091eac53783d8b9001bdec2ff11883e7a363934 Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Wed, 14 Sep 2022 17:24:00 +0100 Subject: [PATCH 2/4] Run tests on older macos and python. --- .github/workflows/test.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e10c9cde747..1b926c147e6 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -122,7 +122,12 @@ jobs: # Just Python 3.9 with default settings. - python-version: '3.9' - # newest macOS and newest Python supported version. + # Oldest macOS and olders Python supported versions. + - python-version: '3.7' + runs-on: 'macos-10.15' + job-name: 'macos-default-tests' + + # Newest macOS and newest Python supported versions. - python-version: '3.10' runs-on: 'macos-12' job-name: 'macos-default-tests' From 67355c86b4dcc310caac4ebd48cfc7d8fcc34993 Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Wed, 14 Sep 2022 17:31:20 +0100 Subject: [PATCH 3/4] Add macos version to job name. --- .github/workflows/test.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 1b926c147e6..19b818c136b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -125,12 +125,12 @@ jobs: # Oldest macOS and olders Python supported versions. - python-version: '3.7' runs-on: 'macos-10.15' - job-name: 'macos-default-tests' + job-name: 'macos-10-default-tests' # Newest macOS and newest Python supported versions. - python-version: '3.10' runs-on: 'macos-12' - job-name: 'macos-default-tests' + job-name: 'macos-12-default-tests' # Windows, minimum Python version with select reactor. - python-version: '3.7' From 45989d3adb9d53042fa87fc5c8edd4e2f6d8babb Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Wed, 14 Sep 2022 17:48:56 +0100 Subject: [PATCH 4/4] Try to see 3.7.12 works on macos. --- .github/workflows/test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 19b818c136b..4cb3a750e4e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -123,7 +123,9 @@ jobs: - python-version: '3.9' # Oldest macOS and olders Python supported versions. - - python-version: '3.7' + # We pin a specific Python micro release due to a TK library bug. + # https://github.com/actions/setup-python/issues/402#issuecomment-1156015780 + - python-version: '3.7.12' runs-on: 'macos-10.15' job-name: 'macos-10-default-tests'