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

chore(core, sequencer): add names to all snapshot tests #1690

Merged
merged 4 commits into from
Dec 6, 2024

Conversation

ethanoroshiba
Copy link
Contributor

@ethanoroshiba ethanoroshiba commented Oct 18, 2024

Summary

Added names to all snapshot tests which did not have them.

Background

If a certain test had multiple snapshot assertions, they would be named based on their ordering. Hence any reordering, removal, or addition of the snapshots would break the test, which should not be the case. This change aims to fix this problem as well as establish a best practice of naming snapshots moving forward.

Changes

  • Added names to all snapshot tests and regenerated all snapshots not within Conductor (due to code freeze)

Testing

Passing all tests.

Related Issues

closes #1656

@github-actions github-actions bot added conductor pertaining to the astria-conductor crate sequencer pertaining to the astria-sequencer crate labels Oct 18, 2024
@ethanoroshiba ethanoroshiba added code-quality testing and removed conductor pertaining to the astria-conductor crate sequencer pertaining to the astria-sequencer crate labels Oct 18, 2024
@ethanoroshiba ethanoroshiba force-pushed the ENG-916/snapshot_names branch from 7c9041a to a72de80 Compare October 18, 2024 16:23
@github-actions github-actions bot added the sequencer pertaining to the astria-sequencer crate label Oct 18, 2024
@ethanoroshiba ethanoroshiba changed the title chore(all): add names to all snapshot tests chore(core, sequencer): add names to all snapshot tests Oct 18, 2024
@ethanoroshiba ethanoroshiba marked this pull request as ready for review October 18, 2024 16:36
Copy link
Member

@SuperFluffy SuperFluffy left a comment

Choose a reason for hiding this comment

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

The changes make for much cleaner files

@@ -845,15 +845,15 @@ mod tests {
.prefix(ASTRIA_ADDRESS_PREFIX)
.try_build()
.unwrap();
insta::assert_json_snapshot!(&main_address.to_raw());
insta::assert_json_snapshot!("main_address", &main_address.to_raw());
Copy link
Member

Choose a reason for hiding this comment

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

Let's never name this main_bech32m_address

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming you meant to name it main_bech32m_address?

@ethanoroshiba ethanoroshiba added this pull request to the merge queue Dec 6, 2024
Merged via the queue into main with commit 7e00378 Dec 6, 2024
46 checks passed
@ethanoroshiba ethanoroshiba deleted the ENG-916/snapshot_names branch December 6, 2024 16:50
ethanoroshiba added a commit that referenced this pull request Dec 6, 2024
## Summary
Added names to all snapshot tests which did not have them.

## Background
If a certain test had multiple snapshot assertions, they would be named
based on their ordering. Hence any reordering, removal, or addition of
the snapshots would break the test, which should not be the case. This
change aims to fix this problem as well as establish a best practice of
naming snapshots moving forward.

## Changes
- Added names to all snapshot tests and regenerated all snapshots not
within Conductor (due to code freeze)

## Testing
Passing all tests.

## Related Issues
closes #1656
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code-quality sequencer pertaining to the astria-sequencer crate testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add snapshot names to all snapshot asserts
4 participants