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

feat: test packages separately #150

Merged
merged 33 commits into from
Apr 22, 2024
Merged

Conversation

trevorwhitney
Copy link
Collaborator

@trevorwhitney trevorwhitney commented Apr 17, 2024

This PR improves the check phase of our build (that runs for both releases and PRs) by ~4m, decreasing the current runtime of ~9m30s to ~5m30s. It does this by splitting out our tests in a job per package using GitHub actions 'matrix' job strategy.

This is what it will look like run on grafana/loki: https://github.com/grafana/loki/actions/runs/8726432895

@trevorwhitney trevorwhitney marked this pull request as draft April 18, 2024 15:35
@trevorwhitney trevorwhitney marked this pull request as ready for review April 19, 2024 17:28
collectPackages: job.new()
+ job.withSteps([
common.checkout,
common.fixDubiousOwnership,
Copy link
Contributor

Choose a reason for hiding this comment

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

lolwut

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

haha, that's the error git gives when doing git stuff in a mounted volume in a container

+ step.withId('gather-tests')
+ step.withRun(|||
echo "packages=$(find . -path '*_test.go' -printf '%h\n' \
| grep -e "pkg/push" -e "integration" -e "operator" -e "lambda-promtail" -v \
Copy link
Contributor

Choose a reason for hiding this comment

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

so to be clear, we're not running the integration or operator tests anymore? and pkg/push and lambda-promtail will be run as separate jobs?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

not running operator, correct, it has it's own workflow that's guarded on changes to that folder. we are running integration tests just in a different, parallel job

@trevorwhitney
Copy link
Collaborator Author

going to merge monday in case there's fallout

@trevorwhitney trevorwhitney merged commit aaf0010 into main Apr 22, 2024
26 checks passed
@trevorwhitney trevorwhitney deleted the test-packages-individually branch April 22, 2024 17:16
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