From fb31409b392c5533b25173705d62ed385ee39cfb Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Wed, 1 May 2024 03:15:32 -0700 Subject: [PATCH] Run more tests in parallel (#17185) At some point, Github Actions runners started having more cores: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories --- .github/workflows/test.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4593e79e728c..98a737a78b3b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,39 +36,39 @@ jobs: arch: x64 os: ubuntu-latest toxenv: py - tox_extra_args: "-n 2" + tox_extra_args: "-n 4" test_mypyc: true - name: Test suite with py38-windows-64 python: '3.8' arch: x64 os: windows-latest toxenv: py38 - tox_extra_args: "-n 2" + tox_extra_args: "-n 4" - name: Test suite with py39-ubuntu python: '3.9' arch: x64 os: ubuntu-latest toxenv: py - tox_extra_args: "-n 2" + tox_extra_args: "-n 4" - name: Test suite with py310-ubuntu python: '3.10' arch: x64 os: ubuntu-latest toxenv: py - tox_extra_args: "-n 2" + tox_extra_args: "-n 4" - name: Test suite with py311-ubuntu, mypyc-compiled python: '3.11' arch: x64 os: ubuntu-latest toxenv: py - tox_extra_args: "-n 2" + tox_extra_args: "-n 4" test_mypyc: true - name: Test suite with py312-ubuntu, mypyc-compiled python: '3.12' arch: x64 os: ubuntu-latest toxenv: py - tox_extra_args: "-n 2" + tox_extra_args: "-n 4" test_mypyc: true - name: mypyc runtime tests with py39-macos @@ -77,13 +77,13 @@ jobs: # TODO: macos-13 is the last one to support Python 3.9, change it to macos-latest when updating the Python version os: macos-13 toxenv: py - tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py" + tox_extra_args: "-n 3 mypyc/test/test_run.py mypyc/test/test_external.py" - name: mypyc runtime tests with py38-debug-build-ubuntu python: '3.8.17' arch: x64 os: ubuntu-latest toxenv: py - tox_extra_args: "-n 2 mypyc/test/test_run.py mypyc/test/test_external.py" + tox_extra_args: "-n 4 mypyc/test/test_run.py mypyc/test/test_external.py" debug_build: true - name: Type check our own code (py38-ubuntu) @@ -141,7 +141,9 @@ jobs: pip install -r test-requirements.txt CC=clang MYPYC_OPT_LEVEL=0 MYPY_USE_MYPYC=1 pip install -e . - name: Setup tox environment - run: tox run -e ${{ matrix.toxenv }} --notest + run: | + tox run -e ${{ matrix.toxenv }} --notest + python -c 'import os; print("os.cpu_count", os.cpu_count(), "os.sched_getaffinity", len(getattr(os, "sched_getaffinity", lambda *args: [])(0)))' - name: Test run: tox run -e ${{ matrix.toxenv }} --skip-pkg-install -- ${{ matrix.tox_extra_args }} @@ -190,4 +192,4 @@ jobs: - name: Setup tox environment run: tox run -e py --notest - name: Test - run: tox run -e py --skip-pkg-install -- -n 2 mypyc/test/ + run: tox run -e py --skip-pkg-install -- -n 4 mypyc/test/