Skip to content

Conversation

@FollowTheProcess
Copy link
Owner

Summary

This PR adds the concept of "filters" to snapshot.

A filter is a regex replacement that is applied to snapshots prior to serialisation, the goal of which is to replace non-deterministic (but known format) data
with deterministic placeholders.

Some motivating examples:

  • Any valid UUID -> "[UUID]"
  • A unix timestamp -> "[TIMESTAMP]"
  • Temp folders on various platforms -> "[TEMP_FILE]"
  • etc.

I wonder if we should provide a set of defaults? And possibly a way to opt out if not desired. Or just leave it completely up to the caller and provide no defaults, but document
some examples (like the above)

@FollowTheProcess FollowTheProcess added the feature New feature or request label Mar 28, 2025
@FollowTheProcess FollowTheProcess self-assigned this Mar 28, 2025
@codecov
Copy link

codecov bot commented Mar 28, 2025

Codecov Report

Attention: Patch coverage is 95.16129% with 3 lines in your changes missing coverage. Please review.

Project coverage is 91.64%. Comparing base (bf8b2c4) to head (a7b74c7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
option.go 86.66% 2 Missing ⚠️
snapshot.go 97.87% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #32      +/-   ##
==========================================
+ Coverage   89.25%   91.64%   +2.39%     
==========================================
  Files           3        3              
  Lines         307      323      +16     
==========================================
+ Hits          274      296      +22     
+ Misses         27       21       -6     
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@FollowTheProcess FollowTheProcess merged commit 68d076d into main Mar 28, 2025
12 checks passed
@FollowTheProcess FollowTheProcess deleted the feat/filters branch March 28, 2025 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants