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 w/o grouping run in golden test #236

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sonalmahajan15
Copy link
Contributor

@sonalmahajan15 sonalmahajan15 commented Apr 25, 2024

This PR updates the golden test in CI to run under two modes: with and without grouping of similar errors.

@sonalmahajan15 sonalmahajan15 changed the title Add w/ and w/o grouping to golden test Add w/o grouping run in golden test Apr 25, 2024
Copy link

codecov bot commented Apr 25, 2024

Codecov Report

Attention: Patch coverage is 30.00000% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 87.46%. Comparing base (f3f320c) to head (fc95ef9).

Files Patch % Lines
tools/cmd/golden-test/main.go 30.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #236      +/-   ##
==========================================
- Coverage   87.49%   87.46%   -0.04%     
==========================================
  Files          61       61              
  Lines        7804     7808       +4     
==========================================
+ Hits         6828     6829       +1     
- Misses        797      799       +2     
- Partials      179      180       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@uber-go uber-go deleted a comment from github-actions bot Apr 25, 2024
@sonalmahajan15 sonalmahajan15 force-pushed the sonalmahajan15/add-grouping-argument-to-golden-test branch from c286433 to c51fd21 Compare April 25, 2024 22:30
@uber-go uber-go deleted a comment from github-actions bot Apr 25, 2024
@uber-go uber-go deleted a comment from github-actions bot Apr 25, 2024
@uber-go uber-go deleted a comment from github-actions bot Apr 25, 2024
@uber-go uber-go deleted a comment from github-actions bot Apr 25, 2024
Copy link

github-actions bot commented Apr 26, 2024

Golden Test w/o grouping

Note

✅ NilAway errors reported on standard libraries are identical.

5841 errors on base branch (main, f3f320c)
5841 errors on test branch (71694b4)

Copy link

github-actions bot commented Apr 26, 2024

Golden Test w/ grouping

Note

✅ NilAway errors reported on standard libraries are identical.

3296 errors on base branch (main, f3f320c)
3296 errors on test branch (71694b4)

@sonalmahajan15 sonalmahajan15 force-pushed the sonalmahajan15/add-grouping-argument-to-golden-test branch from 8e74ba8 to fc95ef9 Compare April 29, 2024 20:26
@@ -55,7 +55,7 @@ type BranchResult struct {

// Run runs the golden tests on the base branch and the test branch and writes the summary and
// diff to the writer.
func Run(writer io.Writer, baseBranch, testBranch string) error {
func Run(writer io.Writer, baseBranch, testBranch, groupingFlag string) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: it would probably be better if we actually take a bool here and convert to string within this function for better type safety :)

Comment on lines +14 to +21
strategy:
matrix:
include:
- grouping: 'w/ grouping'
group_errors: 'true'
- grouping: 'w/o grouping'
group_errors: 'false'

Copy link
Contributor

Choose a reason for hiding this comment

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

Creating two jobs (that are running in parallel) is a good idea since golden test can easily run for several minutes.

But this would actually create two comments in the PR, which may hinder the readability for other comments.

Instead, can we keep the two jobs here (with id golden-test-w-grouping and golden-test-wo-grouping) with output, and extract the uploading step to be a separate job that depends on these two jobs, reads the output from these two jobs, and construct the message together and upload only once.

It shouldn't be too complex I think, and offers better messages for readability. What do you think?

@@ -178,12 +178,16 @@ func ParseDiagnostics(reader io.Reader) (map[Diagnostic]bool, error) {

// WriteDiff writes the summary and the diff (if the base and test are different) between the base
// and test diagnostics to the writer. If the writer is os.Stdout, it will write the diff in color.
func WriteDiff(writer io.Writer, branches [2]*BranchResult) {
func WriteDiff(writer io.Writer, branches [2]*BranchResult, groupingFlag string) {
Copy link
Contributor

Choose a reason for hiding this comment

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

same as above: should we just use a bool and only convert whenever we have to for better type safety?

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.

None yet

2 participants