chore: replace PPRemoveAbsolutePaths with generic fixture template data #2265
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Followup to the style of test that was added in #2256. Instead of expecting a struct of type
any
, I have converted it to use amap[string]any
. This largely works the same way, but with the benefit that defining variables is a bit nicer syntactically and we can utilise functions likemaps.Copy()
to do key merging. This allows us to define a predefined set of variables for use in all tests and then merge additional values if required.Variables being made available for now are:
TEST_NAME
- Contains the name of the testTEST_DIR
- Contains the absolute path to the test directoryI have removed
PPRemoveAbsolutePaths
in favor of this new technique.One small hiccup is that since #2256 was merged, running
task gen:fixtures
will remove the template values from the golden files which then causes the tests to fail. This can be resolved manually, but is a bit of a pain. This is reported in sebdah/goldie#14 and Iam considering an upstream feature request if @sebdah is interested.have opened a PR to address it.