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
Make CI much more effective #4564
Conversation
@KnVerey: This PR has multiple commits, and the default merge method is: merge. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: KnVerey The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test all |
/test kustomize-presubmit-master |
/test kustomize-presubmit-master |
|
||
### Begin kustomize plugin rules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire section was just lifted as-is into Makefile-plugins.mk
to make this file easier to navigate.
make $MYGOBIN/helmV3 | ||
make $MYGOBIN/helm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
neither old version seems to be used by anything anymore, so I removed the targets for these
/cc @natasha41575 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this! Some small comments
install-tools \ | ||
test-unit-kustomize-plugins \ | ||
test-go-mod \ | ||
build-non-plugin-all \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we intentionally excluding test-non-plugin-all
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, we should probably make the other CI jobs "required", right now only the CLA check and the kustomize-presubmit-master jobs are listed as required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I did that because it seemed silly to run them twice, and desirable to (eventually) run all test in all three envs, which Github Actions is set up to do. If you can think of a reason we'd want to run them in prow as well, happy to add it back.
If so, we should probably make the other CI jobs "required", right now only the CLA check and the kustomize-presubmit-master jobs are listed as required.
Really surprised by this. I think they should be required either way. I'll change that now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can think of a reason we'd want to run them in prow as well, happy to add it back.
No need to add it back. As long as it's running under a required job, removing redundancy SGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makefile
Outdated
|
||
.PHONY: test-unit-kustomize-plugins | ||
test-unit-kustomize-plugins: | ||
./hack/testUnitKustomizePlugins.sh | ||
|
||
.PHONY: test-unit-kustomize-cli | ||
test-unit-kustomize-cli: | ||
cd kustomize; go test ./... | ||
cd kustomize; $(MAKE) test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't let me comment on it, but right below this is test-unit-kustomize-all
, is there any reason to have both that and test-unit-all
?
It's also unclear to me why test-unit-kustomize-all
chooses to test api, cli, and plugins, but not the rest of our unit tests. I'd lean towards just removing it unless there's a reason we need to keep it.
Makefile
Outdated
@@ -125,8 +126,9 @@ lint: $(MYGOBIN)/golangci-lint $(MYGOBIN)/goimports $(builtinplugins) | |||
./hack/for-each-module.sh "make lint" | |||
|
|||
.PHONY: test-unit-all | |||
test-unit-all: $(builtinplugins) | |||
./hack/for-each-module.sh "make test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to use this definition, but it doesn't work right now. The plugin script is doing some setup / exlusions.
/lgtm We might want to take a look at kubernetes/test-infra#15611 (comment) to see if we can have tide take a look at the other Github checks. |
Looks like I forgot to apply the "merge-method-squash" and left 23 commits. Sorry! 😬 |
In working on the linter config for #4560, I ended up discovering that our CI configuration as a whole is seriously problematic. Most seriously, many tests are run multiple times in the same env, and many others are never run at all. The license detection check doesn't work at all, and the linter is only applying to a few modules. 😱
I made a spreadsheet to inventory the situation, and it is perhaps the best way to see the before and after I'm trying to achieve with this PR: Kustomize test job inventory
Highlights of problems fixed
plugin/
directory runs once in each GOOS (except Windows, a la Fix breaking api tests on windows #4001) via the Github Action, including on master; (2) theplugin/
directory continues to only be run by Prow. We could revisit this later, but it didn't "just work" to move them over, and I am out of time to work on this for now.go fix/fmt/tidy/vet
onkyaml
,cmd/config
andfunctions/examples/*
, but did nothing with the results. Those commands do not exit non-zero when they do something, and the git-based check that supposedly used to validate the result has been commented out for two years. I "fixed" this by not running most of them anymore, for any module.go mod tidy
specifically is still run by Prow though, because it always ran that separately for all modules.-check
flag--it would make the changes, exit zero, and tests would pass. I fixed this by creating a single license file and a script to apply it to the entire repo. The script has a check mode, which CI now uses.Other notes
hack/for-each-module.sh 'if [[ ! -f Makefile ]]; then BACKTRACKS=$(pwd | sed -e "s|.*kustomize/||" -e "s|[^/]*|..|g"); ln -s $BACKTRACKS/Makefile-modules.mk Makefile; fi'