From 7e9229fd073e5c05910e5c33ba81db459e8ce04f Mon Sep 17 00:00:00 2001 From: Katherine Mantel Date: Mon, 22 Jan 2024 23:25:18 +0000 Subject: [PATCH] ci: split x86 pytests by directory --- .github/workflows/pnl-ci.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pnl-ci.yml b/.github/workflows/pnl-ci.yml index 236bbc7eb8f..de35d92abeb 100644 --- a/.github/workflows/pnl-ci.yml +++ b/.github/workflows/pnl-ci.yml @@ -171,9 +171,28 @@ jobs: Linux*) lscpu;; esac - - name: Test with pytest + - name: Test with pytest (non-x86) timeout-minutes: 180 run: pytest --junit-xml=tests_out.xml --verbosity=0 -n auto ${{ matrix.extra-args }} + if: (! contains(matrix.python-architecture, 'x86')) + + # run tests in each dir separately to reduce peak memory usage + - name: Test with pytest (x86) + timeout-minutes: 180 + shell: bash + # any non-zero exit code will indicate failure for GHA + run: | + res=0 + test_dirs=$(find psyneulink tests/* -maxdepth 0 -type d) + for td in $test_dirs; do echo "Running pytest $td"; pytest --junit-xml=tests_$(echo $td | sed 's;/;_;g').xml --verbosity=0 -n auto ${{ matrix.extra-args }} "$td"; res+=$?; done + (exit $res) + if: contains(matrix.python-architecture, 'x86') + + - name: Merge junit xml (x86) + run: | + pip install junitparser + junitparser merge tests*.xml tests_out.xml + if: contains(matrix.python-architecture, 'x86') - name: Upload test results uses: actions/upload-artifact@v3