Skip to content

Commit 36fed7d

Browse files
committed
cleanup
1 parent 430eb5f commit 36fed7d

File tree

1 file changed

+107
-173
lines changed

1 file changed

+107
-173
lines changed

.github/workflows/ci.yaml

Lines changed: 107 additions & 173 deletions
Original file line numberDiff line numberDiff line change
@@ -23,94 +23,6 @@ env:
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
@@ -261,19 +173,109 @@ jobs:
261173
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }}
262174
env:
263175
RUST_BACKTRACE: full
176+
# PLATFORM_INDEPENDENT_TESTS are tests that do not depend on the underlying OS.
177+
# They are currently only run on Linux to speed up the CI.
178+
PLATFORM_INDEPENDENT_TESTS: >-
179+
test__colorize
180+
test_array
181+
test_asyncgen
182+
test_binop
183+
test_bisect
184+
test_bool
185+
test_bytes
186+
test_call
187+
test_class
188+
test_cmath
189+
test_collections
190+
test_complex
191+
test_contains
192+
test_copy
193+
test_dataclasses
194+
test_decimal
195+
test_decorators
196+
test_defaultdict
197+
test_deque
198+
test_dict
199+
test_dictcomps
200+
test_dictviews
201+
test_dis
202+
test_enumerate
203+
test_exception_variations
204+
test_float
205+
test_format
206+
test_fractions
207+
test_genericalias
208+
test_genericclass
209+
test_grammar
210+
test_range
211+
test_index
212+
test_int
213+
test_int_literal
214+
test_isinstance
215+
test_iter
216+
test_iterlen
217+
test_itertools
218+
test_json
219+
test_keyword
220+
test_keywordonlyarg
221+
test_list
222+
test_long
223+
test_longexp
224+
test_math
225+
test_operator
226+
test_ordered_dict
227+
test_pep646_syntax
228+
test_pow
229+
test_raise
230+
test_richcmp
231+
test_scope
232+
test_set
233+
test_slice
234+
test_sort
235+
test_string
236+
test_string_literals
237+
test_strtod
238+
test_structseq
239+
test_subclassinit
240+
test_super
241+
test_syntax
242+
test_tstring
243+
test_tuple
244+
test_types
245+
test_unary
246+
test_unpack
247+
test_unpack_ex
248+
test_weakref
249+
test_yield_from
264250
name: Run snippets and cpython tests
265251
runs-on: ${{ matrix.os }}
266252
strategy:
267253
matrix:
268-
os:
269-
- macos-latest
270-
- ubuntu-latest
271-
- windows-2025
254+
include:
255+
- os: macos-latest
256+
env_polluting_tests: []
257+
skips: []
258+
timeout: 50
259+
- os: ubuntu-latest
260+
env_polluting_tests: []
261+
skips: []
262+
timeout: 60
263+
- os: windows-2025
264+
env_polluting_tests: []
265+
skips:
266+
- test_rlcompleter
267+
- test_pathlib # panic by surrogate chars
268+
- test_posixpath # OSError: (22, 'The filename, directory name, or volume label syntax is incorrect. (os error 123)')
269+
- test_venv # couple of failing tests
270+
timeout: 50
272271
fail-fast: false
273272
steps:
274273
- uses: actions/checkout@v6
274+
275275
- uses: dtolnay/rust-toolchain@stable
276+
276277
- uses: Swatinem/rust-cache@v2
278+
277279
- uses: actions/setup-python@v6.2.0
278280
with:
279281
python-version: ${{ env.PYTHON_VERSION }}
@@ -290,95 +292,25 @@ jobs:
290292
run: python -m pip install -r requirements.txt && pytest -v
291293
working-directory: ./extra_tests
292294

293-
- if: runner.os == 'Linux'
294-
name: run cpython platform-independent tests
295-
env:
296-
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
297-
run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v ${{ env.PLATFORM_INDEPENDENT_TESTS }}
295+
- name: run cpython platform-independent tests
296+
if: runner.os == 'Linux'
297+
run: |
298+
target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v ${{ env.PLATFORM_INDEPENDENT_TESTS }}
298299
timeout-minutes: 45
299-
300-
- if: runner.os == 'Linux'
301-
name: run cpython platform-dependent tests (Linux)
302-
env:
303-
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
304-
run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
305-
timeout-minutes: 60
306-
307-
- if: runner.os == 'macOS'
308-
name: run cpython platform-dependent tests (MacOS)
309300
env:
310301
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
311-
run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }}
312-
timeout-minutes: 50
313302

