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

WIP: tekton: add go-unit-tests and golangci lint #347

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rphillips
Copy link
Contributor

No description provided.

@openshift-ci openshift-ci bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 19, 2024
@openshift-ci openshift-ci bot requested review from harche and mamy-CS December 19, 2024 19:01
Copy link

openshift-ci bot commented Dec 19, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rphillips

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 19, 2024
make test

- name: lint
image: golangci/golangci-lint:latest
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd recommend against latest for build tooling. Can we pin?

@rphillips rphillips force-pushed the add_tekton_lint_and_unit_tests branch 4 times, most recently from 8923e88 to 6aacaa5 Compare December 19, 2024 19:52
Makefile Outdated
@@ -138,6 +138,10 @@ vet: ## Run go vet against code.
test: manifests generate fmt vet envtest ## Run tests.
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile cover.out

.PHONY: test-unit
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you just reuse test above?

I think you are missing the dependency targets for test-unit so I think this may fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't want it to generate, or format or vet...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, maybe I need the envtest dependency?

@cpmeadors
Copy link
Contributor

For a proper CI pipeline, I think unit tests should probably block builds as they would be invalid. Same with linting. We can more forward with this PR as is, but we should probably create additional tasks in the existing PR pipelines so we can use logic to order and fail as necessary.

@rphillips rphillips force-pushed the add_tekton_lint_and_unit_tests branch 8 times, most recently from 41b7785 to 3bbdcca Compare December 19, 2024 23:01
@openshift-ci openshift-ci bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 19, 2024
@rphillips rphillips force-pushed the add_tekton_lint_and_unit_tests branch from 3bbdcca to 7edd622 Compare December 19, 2024 23:10
Copy link

openshift-ci bot commented Dec 19, 2024

@rphillips: all tests passed!

Full PR test history. Your PR dashboard.

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-sigs/prow repository. I understand the commands that are listed here.

@rphillips rphillips changed the title tekton: add go-unit-tests and golangci lint WIP: tekton: add go-unit-tests and golangci lint Dec 19, 2024
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants