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

Fix unit test coverage reports, add E2E flake reports #5668

Merged
merged 3 commits into from
May 10, 2024

Conversation

negz
Copy link
Member

@negz negz commented May 9, 2024

Description of your changes

This PR:

As part of setting up Buildpulse I've configured our E2E tests to be less verbose when everything is going well. I believe they'll still give us plenty of context for failed tests.

I have:

Need help with this checklist? See the cheat sheet.

@negz negz requested a review from a team as a code owner May 9, 2024 22:19
@negz negz requested a review from turkenh May 9, 2024 22:19
@negz
Copy link
Member Author

negz commented May 9, 2024

I see that this fixes Codecov coverage publishing, which is great. We haven't had the codecov/project check on our PRs in some time.

I also really like how the E2E tests are summarized now. Color output, and you can expand each test to see its details. I think we should do the same for unit tests, but that will require adding gotestsum to the build submodule.

I'm not sure about Buildpulse yet. It seems like maybe it won't work on PRs? It needs a token to upload coverage, but PRs don't get access to the token. I'd like to merge it anyway and try it out.

@negz negz force-pushed the testy branch 2 times, most recently from 01eb15b to 7f63bc9 Compare May 9, 2024 23:28
negz added 3 commits May 9, 2024 16:32
This generates JUnit files that are used to detect flaky tests.

It uses gotestsum to generate the files. As part of this change I've
made gotestsum lower the verbosity of E2E tests - I believe we'll only
get a detailed summary of test failures.

Signed-off-by: Nic Cope <nicc@rk0n.org>
Without this token we're being severely rate limited when uploading
coverage to Codecov.

Signed-off-by: Nic Cope <nicc@rk0n.org>
Signed-off-by: Nic Cope <nicc@rk0n.org>
Copy link
Contributor

@phisco phisco left a comment

Choose a reason for hiding this comment

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

LGTM in theory, but I couldn't manage to get access to buildpulse, should i be able to see something just by logging in with my gh user?

Copy link
Member

@jbw976 jbw976 left a comment

Choose a reason for hiding this comment

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

Very cool @negz, thanks for taking action to start driving our e2e tests towards higher quality! 😎

This looks like a good place to start at least, hopefully buildpulse will work for us since that functionality would be helpful right now. Left one comment about further troubleshooting the error with uploading buildpulse results.

Also, I can access the buildpulse account OK on https://app.buildpulse.io/@crossplane with just my GH account, so perhaps organization level perms are needed @phisco - I don't see any configuration options for that, but the UI is quite sparse so far...

with:
account: 45158470
repository: 147886080
key: ${{ secrets.BUILDPULSE_ACCESS_KEY_ID }}
Copy link
Member

Choose a reason for hiding this comment

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

It seems like maybe it won't work on PRs? It needs a token to upload coverage, but PRs don't get access to the token.

Looks like you've configured this correctly given the buildpulse usage docs.

Weird that the error message in Publish e2e test flakes indicates an environment variable is missing:

missing required environment variable: BUILDPULSE_ACCESS_KEY_ID

Is it worth trying to also set this value to an env: key as per github docs, even though buildpulse docs only show it under the with: key? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

looking at other people's pipelines it looks like it should work. But it's strange that in their case it shows them as set:
image
While here it doesn't:
image

Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it's not some gha shenanigan and it'll work once it's on main 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

aha! Anyone with collaborator access to this repository can use these secrets and variables for actions. They are not passed to workflows that are triggered by a pull request from a fork.

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately it looks like it'll only work when they implement tokenless upload as codecov did here. But given that it's actually ignored, as even if it's failing, that step is marked as successful, we can leave it as is, maybe one day it'll be fixed upstream and will work also for PRs, or maybe it's already working fine, but I don't know where to look at 😅

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for investigating @phisco! so since CI is run on master after each PR is merged, we'll probably start getting data on history master and that will be a good place to start 💪

@phisco phisco merged commit f626e8a into crossplane:master May 10, 2024
15 of 17 checks passed
@phisco
Copy link
Contributor

phisco commented May 10, 2024

I also really like how the E2E tests are summarized now. Color output, and you can expand each test to see its details. I think we should do the same for unit tests, but that will require adding gotestsum to the build submodule.

Similar to what Ginkgo/Gomega had out of the box, just saying 😅

@jbw976
Copy link
Member

jbw976 commented May 10, 2024

Sweet, we're starting to get data from master now: https://app.buildpulse.io/@crossplane/crossplane

@jbw976
Copy link
Member

jbw976 commented May 10, 2024

Also opened a related umbrella issue for e2e reliability: #5671

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.

3 participants