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

test update which should break tests, do not merge #1642

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

Conversation

xavpaice
Copy link
Member

@xavpaice xavpaice commented Oct 9, 2024

This PR is to demonstrate that tests should fail when make generate runs on a changed file.

DO NOT MERGE

@xavpaice xavpaice requested a review from a team as a code owner October 9, 2024 06:22
@xavpaice
Copy link
Member Author

The tests passed, but:

➜  troubleshoot git:(xp/break-tests) make check-schemas
go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.16.2
go install k8s.io/code-generator/cmd/client-gen@v0.28.13
/Users/xavpaice/go/bin/controller-gen \
		object:headerFile=./hack/boilerplate.go.txt paths=./pkg/apis/...
/Users/xavpaice/go/bin/client-gen \
		--output-base=./../../../ \
		--output-package=github.com/replicatedhq/troubleshoot/pkg/client \
		--clientset-name troubleshootclientset \
		--input-base github.com/replicatedhq/troubleshoot/pkg/apis \
		--input troubleshoot/v1beta1 \
		--input troubleshoot/v1beta2 \
		-h ./hack/boilerplate.go.txt
go fmt ./pkg/... ./cmd/... ./internal/...
go vet -tags "netgo containers_image_ostree_stub exclude_graphdriver_devicemapper exclude_graphdriver_btrfs containers_image_openpgp" -installsuffix netgo ./pkg/... ./cmd/... ./internal/...
controller-gen crd +output:dir=./config/crds  paths=./pkg/apis/troubleshoot/v1beta1
controller-gen crd +output:dir=./config/crds  paths=./pkg/apis/troubleshoot/v1beta2
go build -ldflags " -s -w -X github.com/replicatedhq/troubleshoot/pkg/version.version=`git describe --tags --dirty` -X github.com/replicatedhq/troubleshoot/pkg/version.gitSHA=`git rev-parse HEAD` -X github.com/replicatedhq/troubleshoot/pkg/version.buildTime=`date -u +"%Y-%m-%dT%H:%M:%SZ"` " -o bin/schemagen github.com/replicatedhq/troubleshoot/cmd/schemagen
./bin/schemagen --output-dir ./schemas
The git repo is dirty :( Ensure all generated files are committed e.g CRD schema files
 M pkg/client/troubleshootclientset/typed/troubleshoot/v1beta2/supportbundle.go
make: *** [check-schemas] Error 1
➜  troubleshoot git:(xp/break-tests) ✗ echo $?
2

@xavpaice
Copy link
Member Author

Current state: when you run make check-schemas on my local machine, it makes changes (as expected). In a Github runner, it does not. The change here allows you to use tmate to ssh in to the runner to take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant