exclusion patterns
- Dominant language
- Go
- Stars
- 941
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Description
As a Tester
I want to Exclude variable data (timestamps, id fields etc.)
So that I can validate things that matter
Proposed feature
Designate a pattern that will be used to "erase" values from both the expected data, and the response.
Possible solutions
Use a special character field / operator to indicate the exclusion, in this example the prefix ! designates a type of expression being provided.
Text Patterns
Substitute using sed style replace, mostly for text.
!s: s/ABCDE/XXXXX/g
Remove data matching regex, in this case a valid email address. Any value matching the regex would be replaced with nothing.
!r: (?:[a-z0-9!#$%&'_+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'_+/=?^_`{|}~-]+)_|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])_")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\[\x01-\x09\x0b\x0c\x0e-\x7f])+)])
JSON Patterns
Replace a field's contents with a dummy value.
!_id: 123
Exclude field from json, the field "_id" field and value would be removed prior to compare.
!x: _id
Contributor guide
No contributing guide indexed for this repository
Research direction
The issue names no files, tests, or entry points. Start by locating the existing comparison path for expected data and responses, then define how the proposed text and JSON exclusion patterns fit it; done should include documented behavior and tests for substitution, regex removal, dummy values, and excluded fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100