Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate baseline hashes during tests to reduce flakiness #234

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 17 additions & 23 deletions .github/workflows/test_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,25 @@ jobs:
- ghostscript
- inkscape
envs: |
# Test oldest NEP 29 configurations
- linux: py39-test-mpl33
- macos: py39-test-mpl33
- windows: py39-test-mpl33
# Test oldest non-NEP 29 configurations
- linux: py36-test-mpl20
runs-on: ubuntu-20.04
- macos: py36-test-mpl20
- windows: py36-test-mpl20
# Test newest configurations
- linux: py312-test-mpl38
- macos: py312-test-mpl38
- windows: py312-test-mpl38
# Test intermediate NEP 29 configurations on Linux
- linux: py39-test-mpl38
- linux: py310-test-mpl38
- linux: py310-test-mpl35
- linux: py311-test-mpl36
# Test oldest SPEC 0 configurations
- linux: py311-test-mpl37
# Test different versions of pytest
- linux: py312-test-mpldev-pytestdev
- macos: py311-test-mpl37
- windows: py311-test-mpl37
# Test newest configurations
- linux: py313-test-mpl39
- macos: py313-test-mpl39
- windows: py313-test-mpl39
# Test intermediate SPEC 0 configurations on Linux
- linux: py312-test-mpl37
- linux: py311-test-mpl38
- linux: py313-test-mpl38
- linux: py312-test-mpl39
# Test non-SPEC 0 configurations
- linux: py313-test-mpldev-pytestdev
- linux: py311-test-mpl37-pytest74
- linux: py39-test-mpl33-pytest62
- linux: py38-test-mpl31-pytest54
- linux: py37-test-mpl22-pytest54
runs-on: ubuntu-22.04
coverage: 'codecov'

publish:
Expand All @@ -57,7 +53,5 @@ jobs:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
with:
test_command: pytest $GITHUB_WORKSPACE/tests; pytest --mpl $GITHUB_WORKSPACE/tests
# Remove python-version when python-dateutil >2.8.2
python-version: "3.11"
secrets:
pypi_token: ${{ secrets.pypi_password }}
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ docs =
sphinx
mpl_sphinx_theme>=3.6.0.dev0
sphinx_design
matplotlib==3.6

[tool:pytest]
testpaths = tests
Expand Down
9 changes: 0 additions & 9 deletions tests/baseline/hashes/mpl22_ft261.json

This file was deleted.

5 changes: 0 additions & 5 deletions tests/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from pathlib import Path

import matplotlib
Expand All @@ -20,15 +19,11 @@ def skip_if_format_unsupported(file_format, using_hashes=False):
pytest.skip('SVG comparison is only supported in Matplotlib 3.3 and above')

if using_hashes:

if file_format == 'pdf' and MPL_VERSION < Version('2.1'):
pytest.skip('PDF hashes are only deterministic in Matplotlib 2.1 and above')
elif file_format == 'eps' and MPL_VERSION < Version('2.1'):
pytest.skip('EPS hashes are only deterministic in Matplotlib 2.1 and above')

if using_hashes and not sys.platform.startswith('linux'):
pytest.skip('Hashes for vector graphics are only provided in the hash library for Linux')

if file_format != 'png' and file_format not in converter:
if file_format == 'svg':
pytest.skip('Comparing SVG files requires inkscape to be installed')
Expand Down
34 changes: 0 additions & 34 deletions tests/subtests/result_hashes/mpl33_ft261.json

This file was deleted.

34 changes: 0 additions & 34 deletions tests/subtests/result_hashes/mpl34_ft261.json

This file was deleted.

34 changes: 0 additions & 34 deletions tests/subtests/result_hashes/mpl35_ft261.json

This file was deleted.

Loading