-
Notifications
You must be signed in to change notification settings - Fork 58
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: Upgrade testing infrastructure #513
base: main
Are you sure you want to change the base?
Conversation
it feels redundant having tests/fixtures/assets/. |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #513 +/- ##
==========================================
+ Coverage 79.62% 79.96% +0.34%
==========================================
Files 87 90 +3
Lines 27276 30048 +2772
==========================================
+ Hits 21719 24029 +2310
- Misses 5557 6019 +462 ☔ View full report in Codecov by Sentry. |
Disclaimer: Since SVG is a text format, when the CI downloads the repo, git will convert the line endings to CRLF (due to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like it all works - I can make a small change and see it is caught. But I think we need more instruction about how to use and maintain it. My concern is that when the spec changes the format of a UUID, these will break, and we will need to fix the tests. So how do we deal with expected changes going forward?
As far as stabilizing values like UUIDs go, it should be a simple change to the Stabilizer. However, if the format of the JSON were to change, there can be some issues. In the case where new fields are added to the JSON, the test currently ignores them by default. In the case where the location of the field changes or is removed, there’s currently no way to specify that. Ideally, we’d have a system built on top that tells us the known changes/additions/removals from the prior version. That sounds simple enough, but there’s cases where a field may change that’s inside of an array of maps, we’d need a way to specify that as well. Insta-rs has a cool way of doing this with their redaction selectors, but that code isn’t decoupled. Unfortunately, we can’t leverage insta-rs here because redaction selectors must be hardcoded (and due to other limitations). If we want this type of functionality, we’d need to implement our own selector syntax, although I’m unsure of the difficulty and if we can leverage any existing crates. For the time being and for the simplest functionality, we can ignore any unknown fields that don’t exist in both JSONs and verify that existing fields have the same exact values. However, if we can guarantee that fields will never be removed/moved, then we can definitely create a simple impl for known changes. TLDR; I'll clarify maintenance in the docs and there is a lot of potential for making this suite stricter |
FYI, CI is failing due to a weird issue with snapshot filtering, where it isn't filtering the current version used in the PR here. It doesn't happen locally, my thought is that it's using the latest c2pa-rs version only in CI somehow? I believe it can be temporarily fixed by merging main into this branch, but that shouldn't be necessary. |
Changes in this pull request
Upgrade testing infrastructure.
Related Issues
Checklist
TO DO
items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.