Skip to content

Commit 3901694

Browse files
committed
Create visual snapshot testing
1 parent 582e255 commit 3901694

File tree

8 files changed

+56
-0
lines changed

8 files changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Run Snapshot Tests
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
run:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Folium
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Micromamba env
18+
uses: mamba-org/setup-micromamba@v2
19+
with:
20+
environment-name: TEST
21+
create-args: >-
22+
python=3
23+
--file requirements.txt
24+
--file requirements-dev.txt
25+
26+
- name: Install pixelmatch
27+
shell: bash -l {0}
28+
run: |
29+
pip install pixelmatch
30+
31+
- name: Install annotate-failures-plugin
32+
run: pip install pytest-github-actions-annotate-failures
33+
34+
- name: Install folium from source
35+
shell: bash -l {0}
36+
run: |
37+
python -m pip install -e . --no-deps --force-reinstall
38+
39+
- name: Test with pytest and retry flaky tests up to 3 times
40+
shell: bash -l {0}
41+
run: |
42+
pytest tests/snapshots --browser chromium -s --junit-xml=test-results.xml
43+
44+
- name: Surface failing tests
45+
if: always()
46+
uses: pmeier/pytest-results-action@main
47+
with:
48+
path: test-results.xml
49+
fail-on-empty: false
50+
51+
- name: Upload screenshots
52+
if: failure()
53+
uses: actions/upload-artifact@v4
54+
with:
55+
name: screenshots
56+
path: /tmp/screenshot_*_*.png
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)