New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#11628 Run Windows CI tests on GitHub Actions. #11629
Conversation
2f6019a
to
8403983
Compare
8403983
to
4f93bcb
Compare
0544907
to
4e0a75a
Compare
701c4c8
to
eed44da
Compare
…ut on windows. Add debug action.
eed44da
to
4896d48
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready for an initial review
A previous run at https://github.com/twisted/twisted/runs/8099083260?check_suite_focus=true
needs-review
# Set to 'yes' to open a tunnel to GitHub's VMs through tmate on failures. | ||
# Also increase timeout-minutes for the relevant OS when debugging remotely | ||
# and you need a longer session. | ||
TMATE_DEBUG: 'no' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only want to enable tmate when we are to start a debug session...and not on any failure.
tmate is only triggered on failure
.github/workflows/test.yaml
Outdated
runs-on: ubuntu-20.04 | ||
name: ${{ matrix.python-version }}-${{ matrix.job-name || 'lnx-default-tests' }} | ||
# We have Ubuntu as the base for running agains multiple Python versions. | ||
runs-on: "${{ matrix.runs-on || 'ubuntu-20.04'}}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the 'ubuntu-20.04' is not explicitly defined in the matrix so that we don't have to repeat it each time we extend it.
We leave it empty and use a default value.
Another option is to define the default values via global environment variables.
env:
DEFAULT_RUNS_ON: 'ubuntu-22.04'
jobs:
testing:
runs-on: "${{ matrix.runs-on || 'env.DEFAULT_RUNS_ON'}}"
please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks (and for talking me through it on IRC too)! This looks like a great start. I pointed out a few minor things inline.
.github/workflows/test.yaml
Outdated
@@ -1,5 +1,9 @@ | |||
# Try to get a short workflow name and a job name that start with Python | |||
# version to make it easier to check the status inside GitHub UI. | |||
# | |||
# When using external actions check that the extenral repos are permitted via |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo in "external" here
.github/workflows/test.yaml
Outdated
|
||
jobs: | ||
testing: | ||
runs-on: ubuntu-20.04 | ||
name: ${{ matrix.python-version }}-${{ matrix.job-name || 'lnx-default-tests' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "linux" will be more clear in the UI than "lnx" and I don't think the extra 2 letters will make the names so long it becomes a problem.
.github/workflows/test.yaml
Outdated
@@ -48,14 +72,34 @@ jobs: | |||
tox-wrapper: [''] | |||
# Tests are executed with the default target which is the full test suite. | |||
trial-target: [''] | |||
# By default the coverate is not skipped. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in "coverage" here
.github/workflows/test.yaml
Outdated
trial-target: twisted.test.test_compat twisted.test.test_defer twisted.internet.test.test_socket twisted.trial.test.test_tests | ||
job-name: 'pypy-coverage' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We get some redundancy in the name from this - eg "pypy-3.7-alldeps-nocov-posix". Maybe 'coverage'
would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. I went for explicit 'with-coverage'
.github/workflows/test.yaml
Outdated
@@ -139,8 +191,15 @@ jobs: | |||
run: | | |||
${{ matrix.tox-wrapper }} tox ${{ matrix.trial-target }} | |||
|
|||
# If one of the above steps fails, fire up tmate for remote debugging. | |||
- name: Tmate debug on failure | |||
if: ${{ !cancelled() && env.TMATE_DEBUG == 'yes' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow for using this action, then, will be to change TMATE_DEBUG
at the top of the file to 'yes'
and re-run the build, then change it back to 'no'
again afterwards?
I guess there's a good reason not to have it turned on all the time? https://github.com/mxschmitt/action-tmate#manually-triggered-debug looks like a slightly nicer workflow, maybe it's not too much more work to do it that way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, editing the text was easier than using the Github action manual workflow trigger.
It is true that you can forget to set it back to no
afterward.
You don't want it turned on all the time, as then on failure it will "hang" and wait for someone to connect via SSH.
I will push a commit that will also add manual triggers.
Not sure what are the permissions for manual triggers... that is, if you can trigger from a fork.
eec397c
to
08418b2
Compare
08418b2
to
f5662eb
Compare
I hope I have addressed all the comments. please review |
05e5c85
to
528c3a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! This looks quite good. I left some minor suggestions inline. Take them if you like.
One thing I was not able to do was convince myself that 3.7-win-default-tests-select
is actually running the tests against Python 3.7 and 3.10-win-default-tests-iocp
is testing with Python 3.10. Can you point at anything in the logs that reveals this? Or maybe add something to the CI jobs somewhere that makes this clear. Then I'm happy to see this merged.
.github/workflows/test.yaml
Outdated
- python-version: pypy-3.7 | ||
tox-env: alldeps-nocov-posix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- python-version: pypy-3.7 | |
tox-env: alldeps-nocov-posix | |
- python-version: 'pypy-3.7' | |
tox-env: 'alldeps-nocov-posix' |
.github/workflows/test.yaml
Outdated
- python-version: pypy-3.7 | ||
tox-env: alldeps-withcov-posix | ||
trial-target: twisted.test.test_compat twisted.test.test_defer twisted.internet.test.test_socket twisted.trial.test.test_tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- python-version: pypy-3.7 | |
tox-env: alldeps-withcov-posix | |
trial-target: twisted.test.test_compat twisted.test.test_defer twisted.internet.test.test_socket twisted.trial.test.test_tests | |
- python-version: 'pypy-3.7' | |
trial-target: 'twisted.test.test_compat twisted.test.test_defer twisted.internet.test.test_socket twisted.trial.test.test_tests' |
type: boolean | ||
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | ||
required: false | ||
default: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool. No doubt the only way to know if this actually works is to merge the PR and then try clicking buttons on GitHub Actions ... I'll certainly try that out as soon as this lands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The GitHub UI is updated only after merge.
But you try the TMATE_DEBUG: 'yes'
version.
That version is also ok for debugging the process itself.
So if the UI trigger doesn't work, you can force tmate.
Thanks for the review. I will get this merged. I saw a codecov failure ... so macOS should be next, and then try to run coverage report on GHA. When tox runs, in any environment, local or remote-ci you will see the python version See the link https://github.com/twisted/twisted/runs/8102345847?check_suite_focus=true#step:10:36 tox code at Lines 86 to 91 in 26c3c04
Local run is something like this $ tox -e alldeps-nocov
alldeps-nocov wheel-make: cleaning up build directory ...
alldeps-nocov wheel-make: commands[0] | pip wheel /home/adi/chevah/twisted --no-deps --use-pep517 --wheel-dir /home/adi/chevah/twisted/.tox/dist
Processing /home/adi/chevah/twisted
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: Twisted
Building wheel for Twisted (pyproject.toml) ... done
Created wheel for Twisted: filename=Twisted-22.4.0.post0-py3-none-any.whl size=3102521
- [SNIP}
alldeps-nocov run-test-pre: PYTHONHASHSEED='544835508'
alldeps-nocov run-test: commands[0] | python /home/adi/chevah/twisted/admin/dump_all_version_info.py
+::group::Python info
+/home/adi/chevah/twisted/.tox/alldeps-nocov
+/home/adi/chevah/twisted/.tox/alldeps-nocov
+/home/adi/chevah/twisted/.tox/alldeps-nocov/bin/python
+3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]
+linux
+::endgroup::
alldeps-nocov run-test: commands[1] | python -m twisted.trial --temp-directory=/home/adi/chevah/twisted/.tox/alldeps-nocov/tmp/_trial_temp --reporter=verbose twisted |
.github/workflows/test.yaml
Outdated
|
||
# On PYPY coverage is very slow (5min vs 30min) as there is no C | ||
# extension. | ||
# There is very little PYPY specific code so there is not much to | ||
# gain from reporting coverage. | ||
- python-version: pypy-3.7 | ||
tox-env: alldeps-nocov-posix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# On PYPY coverage is very slow (5min vs 30min) as there is no C | |
# extension. | |
# There is very little PYPY specific code so there is not much to | |
# gain from reporting coverage. | |
- python-version: pypy-3.7 | |
tox-env: alldeps-nocov-posix | |
# On PYPY coverage is very slow (5min vs 30min) as there is no C | |
# extension. | |
# There is very little PYPY specific code so there is not much to | |
# gain from reporting coverage. | |
- python-version: 'pypy-3.7' | |
tox-env: 'alldeps-nocov-posix' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. This goes to the "delete-lines" and can't be applied by github.
Will manually apply it.
Co-authored-by: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Scope and purpose
Fixes #11628
See inline comments.
Besides enabling the Windows tests I have also enabled tmate to allow debugging Windows.
This is the main reason why I have moved the Windows tests to GHA.