-
Notifications
You must be signed in to change notification settings - Fork 0
Every grounded review ships the record of what it opened #97
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,3 +130,31 @@ func TestIncompleteBundleCarriesTheFlag(t *testing.T) { | |
| t.Errorf("a complete review's bundle mentions incomplete:\n%s", done) | ||
| } | ||
| } | ||
|
|
||
| // The run's account of itself was already gathered on every grounded review and | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TestCoverageShipsOnEveryGroundedRun only unit-tests rcCoverageOf and never marshals the bundle struct literal at review_commit.go:456, so it would pass with the Coverage field removed entirely; the "ships on every grounded run" behavior is not actually tested. |
||
| // thrown away unless the review died. Now it always ships, so a reader can tell | ||
| // a clean verdict that read the whole change from a clean verdict that read two | ||
| // files. | ||
| func TestCoverageShipsOnEveryGroundedRun(t *testing.T) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the new test asserts |
||
| got := rcCoverageOf(&rcIncomplete{ | ||
| Elapsed: 4*time.Minute + 19*time.Second, | ||
| Turns: 27, | ||
| FilesRead: []string{"a.go", "b.go"}, | ||
| }) | ||
| if got == nil { | ||
| t.Fatal("rcCoverageOf dropped a run's manifest") | ||
| } | ||
| if got.Seconds != 259 { | ||
| t.Errorf("Seconds = %d, want 259", got.Seconds) | ||
| } | ||
| if got.Turns != 27 || len(got.FilesRead) != 2 { | ||
| t.Errorf("coverage = %+v, want the run's turns and files", got) | ||
| } | ||
|
|
||
| // The fast pass opens nothing and has no manifest to publish. Nil out | ||
| // keeps `omitempty` dropping the field, rather than publishing a record | ||
| // that claims zero files were read. | ||
| if rcCoverageOf(nil) != nil { | ||
| t.Error("rcCoverageOf(nil) invented a manifest for a pass that opened nothing") | ||
| } | ||
| } | ||
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.
the new
coverageJSON tag could silently collide with a same-named field on the embeddedfinding.Finding(engine module v0.6.56, not readable from this workspace); confirm the engine'sFindinghas nocoveragetag or untaggedCoveragefield, sinceencoding/jsonwould drop both rather than error.