-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Update test/libregrtest to CPython 3.13.10
#6410
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
Changes from all commits
f297888
5d253d1
08762a3
f436c51
a8e7633
e4fb263
32fd6be
404836f
4c833fc
2789ff7
4a559f3
bedcb22
1f56a0f
c76e725
cadac34
8aafbf2
8d2b215
472c12c
17cc559
1827af1
e831124
3aa6bf8
34fe0f2
dc9475c
55c71aa
9500f66
99168e0
3427215
0d128cc
59b80e3
0a82673
2769c08
40da807
8765d86
12811eb
d170b02
b76c0a2
98d8ebc
d1e75c0
55c3096
a09ed1b
e6d2ba0
def6974
ae6deb7
1c07d35
1642959
daaae22
717265a
80af69e
8d505dc
f9a1f2b
7445b27
1dcded4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,6 +105,23 @@ env: | |
| test_unpack | ||
| test_weakref | ||
| test_yield_from | ||
| ENV_POLLUTING_TESTS_COMMON: >- | ||
| test_threading | ||
| ENV_POLLUTING_TESTS_LINUX: >- | ||
| test.test_concurrent_futures.test_thread_pool | ||
| test.test_multiprocessing_fork.test_processes | ||
| test.test_multiprocessing_fork.test_threads | ||
| test.test_multiprocessing_forkserver.test_processes | ||
| test.test_multiprocessing_forkserver.test_threads | ||
| test.test_multiprocessing_spawn.test_processes | ||
| test.test_multiprocessing_spawn.test_threads | ||
| ENV_POLLUTING_TESTS_MACOS: >- | ||
| test.test_concurrent_futures.test_thread_pool | ||
| test.test_multiprocessing_forkserver.test_processes | ||
| test.test_multiprocessing_forkserver.test_threads | ||
| test.test_multiprocessing_spawn.test_processes | ||
| test.test_multiprocessing_spawn.test_threads | ||
| ENV_POLLUTING_TESTS_WINDOWS: >- | ||
| # Python version targeted by the CI. | ||
| PYTHON_VERSION: "3.13.1" | ||
| X86_64_PC_WINDOWS_MSVC_OPENSSL_LIB_DIR: C:\Program Files\OpenSSL\lib\VC\x64\MD | ||
|
|
@@ -116,7 +133,7 @@ jobs: | |
| env: | ||
| RUST_BACKTRACE: full | ||
| name: Run rust tests | ||
| runs-on: ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 45 | ||
| strategy: | ||
| matrix: | ||
|
|
@@ -147,8 +164,7 @@ jobs: | |
| run: cargo check ${{ env.CARGO_ARGS }} | ||
|
|
||
| - name: Test openssl build | ||
| run: | ||
| cargo build --no-default-features --features ssl-openssl | ||
| run: cargo build --no-default-features --features ssl-openssl | ||
| if: runner.os == 'Linux' | ||
|
|
||
| # - name: Install tk-dev for tkinter build | ||
|
|
@@ -160,7 +176,7 @@ jobs: | |
| # if: runner.os == 'Linux' | ||
|
|
||
| - name: Test example projects | ||
| run: | ||
| run: | | ||
| cargo run --manifest-path example_projects/barebone/Cargo.toml | ||
| cargo run --manifest-path example_projects/frozen_stdlib/Cargo.toml | ||
| if: runner.os == 'Linux' | ||
|
|
@@ -248,7 +264,7 @@ jobs: | |
| env: | ||
| RUST_BACKTRACE: full | ||
| name: Run snippets and cpython tests | ||
| runs-on: ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [macos-latest, ubuntu-latest, windows-2025] | ||
|
|
@@ -278,26 +294,116 @@ jobs: | |
|
|
||
| - if: runner.os == 'Linux' | ||
| name: run cpython platform-independent tests | ||
| run: | ||
| target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed -v ${{ env.PLATFORM_INDEPENDENT_TESTS }} | ||
| env: | ||
| RUSTPYTHON_SKIP_ENV_POLLUTERS: true | ||
| run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v ${{ env.PLATFORM_INDEPENDENT_TESTS }} | ||
| timeout-minutes: 35 | ||
|
|
||
| - if: runner.os == 'Linux' | ||
| name: run cpython platform-dependent tests (Linux) | ||
| run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} | ||
| env: | ||
| RUSTPYTHON_SKIP_ENV_POLLUTERS: true | ||
| run: target/release/rustpython -m test -j 1 -u all --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} | ||
| timeout-minutes: 35 | ||
|
|
||
| - if: runner.os == 'macOS' | ||
| name: run cpython platform-dependent tests (MacOS) | ||
| run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} | ||
| env: | ||
| RUSTPYTHON_SKIP_ENV_POLLUTERS: true | ||
| run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} | ||
| timeout-minutes: 35 | ||
|
|
||
| - if: runner.os == 'Windows' | ||
| name: run cpython platform-dependent tests (windows partial - fixme) | ||
| run: | ||
| target/release/rustpython -m test -j 1 --slowest --fail-env-changed -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }} | ||
| env: | ||
| RUSTPYTHON_SKIP_ENV_POLLUTERS: true | ||
| run: target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v -x ${{ env.PLATFORM_INDEPENDENT_TESTS }} ${{ env.WINDOWS_SKIPS }} | ||
| timeout-minutes: 45 | ||
|
|
||
| - if: runner.os == 'Linux' | ||
| name: run cpython tests to check if env polluters have stopped polluting (Common/Linux) | ||
| shell: bash | ||
| run: | | ||
| for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_LINUX }}; do | ||
| for i in $(seq 1 10); do | ||
| set +e | ||
| target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} | ||
| exit_code=$? | ||
| set -e | ||
| if [ ${exit_code} -eq 3 ]; then | ||
| echo "Test ${thing} polluted the environment on attempt ${i}." | ||
| break | ||
| fi | ||
| done | ||
| if [ ${exit_code} -ne 3 ]; then | ||
| echo "Test ${thing} is no longer polluting the environment after ${i} attempts!" | ||
| echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_LINUX in '.github/workflows/ci.yaml'." | ||
| echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}." | ||
| if [ ${exit_code} -ne 0 ]; then | ||
| echo "Test ${thing} failed with exit code ${exit_code}." | ||
| echo "Please investigate which test item in ${thing} is failing and either mark it as an expected failure or a skip." | ||
| fi | ||
| exit 1 | ||
| fi | ||
| done | ||
| timeout-minutes: 15 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| - if: runner.os == 'macOS' | ||
| name: run cpython tests to check if env polluters have stopped polluting (Common/macOS) | ||
| shell: bash | ||
| run: | | ||
| for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_MACOS }}; do | ||
| for i in $(seq 1 10); do | ||
| set +e | ||
| target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} | ||
| exit_code=$? | ||
| set -e | ||
| if [ ${exit_code} -eq 3 ]; then | ||
| echo "Test ${thing} polluted the environment on attempt ${i}." | ||
| break | ||
| fi | ||
| done | ||
| if [ ${exit_code} -ne 3 ]; then | ||
| echo "Test ${thing} is no longer polluting the environment after ${i} attempts!" | ||
| echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_MACOS in '.github/workflows/ci.yaml'." | ||
| echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}." | ||
| if [ ${exit_code} -ne 0 ]; then | ||
| echo "Test ${thing} failed with exit code ${exit_code}." | ||
| echo "Please investigate which test item in ${thing} is failing and either mark it as an expected failure or a skip." | ||
| fi | ||
| exit 1 | ||
| fi | ||
| done | ||
| timeout-minutes: 15 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| - if: runner.os == 'Windows' | ||
| name: run cpython tests to check if env polluters have stopped polluting (Common/windows) | ||
| shell: bash | ||
| run: | | ||
| for thing in ${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_WINDOWS }}; do | ||
| for i in $(seq 1 10); do | ||
| set +e | ||
| target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v ${thing} | ||
| exit_code=$? | ||
| set -e | ||
| if [ ${exit_code} -eq 3 ]; then | ||
| echo "Test ${thing} polluted the environment on attempt ${i}." | ||
| break | ||
| fi | ||
| done | ||
| if [ ${exit_code} -ne 3 ]; then | ||
| echo "Test ${thing} is no longer polluting the environment after ${i} attempts!" | ||
| echo "Please remove ${thing} from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_WINDOWS in '.github/workflows/ci.yaml'." | ||
| echo "Please also remove the skip decorators that include the word 'POLLUTERS' in ${thing}." | ||
| if [ ${exit_code} -ne 0 ]; then | ||
| echo "Test ${thing} failed with exit code ${exit_code}." | ||
| echo "Please investigate which test item in ${thing} is failing and either mark it as an expected failure or a skip." | ||
| fi | ||
| exit 1 | ||
| fi | ||
| done | ||
|
Comment on lines
+383
to
+404
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @coderabbitai translate this to powershell
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @fanninpm Here's the PowerShell translation of the Windows environment pollution check script: - if: runner.os == 'Windows'
name: run cpython tests to check if env polluters have stopped polluting (Common/windows)
shell: pwsh
run: |
$tests = "${{ env.ENV_POLLUTING_TESTS_COMMON }} ${{ env.ENV_POLLUTING_TESTS_WINDOWS }}" -split '\s+' | Where-Object { $_ }
foreach ($thing in $tests) {
for ($i = 1; $i -le 10; $i++) {
target/release/rustpython -m test -j 1 --slowest --fail-env-changed --timeout 600 -v $thing
$exit_code = $LASTEXITCODE
if ($exit_code -eq 3) {
Write-Host "Test $thing polluted the environment on attempt $i."
break
}
}
if ($exit_code -ne 3) {
Write-Host "Test $thing is no longer polluting the environment after $i attempts!"
Write-Host "Please remove $thing from either ENV_POLLUTING_TESTS_COMMON or ENV_POLLUTING_TESTS_WINDOWS in ``.github/workflows/ci.yaml``."
Write-Host "Please also remove the skip decorators that include the word 'POLLUTERS' in $thing."
if ($exit_code -ne 0) {
Write-Host "Test $thing failed with exit code $exit_code."
Write-Host "Please investigate which test item in $thing is failing and either mark it as an expected failure or a skip."
}
exit 1
}
}Key changes from bash:
|
||
| timeout-minutes: 15 | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| - if: runner.os != 'Windows' | ||
| name: check that --install-pip succeeds | ||
| run: | | ||
|
|
@@ -323,7 +429,7 @@ jobs: | |
| - uses: actions/checkout@v6.0.1 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: clippy | ||
| components: clippy | ||
|
|
||
| - name: run clippy on wasm | ||
| run: cargo clippy --manifest-path=crates/wasm/Cargo.toml -- -Dwarnings | ||
|
|
@@ -360,7 +466,7 @@ jobs: | |
| - name: spell checker | ||
| uses: streetsidesoftware/cspell-action@v8 | ||
| with: | ||
| files: '**/*.rs' | ||
| files: "**/*.rs" | ||
| incremental_files_only: true | ||
|
|
||
| miri: | ||
|
|
@@ -375,17 +481,17 @@ jobs: | |
|
|
||
| - uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: ${{ env.NIGHTLY_CHANNEL }} | ||
| components: miri | ||
| toolchain: ${{ env.NIGHTLY_CHANNEL }} | ||
| components: miri | ||
|
|
||
| - uses: Swatinem/rust-cache@v2 | ||
|
|
||
| - name: Run tests under miri | ||
| run: cargo +${{ env.NIGHTLY_CHANNEL }} miri test -p rustpython-vm -- miri_test | ||
| env: | ||
| # miri-ignore-leaks because the type-object circular reference means that there will always be | ||
| # a memory leak, at least until we have proper cyclic gc | ||
| MIRIFLAGS: '-Zmiri-ignore-leaks' | ||
| # miri-ignore-leaks because the type-object circular reference means that there will always be | ||
| # a memory leak, at least until we have proper cyclic gc | ||
| MIRIFLAGS: "-Zmiri-ignore-leaks" | ||
|
|
||
| wasm: | ||
| if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip:ci') }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| from test.libregrtest import main | ||
| main() | ||
| from test.libregrtest.main import main | ||
| main(_add_python_opts=True) |
Uh oh!
There was an error while loading. Please reload this page.