You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before this PR, inline expectation comments with optional tags were simply ignored, which is most likely not what was intended.
With this PR, inline expectation comments with optional tags are instead checked, meaning there must be an accompanying actual result. The converse, however, is not checked (which is what makes the comment optional).
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adjusts the inline-expectations test harness so that “optional tag” annotations on expectations are no longer ignored, and are instead validated against actual results (while keeping the optionality asymmetric for results).
Changes:
Treat expectation comments with optional tags as requiring a matching actual result.
Introduce an ignoreTag hook to allow tests to explicitly ignore expectations for certain tags.
Out of interest, what are optional inline expectation tags? Are they documented anywhere? I sometimes think we need better documentation of (post-processed) inline expectation tests since we are asking people to use them. I sometimes refer back to the description of this PR, but it is missing lots of information that would be useful. (I'm always looking for how to specify which query an alert comes from.)
Out of interest, what are optional inline expectation tags?
* Results with an optional tag will not cause a failure if there is no matching expectation,
* but any expectation with an optional tag must have a matching result.
I see, so it's defined separately for each test, and it's used when you want to require that a particular query has certain results without having to specify all of the results. That sounds useful.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Before this PR, inline expectation comments with optional tags were simply ignored, which is most likely not what was intended.
With this PR, inline expectation comments with optional tags are instead checked, meaning there must be an accompanying actual result. The converse, however, is not checked (which is what makes the comment optional).