-
-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat: Add diff_test_failure_message attribute to write_source_file* #1030
feat: Add diff_test_failure_message attribute to write_source_file* #1030
Conversation
Note: I would be happy to get either more automated tests added or change the name of the attribute; however, I didn't see any preexisting tests for these failure messages and so I didn't want to go around refactoring/messing with things without knowing where to look, and if you all don't consider it necessary to add automated tests for this then I didn't want to spend the time figuring it out. |
IMO appending to the end seems like a very specific use case. A more generally useful solution would be to replace the whole message while supporting templating for the target and suggested target to be inserted. |
@kormide Do you think such templating should just go off of the target name or off of the whole pre-provided string? Also, is there any standard pattern for what syntax you'd use for this sort of templating? I'd probably default to just implenting templating for the two target names and make it so that if you wanted to reproduce the existing error message you would do something like:
Suggestions on names & syntax welcome; I'm not inclined to implement any larger a feature set than described here. |
I think the |
Sounds good; I'm not sure if I'll implement |
be24a54
to
d3e2374
Compare
Need to fix some of the formatting & text in the docs, but does this look like what we want? |
fe5b667
to
d063c68
Compare
Formatting should now be fixed. |
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.
Looks good. I think we just need a second property.
This makes it so that developers can add a custom error message to the diff test failure messages when using `write_source_file` and `write_source_files`.
d063c68
to
524db9b
Compare
Head branch was pushed to by a user without write access
@kormide I had to manually tweak the generated markdown to make the CI happy; FYI I seem to be running into the same thing as #1032 (comment) alludes to where the markdown generation is not reproducible across different environments. |
This makes it so that developers can add a custom error message to the diff test failure messages when using
write_source_file
andwrite_source_files
.