File tree Expand file tree Collapse file tree
ubuntu-24.04-noble-amd64-valgrind Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,12 +11,16 @@ concurrency:
1111
1212jobs :
1313 build :
14- name : ${{ matrix.image }}
14+ name : ${{ matrix.image }} (shard ${{ matrix.shard }})
1515 runs-on : ${{ matrix.os }}
1616 strategy :
1717 fail-fast : false
1818 matrix :
1919 os : ["ubuntu-latest"]
20+ # This shards every image in the matrix below. Only the valgrind
21+ # image reads SHARD_INDEX/SHARD_COUNT; scope this to valgrind via
22+ # `include` before re-enabling the other (fast, unsharded) images.
23+ shard : [1, 2, 3, 4]
2024 image :
2125 # Run slower jobs first to give them a headstart and reduce waiting time
2226 - " ubuntu-26.04-resolute-ppc64le"
@@ -102,6 +106,8 @@ jobs:
102106 make test BRANCH=main
103107 env :
104108 DOCKER_USERNAME : ${{ secrets.DOCKER_USERNAME }}
109+ SHARD_INDEX : ${{ matrix.shard }}
110+ SHARD_COUNT : 4
105111
106112 - name : Log image size
107113 run : |
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ ARG PIP_NO_CACHE_DIR=1
4343
4444RUN virtualenv -p /usr/bin/python3.12-dbg --system-site-packages /vpy3 \
4545 && /vpy3/bin/pip install --upgrade pip \
46- && /vpy3/bin/pip install olefile pytest pytest-cov pytest-timeout pytest-valgrind \
46+ && /vpy3/bin/pip install olefile pytest pytest-cov pytest-split pytest- timeout pytest-valgrind \
4747 && chown -R pillow:pillow /vpy3
4848
4949COPY depends /depends
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ update:
1717
1818.PHONY : test
1919test :
20- docker run --rm -e " PILLOW_VALGRIND_TEST=true" -v $(ROOT ) :/Pillow $(IMAGENAME ) :$(BRANCH )
20+ docker run --rm -e " PILLOW_VALGRIND_TEST=true" -e SHARD_INDEX -e SHARD_COUNT - v $(ROOT ) :/Pillow $(IMAGENAME ) :$(BRANCH )
2121
2222.PHONY : push
2323push :
Original file line number Diff line number Diff line change @@ -4,9 +4,14 @@ cd /Pillow
44make clean
55make install-coverage
66
7+ SPLIT_ARGS=" "
8+ if [ " ${SHARD_COUNT:- 1} " -gt 1 ]; then
9+ SPLIT_ARGS=" --splits ${SHARD_COUNT} --group ${SHARD_INDEX} "
10+ fi
11+
712PYTHONMALLOC=malloc valgrind --suppressions=/depends/python.supp --leak-check=no \
813 --log-file=/tmp/valgrind-output \
9- python3 -m pytest --no-memcheck -vv --valgrind --valgrind-log=/tmp/valgrind-output
14+ python3 -m pytest --no-memcheck -vv --valgrind --valgrind-log=/tmp/valgrind-output $SPLIT_ARGS
1015
1116# To run one test in the image:
1217# make bash
You can’t perform that action at this time.
0 commit comments