-
Notifications
You must be signed in to change notification settings - Fork 47
162 lines (134 loc) · 4.52 KB
/
Copy pathtest.yml
File metadata and controls
162 lines (134 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: test
on:
push:
branches:
- "main"
- "test-me-*"
pull_request:
branches:
- "main"
workflow_dispatch:
# Cancel running jobs for the same workflow and branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build and Check Package
uses: hynek/build-and-inspect-python-package@v2.18
test:
needs: [package]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-latest ]
python: [ "3.10", "3.11", "3.12", "3.13", "3.14", "pypy-3.11" ]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Download Package
uses: actions/download-artifact@v8
with:
name: Packages
path: dist
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: pip install tox twine
- name: Check package
shell: bash
run: |
twine check --strict dist/*
- name: Test
shell: bash
run: |
tox run -e py --installpkg `find dist/*.tar.gz`
# pytest-xdist drives execnet's local parallel testing: popen gateways,
# the main-thread worker profile, crashed-worker replacement, and the
# report/warning serialization. Our own suite runs xdist as a *tool*,
# which does not exercise any of that -- so run xdist's own test suite
# against the execnet built from this branch.
#
# Two targets:
#
# * `release` is a pinned combination known to be green against the last
# *released* execnet, so a failure there means we broke something. It
# blocks. Bump `ref`/`pytest` together, and only after checking the new
# pair is green against released execnet -- otherwise the signal is
# gone. (xdist 3.8.0 needs pytest<9: with pytest 9 two of its tests
# fail against released execnet too.)
# * `default-branch` is early warning for drift on both sides. It is
# allowed to fail, because it can go red for reasons that are xdist's
# to fix. An empty `ref` follows whatever xdist's default branch is
# (`master` today) rather than hardcoding a name that could change.
#
# To reproduce locally:
# git clone https://github.com/pytest-dev/pytest-xdist
# git -C pytest-xdist checkout v3.8.0 # or stay on the default branch
# python -m venv .xdist-venv
# .xdist-venv/bin/pip install ./pytest-xdist[testing] "pytest<9" .
# cd pytest-xdist && ../.xdist-venv/bin/python -m pytest
xdist:
needs: [package]
runs-on: ubuntu-latest
name: xdist (${{ matrix.name }})
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- name: release
ref: "v3.8.0"
pytest: "pytest<9"
experimental: false
- name: default-branch
ref: ""
pytest: "pytest"
experimental: true
steps:
- uses: actions/checkout@v7
with:
path: execnet
- uses: actions/checkout@v7
with:
repository: pytest-dev/pytest-xdist
ref: ${{ matrix.ref }}
path: pytest-xdist
- name: Download Package
uses: actions/download-artifact@v8
with:
name: Packages
path: dist
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Install pytest-xdist and this execnet
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install "./pytest-xdist[testing]" "${{ matrix.pytest }}"
# after xdist, so its execnet>=2.1 requirement does not win
python -m pip install --force-reinstall `find dist/*.tar.gz`
python -c "import execnet, xdist; print('execnet', execnet.__version__)"
- name: Run the pytest-xdist test suite
shell: bash
working-directory: pytest-xdist
run: |
deselect=()
# `|| [ -n "$line" ]` so a file without a trailing newline still
# contributes its last entry
while read -r line || [ -n "$line" ]; do
line="${line%%#*}"
line="$(echo "$line" | xargs)"
[ -n "$line" ] && deselect+=(--deselect "$line")
done < ../execnet/.github/xdist-known-failures.txt
printf 'deselecting %d known failure(s)\n' $(( ${#deselect[@]} / 2 ))
python -m pytest -ra "${deselect[@]}"