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

Add verification and testing targets for CI #4

Merged
merged 5 commits into from
May 18, 2020

Conversation

ixdy
Copy link
Contributor

@ixdy ixdy commented May 18, 2020

This PR updates make test to use gotestsum (for better test reporting), including automatically generating junit when run in the Prow environment.

It also adds several verification checks, wrapped by the make verify rule:

  • verify-boilerplate, imported from repo-infra (without using the bazel target)
  • verify-lint, which uses golangci-lint (with possibly too many linters enabled; further tuning may be necessary)
  • verify-modules, which ensures that the go modules files are up-to-date.

After this is in, we should be able to create one or more Prow jobs that run make build, make test, and make verify.

/assign @alvaroaleman

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 18, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ixdy

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 18, 2020
cd "${TMP_REPO}/boskos"
make update-modules >/dev/null

if !(git diff --quiet HEAD -- go.sum go.mod hack/tools/go.mod hack/tools/go.sum); then
Copy link
Member

Choose a reason for hiding this comment

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

I think the leading ! is wrong?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the parens were weird (I basically copied this from a Makefile) so I've now removed them, but otherwise this should do the right thing - git exits 0 if no diff, nonzero if diff, so we want to invert that.

go test ./...
.PHONY: test
test: $(GOTESTSUM)
$(GOTESTSUM) $${ARTIFACTS:+--junitfile="${ARTIFACTS}/junit.xml"} ./...
Copy link
Member

Choose a reason for hiding this comment

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

TILd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is maybe too clever, but it works for now...

@alvaroaleman
Copy link
Member

/lgtm
We should activate that the github review can be used to approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 18, 2020
@k8s-ci-robot k8s-ci-robot merged commit 7ff775c into kubernetes-sigs:master May 18, 2020
@ixdy ixdy mentioned this pull request May 20, 2020
14 tasks
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants