2323 # - rustpython-compiler-source: deprecated
2424 # - rustpython-venvlauncher: Windows-only
2525 WORKSPACE_EXCLUDES : --exclude rustpython_wasm --exclude rustpython-compiler-source --exclude rustpython-venvlauncher
26- # Skip additional tests on Windows. They are checked on Linux and MacOS.
27- # test_glob: many failing tests
28- # test_pathlib: panic by surrogate chars
29- # test_posixpath: OSError: (22, 'The filename, directory name, or volume label syntax is incorrect. (os error 123)')
30- # test_venv: couple of failing tests
31- WINDOWS_SKIPS : >-
32- test_rlcompleter
33- test_pathlib
34- test_posixpath
35- test_venv
36- # PLATFORM_INDEPENDENT_TESTS are tests that do not depend on the underlying OS. They are currently
37- # only run on Linux to speed up the CI.
38- PLATFORM_INDEPENDENT_TESTS : >-
39- test__colorize
40- test_array
41- test_asyncgen
42- test_binop
43- test_bisect
44- test_bool
45- test_bytes
46- test_call
47- test_class
48- test_cmath
49- test_collections
50- test_complex
51- test_contains
52- test_copy
53- test_dataclasses
54- test_decimal
55- test_decorators
56- test_defaultdict
57- test_deque
58- test_dict
59- test_dictcomps
60- test_dictviews
61- test_dis
62- test_enumerate
63- test_exception_variations
64- test_float
65- test_format
66- test_fractions
67- test_genericalias
68- test_genericclass
69- test_grammar
70- test_range
71- test_index
72- test_int
73- test_int_literal
74- test_isinstance
75- test_iter
76- test_iterlen
77- test_itertools
78- test_json
79- test_keyword
80- test_keywordonlyarg
81- test_list
82- test_long
83- test_longexp
84- test_math
85- test_operator
86- test_ordered_dict
87- test_pep646_syntax
88- test_pow
89- test_raise
90- test_richcmp
91- test_scope
92- test_set
93- test_slice
94- test_sort
95- test_string
96- test_string_literals
97- test_strtod
98- test_structseq
99- test_subclassinit
100- test_super
101- test_syntax
102- test_tstring
103- test_tuple
104- test_types
105- test_unary
106- test_unpack
107- test_unpack_ex
108- test_weakref
109- test_yield_from
110- ENV_POLLUTING_TESTS_COMMON : >-
111- ENV_POLLUTING_TESTS_LINUX : >-
112- ENV_POLLUTING_TESTS_MACOS : >-
113- ENV_POLLUTING_TESTS_WINDOWS : >-
11426 # Python version targeted by the CI.
11527 PYTHON_VERSION : " 3.14.3"
11628 X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR : C:\Program Files\OpenSSL\lib\VC\x64\MD
@@ -264,22 +176,116 @@ jobs:
264176 if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
265177 env :
266178 RUST_BACKTRACE : full
179+ # PLATFORM_INDEPENDENT_TESTS are tests that do not depend on the underlying OS.
180+ # They are currently only run on Linux to speed up the CI.
181+ PLATFORM_INDEPENDENT_TESTS : >-
182+ test__colorize
183+ test_array
184+ test_asyncgen
185+ test_binop
186+ test_bisect
187+ test_bool
188+ test_bytes
189+ test_call
190+ test_class
191+ test_cmath
192+ test_collections
193+ test_complex
194+ test_contains
195+ test_copy
196+ test_dataclasses
197+ test_decimal
198+ test_decorators
199+ test_defaultdict
200+ test_deque
201+ test_dict
202+ test_dictcomps
203+ test_dictviews
204+ test_dis
205+ test_enumerate
206+ test_exception_variations
207+ test_float
208+ test_format
209+ test_fractions
210+ test_genericalias
211+ test_genericclass
212+ test_grammar
213+ test_range
214+ test_index
215+ test_int
216+ test_int_literal
217+ test_isinstance
218+ test_iter
219+ test_iterlen
220+ test_itertools
221+ test_json
222+ test_keyword
223+ test_keywordonlyarg
224+ test_list
225+ test_long
226+ test_longexp
227+ test_math
228+ test_operator
229+ test_ordered_dict
230+ test_pep646_syntax
231+ test_pow
232+ test_raise
233+ test_richcmp
234+ test_scope
235+ test_set
236+ test_slice
237+ test_sort
238+ test_string
239+ test_string_literals
240+ test_strtod
241+ test_structseq
242+ test_subclassinit
243+ test_super
244+ test_syntax
245+ test_tstring
246+ test_tuple
247+ test_types
248+ test_unary
249+ test_unpack
250+ test_unpack_ex
251+ test_weakref
252+ test_yield_from
267253 name : Run snippets and cpython tests
268254 runs-on : ${{ matrix.os }}
269255 strategy :
270256 matrix :
271- os :
272- - macos-latest
273- - ubuntu-latest
274- - windows-2025
257+ include :
258+ - os : macos-latest
259+ extra_test_args :
260+ - ' -u all'
261+ env_polluting_tests : []
262+ skips : []
263+ timeout : 50
264+ - os : ubuntu-latest
265+ extra_test_args :
266+ - ' -u all'
267+ env_polluting_tests : []
268+ skips : []
269+ timeout : 60
270+ - os : windows-2025
271+ extra_test_args : [] # TODO: Enable '-u all'
272+ env_polluting_tests : []
273+ skips :
274+ - test_rlcompleter
275+ - test_pathlib # panic by surrogate chars
276+ - test_posixpath # OSError: (22, 'The filename, directory name, or volume label syntax is incorrect. (os error 123)')
277+ - test_venv # couple of failing tests
278+ timeout : 50
275279 fail-fast : false
276280 steps :
277281 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
278282 with :
279283 persist-credentials : false
280284
281285 - uses : dtolnay/rust-toolchain@stable
286+
282287 - uses : Swatinem/rust-cache@v2
288+
283289 - uses : actions/setup-python@v6.2.0
284290 with :
285291 python-version : ${{ env.PYTHON_VERSION }}
@@ -296,39 +302,25 @@ jobs:
296302 run : python -m pip install -r requirements.txt && pytest -v
297303 working-directory : ./extra_tests
298304
299- - if : runner.os == 'Linux'
300- name : run cpython platform-independent tests
301- env :
302- RUSTPYTHON_SKIP_ENV_POLLUTERS : true
303- run : target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v ${{ env.PLATFORM_INDEPENDENT_TESTS }}
305+ - name : run cpython platform-independent tests
306+ if : runner.os == 'Linux'
307+ run : |
308+ target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v ${{ env.PLATFORM_INDEPENDENT_TESTS }}
304309 timeout-minutes : 45
305-
306- - if : runner.os == 'Linux'
307- name : run cpython platform-dependent tests (Linux)
308- env :
309- RUSTPYTHON_SKIP_ENV_POLLUTERS : true
310- run : target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
311- timeout-minutes : 60
312-
313- - if : runner.os == 'macOS'
314- name : run cpython platform-dependent tests (MacOS)
315310 env :
316311 RUSTPYTHON_SKIP_ENV_POLLUTERS : true
317- run : target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
318- timeout-minutes : 50
319312
320- - if : runner.os == 'Windows'
321- name : run cpython platform-dependent tests (windows partial - fixme)
313+ - name : run cpython platform-dependent tests
314+ run : |
315+ target/release/rustpython -m test -j 1 ${{ join(matrix.extra_test_args, ' ') }} --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ join(matrix.skips, ' ') }}
316+ timeout-minutes : ${{ matrix.timeout }}
322317 env :
323318 RUSTPYTHON_SKIP_ENV_POLLUTERS : true
324- run : target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }}
325- timeout-minutes : 50
326319
327- - if : runner.os == 'Linux'
328- name : run cpython tests to check if env polluters have stopped polluting (Common/Linux)
320+ - name : run cpython tests to check if env polluters have stopped polluting
329321 shell : bash
330322 run : |
331- for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_LINUX }}; do
323+ for thing in ${{ join(matrix.env_polluting_tests, ' ') }}; do
332324 for i in $(seq 1 10); do
333325 set +e
334326 target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
@@ -341,63 +333,7 @@ jobs:
341333 done
342334 if [ ${exit_code} -ne 3 ]; then
343335 echo "Test ${thing} is no longer polluting the environment after ${i} attempts!"
344- echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_LINUX in '.github/workflows/ci.yaml'."
345- echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}."
346- if [ ${exit_code} -ne 0 ]; then
347- echo "Test ${thing} failed with exit code ${exit_code}."
348- echo "Please investigate which test item in ${thing} is failing and either mark it as an expected failure or a skip."
349- fi
350- exit 1
351- fi
352- done
353- timeout-minutes : 15
354-
355- - if : runner.os == 'macOS'
356- name : run cpython tests to check if env polluters have stopped polluting (Common/macOS)
357- shell : bash
358- run : |
359- for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_MACOS }}; do
360- for i in $(seq 1 10); do
361- set +e
362- target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
363- exit_code=$?
364- set -e
365- if [ ${exit_code} -eq 3 ]; then
366- echo "Test ${thing} polluted the environment on attempt ${i}."
367- break
368- fi
369- done
370- if [ ${exit_code} -ne 3 ]; then
371- echo "Test ${thing} is no longer polluting the environment after ${i} attempts!"
372- echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_MACOS in '.github/workflows/ci.yaml'."
373- echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}."
374- if [ ${exit_code} -ne 0 ]; then
375- echo "Test ${thing} failed with exit code ${exit_code}."
376- echo "Please investigate which test item in ${thing} is failing and either mark it as an expected failure or a skip."
377- fi
378- exit 1
379- fi
380- done
381- timeout-minutes : 15
382-
383- - if : runner.os == 'Windows'
384- name : run cpython tests to check if env polluters have stopped polluting (Common/windows)
385- shell : bash
386- run : |
387- for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_WINDOWS }}; do
388- for i in $(seq 1 10); do
389- set +e
390- target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
391- exit_code=$?
392- set -e
393- if [ ${exit_code} -eq 3 ]; then
394- echo "Test ${thing} polluted the environment on attempt ${i}."
395- break
396- fi
397- done
398- if [ ${exit_code} -ne 3 ]; then
399- echo "Test ${thing} is no longer polluting the environment after ${i} attempts!"
400- echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_WINDOWS in '.github/workflows/ci.yaml'."
336+ echo "Please remove ${thing} from matrix.env_polluting_tests in '.github/workflows/ci.yaml'."
401337 echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}."
402338 if [ ${exit_code} -ne 0 ]; then
403339 echo "Test ${thing} failed with exit code ${exit_code}."
@@ -414,10 +350,12 @@ jobs:
414350 mkdir site-packages
415351 target/release/rustpython --install-pip ensurepip --user
416352 target/release/rustpython -m pip install six
353+
417354 - name : Check that ensurepip succeeds.
418355 run : |
419356 target/release/rustpython -m ensurepip
420357 target/release/rustpython -c "import pip"
358+
421359 - if : runner.os != 'Windows'
422360 name : Check if pip inside venv is functional
423361 run : |
0 commit comments