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

feat: add snapshot tests with syrupy #285

Merged
merged 8 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
9 changes: 6 additions & 3 deletions .github/workflows/gh-ci-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ jobs:
micromamba info
micromamba list

- name: "test snapshots"
working-directory: doc/source/scripts/
run: python -m pytest
Comment on lines +46 to +48
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't have to do this – this will be very brittle, anytime an output changes, we'll have to re-generate the snapshots. helpful to document how to run the snapshot tests however, so maybe we can leave it with "allow to fail"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say leave it for now -- we have scheduled twice-weekly tests that should pick up changes in the core repo in suitable time so we can update snapshots as needed.


- name: "test notebooks"
run: |
cd ${GITHUB_WORKSPACE}/tests
pytest
working-directory: tests/
run: python -m pytest
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: ^.*\.(pdb)$
exclude: ^.*\.(pdb|ambr)$
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
Expand Down
7 changes: 7 additions & 0 deletions doc/source/preparing_releases_and_hotfixes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ Create a release of the UserGuide

For now, the UserGuide is released at the same time as the core library. To make a release of the UserGuide you should:

#. Update the version of MDA used by the UserGuide to the release version.

#. Re-generate the Syrup test snapshots, and commit those to git and confirm the build passes.

.. code-block:: bash
python -m pytest --snapshot-update

IAlibay marked this conversation as resolved.
Show resolved Hide resolved
#. Create a new release tag and upload them for the UserGuide repository.

.. code-block:: bash
Expand Down
2 changes: 1 addition & 1 deletion doc/source/scripts/gen_format_overview_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

sorted_types = sorted(FILE_TYPES.items())

SUCCESS = "\u2713"
SUCCESS = "\u2713" # checkmark
FAIL = ""


Expand Down
1 change: 1 addition & 0 deletions doc/source/scripts/gen_unit_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def write_unit_table(filename):
)
f.write("\n")
print("Wrote ", filename)
return tables


if __name__ == "__main__":
Expand Down
Loading