Skip to content

Use snapshot-tests to ease adapting assertions after changes to starter #4310

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

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

marcphilipp
Copy link
Member

Prior to this commit, changing the tests in the jupiter-starter sample
project required to manually adapt the expected XML string in
XmlAssertions which was tedious and time-consuming. Instead, the XML
report is now checked against a snapshot that is committed to version
control. When a diff is encountered, the affected test will fail. The
actual and expected snapshots can then be diffed and, if ok, the actual
snapshot can be used to overwrite the expected one.

To avoid committing host names and usernames to source control, they are
obfuscated prior to writing the snapshot files.

Prior to this commit, changing the tests in the jupiter-starter sample
project required to manually adapt the expected XML string in
`XmlAssertions` which was tedious and time-consuming. Instead, the XML
report is now checked against a snapshot that is committed to version
control. When a diff is encountered, the affected test will fail. The
actual and expected snapshots can then be diffed and, if ok, the actual
snapshot can be used to overwrite the expected one.

To avoid committing host names and usernames to source control, they are
obfuscated prior to writing the snapshot files.
@marcphilipp marcphilipp self-assigned this Feb 11, 2025
@marcphilipp marcphilipp merged commit c648369 into main Feb 11, 2025
15 checks passed
@marcphilipp marcphilipp deleted the marc/xml-snapshot-testing branch February 11, 2025 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant