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

introduce method to radically speed up unit tests #9314

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

Conversation

ScottSuarez
Copy link
Collaborator

by omitting packages where no unit tests exist and only integration tests are run

…s where no unit tests exist and only integration tests are run
@ScottSuarez ScottSuarez requested a review from a team as a code owner February 12, 2025 22:11
Copy link

** WARNING **: This repository is generated by https://github.com/GoogleCloudPlatform/magic-modules. Any changes made directly to this repository will likely be overwritten. If you have further questions, please feel free to ping your reviewer or, internal employees, reach out to one of the engineers. Thank you!

@github-actions github-actions bot requested a review from c2thorn February 12, 2025 22:11
@ScottSuarez ScottSuarez removed the request for review from c2thorn February 12, 2025 22:13
@ScottSuarez
Copy link
Collaborator Author

ehh, @melinath

I tried to see if I could shave off some unit test runtime by excluding packages that don't have any.

I was able to shave 2m off the runtime, but I don't think it's worth the introduced complexity. wdyt?

Copy link
Collaborator

@melinath melinath left a comment

Choose a reason for hiding this comment

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

overall this seems reasonable to me - I wonder if it could make sense to merge parts of it into the mm test analysis code, since it's doing similar work?

Switching to bazel might make this obsolete but that's probably fine / that's a ways off.

Also, make sure to not add the binary to the PR.

@dirs=$$(go list -e $(TEST) | xargs -I {} go list -f '{{.Dir}}' {} | tr '\n' ' ' ); \
results=$$(./scripts/package-needs-unit-testing/pnut $$dirs); \
testable_packages=""; \
for result in $$results; do \
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd rather have this logic in the Go code if possible.

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.

2 participants