Skip to content

chore(tests): archive test results in json format with CI runs - #9011

Closed
rajatjindal wants to merge 1 commit into
dagger:mainfrom
rajatjindal:gotestsum
Closed

rajatjindal wants to merge 1 commit into
dagger:mainfrom
rajatjindal:gotestsum

Conversation

@rajatjindal

Copy link
Copy Markdown
Contributor

this is just a poc to try out gotestsum with CI. The benefits includes a little clearer output (more work needs to be done there) and that we can archive results in a json file, which we can then ingest in a tests dashboard to look at the trends over the executions.

happy to discuss if folks have opinions/concerns regarding this. I am just evaluating how this can improve debugging of CI and finding flakes.

@rajatjindal
rajatjindal force-pushed the gotestsum branch 3 times, most recently from 85bbba4 to f46cdaf Compare November 21, 2024 05:30
@rajatjindal
rajatjindal marked this pull request as ready for review November 21, 2024 05:32
@rajatjindal

rajatjindal commented Nov 21, 2024 •

Copy link
Copy Markdown
Contributor Author

I want to open it up for discussion. The main objective of this PR is to add test results as artifact to the github actions runs.

The next step is to write a tool to ingest these test results and get some analytics from it. (identify flakes, execution times trends etc)

@rajatjindal rajatjindal changed the title DRAFT: try gotestsum with ci chore(tests): archive test results in json format with CI runs Nov 21, 2024
@rajatjindal rajatjindal mentioned this pull request Nov 21, 2024
2 of 5 tasks

@gerhard gerhard left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is almost there!

I can definitely see us approving & merging this after this is rebased against main & all conflicts are solved.

@jedevc jedevc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@vito removed gotestsum in #7532 (comment).

I can't fully remember why, but probably worth checking first.

Comment thread .dagger/test.go Outdated
WithEnvVariable("_EXPERIMENTAL_DAGGER_RUNNER_HOST", endpoint).
With(t.Dagger.withDockerCfg) // this avoids rate limiting in our ci tests
With(t.Dagger.withDockerCfg). // this avoids rate limiting in our ci tests
WithExec([]string{"sh", "-c", "go install gotest.tools/[email protected]"})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should avoid installs at this point - this will require a fresh download every single time we change any of the things in the pipeline above.

@vito

vito commented Nov 26, 2024

Copy link
Copy Markdown
Contributor

I can't fully remember why, but probably worth checking first.

No big reason, just seemed redundant with the new testctx integration. I suspect the rest of this PR will become unnecessary once we implement analytics in Cloud, but we're not there yet, so seems fine to bring it back

@rajatjindal

Copy link
Copy Markdown
Contributor Author

I suspect the rest of this PR will become unnecessary once we implement analytics in Cloud,

Hi @vito, could you please elaborate which part of the PR do you mean here? also do you happen to have some more details on the analytics we are planning on introducing in the cloud?

thanks

@vito

vito commented Nov 27, 2024

Copy link
Copy Markdown
Contributor

@rajatjindal Sorry, I meant basically the whole PR - my understanding is the goal of this PR is to generate a test report so we can analyze test performance over time, right now with some external system (?) consuming those JSON files. That's exactly the goal of analytics in Cloud, but the plan there is to use the span data that we already emit instead of requiring the user to generate a test report (with a compat. layer for converting reports to OTel if there isn't any native test integration available).

But, that's not currently in progress - we're probably a few iterations away, so it makes sense to go forward with this for now. 👍

Comment thread .dagger/test.go
return t.publishTestResults(ctx, ctr)
}

func (t *Test) publishTestResults(ctx context.Context, ctr *dagger.Container) error {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we split this publishing up to the dashboard site into a separate PR?

I'm a little worried about exporting our test results to an external service that can go down that we don't have full control over. I think we need more discussion on this. If we do do this, I don't think it should be part of every test call, which is also used locally - it would need to have logic to only apply in CI.

The rest of the PR around gotestsum/etc looks good, and I don't want to block those changes from getting in while we're discussing that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

apologies for the noise. But this endpoint is temporary here. Me and @gerhard had discussion regarding this and we are going to deploy this service on dagger infrastructure. This is me just testing out stuff and making sure other things are aligned and work.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I just changed this PR back to being a draft PR until I am done testing other things.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @jedevc

The URL has been updated to post the test results to dashboard deployed on dagger infra. I hope we can mark this comment as resolved?

Comment thread .dagger/test.go Resolved
Comment thread modules/go/main.go Resolved
Comment thread .github/workflows/engine-and-cli.yml Resolved
@rajatjindal
rajatjindal marked this pull request as draft November 29, 2024 12:18
@rajatjindal
rajatjindal force-pushed the gotestsum branch 6 times, most recently from 7d8809a to 752a463 Compare December 8, 2024 11:42
@rajatjindal
rajatjindal force-pushed the gotestsum branch 2 times, most recently from 89ef579 to 3c85637 Compare January 1, 2025 10:02
@rajatjindal

Copy link
Copy Markdown
Contributor Author

to make sure we don't miss it among other things: there is a failure happening which seems likely due to these changes:

multi.go:85: 88 : Host.directory(path: "/app"): Directory!
multi.go:85: 92 : │ filesync
multi.go:85: 92 : │ filesync ERROR [0.2s]
multi.go:85: 92 : │ ! failed to sync: conflict at "testresults.json": size changed from "8388059" to "8428160" during sync
multi.go:85: 89 : │ upload /app from x0hfej85gfigcnz5mt6nahap7 (client id: if31f540x18253ycvfnwd8mwp, session id: szgx9vf13z1kk2eid885olwqo) ERROR [0.2s]
multi.go:85: 89 : │ ! failed to get snapshot: failed to sync: conflict at "testresults.json": size changed from "8388059" to "8428160" during sync
multi.go:85: 88 : Host.directory ERROR [0.2s]
multi.go:85: 88 : ! host directory /app: failed to get snapshot: failed to sync: conflict at "testresults.json": size changed from "8388059" to "8428160" during sync

I am trying to figure out why this is happening.

@rajatjindal
rajatjindal marked this pull request as ready for review January 2, 2025 02:46
@rajatjindal

Copy link
Copy Markdown
Contributor Author

to make sure we don't miss it among other things: there is a failure happening which seems likely due to these changes:

multi.go:85: 88 : Host.directory(path: "/app"): Directory!
multi.go:85: 92 : │ filesync
multi.go:85: 92 : │ filesync ERROR [0.2s]
multi.go:85: 92 : │ ! failed to sync: conflict at "testresults.json": size changed from "8388059" to "8428160" during sync
multi.go:85: 89 : │ upload /app from x0hfej85gfigcnz5mt6nahap7 (client id: if31f540x18253ycvfnwd8mwp, session id: szgx9vf13z1kk2eid885olwqo) ERROR [0.2s]
multi.go:85: 89 : │ ! failed to get snapshot: failed to sync: conflict at "testresults.json": size changed from "8388059" to "8428160" during sync
multi.go:85: 88 : Host.directory ERROR [0.2s]
multi.go:85: 88 : ! host directory /app: failed to get snapshot: failed to sync: conflict at "testresults.json": size changed from "8388059" to "8428160" during sync

I am trying to figure out why this is happening.

this is now fixed.

@gerhard @jedevc I believe this PR is ready for review/merge.

Thanks

@rajatjindal
rajatjindal requested a review from jedevc January 2, 2025 11:33
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions

github-actions Bot commented Feb 3, 2025

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions

Copy link
Copy Markdown
Contributor

This PR was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions Bot closed this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants