Skip to content
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

Add support for “known failures” to transcripts #5394

Merged
merged 9 commits into from
Dec 11, 2024

Conversation

sellout
Copy link
Contributor

@sellout sellout commented Oct 7, 2024

Overview

This allows issues that haven’t yet been resolved to be reflected in the transcripts. This makes it easier to close tickets as soon as issues have been fixed, and avoids having to manually re-try transcripts from a ticket to see if the situation is the same.

Fixes #5350.

Implementation notes

This adds two new transcript tags :failure and :incorrect. They behave similarly to :error and no tag, respectively, except the error messages are different when the results don’t match.

  • :failure represents a stanza that is intended to succeed, but currently fails (whereas :error is intended to fail)
  • :incorrect represents a stanza that is intended to error, but currently doesn’t.

Test coverage

This adds three new transcripts for open tickets exercising the two new tags.

Loose ends

There are lots of open tickets that should also get transcripts added.

This is basically the opposite of `:failure` – it indicates that a
successful result is incorrect. The correct result may either be an
error (which will be caught by the transcript runner) or a different
result then what is currently expected (which won’t be caught by the
runner, but the appearance of `:incorrect` conveys to the programmer
that the output.md diff may be an improvement from the previous state).
@aryairani
Copy link
Contributor

I wanna think a little more about what the label names should be, because I think error failure and incorrect are hard to distinguish; but otherwise this looks great.

@sellout
Copy link
Contributor Author

sellout commented Oct 7, 2024

I agree. It might be worth doing #5214 before this.

@aryairani
Copy link
Contributor

How about:

  • <no-tag> : stanza is expected to succeed; runner will complain if it doesn't succeed
  • :error : stanza is expected to fail, runner will complain if it doesn't error
  • :bug : stanza is expected to succeed, but currently doesn't, due to a known ucm bug. runner should notify us if the behavior changes
  • :error :bug : stanza is expected to error, but currently doesn't, due to a known ucm bug. runner should notify us if the behavior changes

And then also if it's idempotent, we want to preserve any unsuccessful input or unprocessed.

These aren’t run by check.sh, so I missed them before pushing.
@sellout
Copy link
Contributor Author

sellout commented Dec 6, 2024

Ok, I’ve switched to :error/:bug, which is a big improvement. Ready for final review.

@@ -4,7 +4,7 @@ When an expected error is not encountered in a `unison :hide:all:error` block
then the transcript parser should print the stanza
and surface a helpful message.

``` unison :hide:all:error
``` unison :hide:all :error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why does :error get a space but :all doesn't?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because :hide:all is really just one tag. It’s never been parsable as :hide :all. I just changed the printer to put spaces between, but didn’t modify the parsers.

Might be worth renaming to :hide-all (perhaps allowing :hide:all still for backward compat).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added a commit with this change, I can back it out if you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like :hide-all

@sellout sellout force-pushed the transcript-known-failures branch from 5e13ab4 to 523256c Compare December 10, 2024 07:01
The former was confusing because `:hide` and `:all` are not actually
separate tags.
@sellout sellout force-pushed the transcript-known-failures branch from 523256c to 49a0cae Compare December 10, 2024 07:23
Comment on lines 217 to 221
"The stanza above previously had an incorrect successful result, but now fails with"
<> "\n"
<> Pretty.border 2 msg
<> "\n"
<> "if this is the expected result, remove `:bug`, otherwise remove `:error`."
Copy link
Contributor

@aryairani aryairani Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having four terms is too many, I wonder if we can do it with no more than two.

Yes to "is the error the error we're actually expecting?" that's where I was heading with the "open a new ticket if needed".

I'd be satisfied with this, wdyt:

Suggested change
"The stanza above previously had an incorrect successful result, but now fails with"
<> "\n"
<> Pretty.border 2 msg
<> "\n"
<> "if this is the expected result, remove `:bug`, otherwise remove `:error`."
"The stanza above marked with `:error :bug` is now failing with"
<> "\n"
<> Pretty.border 2 msg
<> "\n"
<> "so you can remove `:bug`, close any appropriate Github issues by using the commit message or PR description, and/or open a new issue if the error message is still not correct."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah – mentioning closing the related issue is important! I’ll do the same on the the other :bug case. And yeah, this message looks good to me.

I think there’s still four terms, but different axes, and ones that match our tags better: passing/failing (:error) and expected/unexpected (:bug). So yeah, I like that direction.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I changed the phrasing a bit again, so see what you think in the latest commits.

I also realized that the only tests added were for actual outstanding bugs, so I added an additional transcript that will continue testing the “positive” cases after those outstanding bugs are fixed, as well as two error tests for fixed bugs (which show the messages we’ve been fiddling with).

These exposed a few issues with the output formatting, so those are also
addressed here.
@aryairani aryairani merged commit b311a29 into unisonweb:trunk Dec 11, 2024
17 checks passed
@sellout sellout deleted the transcript-known-failures branch December 11, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support “known failures” in transcripts
2 participants