Skip to content

Commit f3ef7d5

Browse files
committed
ci: Preload existing test images from text-overhaul-figures branch
This allows checking that there are no _new_ failures, without committing the new figures to the repo until the branch is complete.
1 parent 42c88ed commit f3ef7d5

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

.appveyor.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,24 @@ install:
6060
- micromamba env create -f environment.yml python=%PYTHON_VERSION% pywin32
6161
- micromamba activate mpl-dev
6262

63+
before_build:
64+
- git config --global user.name 'Matplotlib'
65+
- git config --global user.email 'nobody@matplotlib.org'
66+
- git fetch https://github.com/QuLogic/matplotlib.git text-overhaul-figures:text-overhaul-figures
67+
- git merge --no-commit text-overhaul-figures || true
68+
# If there are any conflicts in baseline images, then pick "ours",
69+
# which should be the updated images in the PR.
70+
- conflicts=$(git diff --name-only --diff-filter=U \
71+
lib/matplotlib/tests/baseline_images \
72+
lib/mpl_toolkits/*/tests/baseline_images)
73+
if [ -n "${conflicts}" ]; then
74+
git checkout --ours -- "${conflicts}"
75+
git add -- "${conflicts}"
76+
fi
77+
# If committing fails, there were conflicts other than the baseline images,
78+
# which should not be allowed to happen, and should fail the build.
79+
- git commit -m 'Preload test images from branch text-overhaul-figures'
80+
6381
test_script:
6482
# Now build the thing..
6583
- set LINK=/LIBPATH:%cd%\lib

.github/workflows/tests.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,25 @@ jobs:
9595
fetch-depth: 0
9696
persist-credentials: false
9797

98+
- name: Preload test images
99+
run: |
100+
git config --global user.name 'Matplotlib'
101+
git config --global user.email 'nobody@matplotlib.org'
102+
git fetch https://github.com/QuLogic/matplotlib.git text-overhaul-figures:text-overhaul-figures
103+
git merge --no-commit text-overhaul-figures || true
104+
# If there are any conflicts in baseline images, then pick "ours",
105+
# which should be the updated images in the PR.
106+
conflicts=$(git diff --name-only --diff-filter=U \
107+
lib/matplotlib/tests/baseline_images \
108+
lib/mpl_toolkits/*/tests/baseline_images)
109+
if [ -n "${conflicts}" ]; then
110+
git checkout --ours -- "${conflicts}"
111+
git add -- "${conflicts}"
112+
fi
113+
# If committing fails, there were conflicts other than the baseline images,
114+
# which should not be allowed to happen, and should fail the build.
115+
git commit -m 'Preload test images from branch text-overhaul-figures'
116+
98117
- name: Set up Python ${{ matrix.python-version }}
99118
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
100119
with:

azure-pipelines.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,25 @@ stages:
6868
architecture: 'x64'
6969
displayName: 'Use Python $(python.version)'
7070

71+
- bash: |
72+
git config --global user.name 'Matplotlib'
73+
git config --global user.email 'nobody@matplotlib.org'
74+
git fetch https://github.com/QuLogic/matplotlib.git text-overhaul-figures:text-overhaul-figures
75+
git merge --no-commit text-overhaul-figures || true
76+
# If there are any conflicts in baseline images, then pick "ours",
77+
# which should be the updated images in the PR.
78+
conflicts=$(git diff --name-only --diff-filter=U \
79+
lib/matplotlib/tests/baseline_images \
80+
lib/mpl_toolkits/*/tests/baseline_images)
81+
if [ -n "${conflicts}" ]; then
82+
git checkout --ours -- "${conflicts}"
83+
git add -- "${conflicts}"
84+
fi
85+
# If committing fails, there were conflicts other than the baseline images,
86+
# which should not be allowed to happen, and should fail the build.
87+
git commit -m 'Preload test images from branch text-overhaul-figures'
88+
displayName: Preload test images
89+
7190
- bash: |
7291
choco install ninja
7392
displayName: 'Install dependencies'

0 commit comments

Comments
 (0)