314-
- if: runner.os == 'Windows'
315-
name: run cpython platform-dependent tests (windows partial - fixme)
303+
- name: run cpython platform-dependent tests
304+
run: |
305+
target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ join(matrix.skips, ' ') }}
306+
timeout-minutes: ${{ matrix.timeout }}
316307
env:
317308
RUSTPYTHON_SKIP_ENV_POLLUTERS: true
318-
run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }}
319-
timeout-minutes: 50
320-
321-
- if: runner.os == 'Linux'
322-
name: run cpython tests to check if env polluters have stopped polluting (Common/Linux)
323-
shell: bash
324-
run: |
325-
for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_LINUX }}; do
326-
for i in $(seq 1 10); do
327-
set +e
328-
target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
329-
exit_code=$?
330-
set -e
331-
if [ ${exit_code} -eq 3 ]; then
332-
echo "Test ${thing} polluted the environment on attempt ${i}."
333-
break
334-
fi
335-
done
336-
if [ ${exit_code} -ne 3 ]; then
337-
echo "Test ${thing} is no longer polluting the environment after ${i} attempts!"
338-
echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_LINUX in '.github/workflows/ci.yaml'."
339-
echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}."
340-
if [ ${exit_code} -ne 0 ]; then
341-
echo "Test ${thing} failed with exit code ${exit_code}."
342-
echo "Please investigate which test item in ${thing} is failing and either mark it as an expected failure or a skip."
343-
fi
344-
exit 1
345-
fi
346-
done
347-
timeout-minutes: 15
348-
349-
- if: runner.os == 'macOS'
350-
name: run cpython tests to check if env polluters have stopped polluting (Common/macOS)
351-
shell: bash
352-
run: |
353-
for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_MACOS }}; do
354-
for i in $(seq 1 10); do
355-
set +e
356-
target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
357-
exit_code=$?
358-
set -e
359-
if [ ${exit_code} -eq 3 ]; then
360-
echo "Test ${thing} polluted the environment on attempt ${i}."
361-
break
362-
fi
363-
done
364-
if [ ${exit_code} -ne 3 ]; then
365-
echo "Test ${thing} is no longer polluting the environment after ${i} attempts!"
366-
echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_MACOS in '.github/workflows/ci.yaml'."
367-
echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}."
368-
if [ ${exit_code} -ne 0 ]; then
369-
echo "Test ${thing} failed with exit code ${exit_code}."
370-
echo "Please investigate which test item in ${thing} is failing and either mark it as an expected failure or a skip."
371-
fi
372-
exit 1
373-
fi
374-
done
375-
timeout-minutes: 15
376309

377-
- if: runner.os == 'Windows'
378-
name: run cpython tests to check if env polluters have stopped polluting (Common/windows)
310+
- name: run cpython tests to check if env polluters have stopped polluting
379311
shell: bash
380312
run: |
381-
for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_WINDOWS }}; do
313+
for thing in ${{ join(matrix.env_polluting_tests, ' ') }}; do
382314
for i in $(seq 1 10); do
383315
set +e
384316
target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing}
@@ -391,7 +323,7 @@ jobs:
391323
done
392324
if [ ${exit_code} -ne 3 ]; then
393325
echo "Test ${thing} is no longer polluting the environment after ${i} attempts!"
394-
echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_WINDOWS in '.github/workflows/ci.yaml'."
326+
echo "Please remove ${thing} from matrix.env_polluting_tests in '.github/workflows/ci.yaml'."
395327
echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}."
396328
if [ ${exit_code} -ne 0 ]; then
397329
echo "Test ${thing} failed with exit code ${exit_code}."
@@ -408,10 +340,12 @@ jobs:
408340
mkdir site-packages
409341
target/release/rustpython --install-pip ensurepip --user
410342
target/release/rustpython -m pip install six
343+
411344
- name: Check that ensurepip succeeds.
412345
run: |
413346
target/release/rustpython -m ensurepip
414347
target/release/rustpython -c "import pip"
348+
415349
- if: runner.os != 'Windows'
416350
name: Check if pip inside venv is functional
417351
run: |

0 commit comments

Comments
 (0)