pyrra-dev / pyrra

Making SLOs with Prometheus manageable, accessible, and easy to use for everyone!
https://demo.pyrra.dev
Apache License 2.0
1.22k stars 110 forks source link

Running `make test` on main causes modified files #748

Open BradErz opened 1 year ago

BradErz commented 1 year ago

Running the tests from the main branch causes these files to be modified.

➜  pyrra git:(main) make test
/Users/bwilsonhunt/go/bin/controller-gen rbac:roleName=pyrra-kubernetes crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
find config/crd/bases -name '*.yaml' -print0 | xargs -0 -I{} sh -c '/Users/bwilsonhunt/go/bin/gojsontoyaml -yamltojson < "$1" | jq > "/Users/bwilsonhunt/projects/personal/pyrra-dev/pyrra/config/crd/bases/$(basename -s .yaml $1).json"' -- {}
/Users/bwilsonhunt/go/bin/controller-gen object:headerFile="kubernetes/hack/boilerplate.go.txt" paths="./..."
go fmt ./...
go vet ./...
go test -race ./... -coverprofile cover.out
?       github.com/pyrra-dev/pyrra/proto/objectives/v1alpha1    [no test files]
?       github.com/pyrra-dev/pyrra/proto/objectives/v1alpha1/objectivesv1alpha1connect  [no test files]
?       github.com/pyrra-dev/pyrra/proto/prometheus/v1  [no test files]
?       github.com/pyrra-dev/pyrra/proto/prometheus/v1/prometheusv1connect      [no test files]
ok      github.com/pyrra-dev/pyrra      0.374s  coverage: 13.2% of statements
ok      github.com/pyrra-dev/pyrra/kubernetes/api/v1alpha1      0.692s  coverage: 40.7% of statements
ok      github.com/pyrra-dev/pyrra/kubernetes/controllers       0.599s  coverage: 28.9% of statements
ok      github.com/pyrra-dev/pyrra/slo  0.894s  coverage: 87.4% of statements
➜  pyrra git:(main) ✗ git diff
➜  pyrra git:(main) ✗ git status
On branch main
Your branch is up to date with 'upstream/main'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   config/crd/bases/pyrra.dev_servicelevelobjectives.json
        modified:   config/crd/bases/pyrra.dev_servicelevelobjectives.yaml
        modified:   config/rbac/role.yaml
        modified:   kubernetes/api/v1alpha1/zz_generated.deepcopy.go

no changes added to commit (use "git add" and/or "git commit -a")

Is this something which has been merged to master but the generate command hasn't been run? Or is it somehow an issue with my local env?

Sorry for the noise if not.

metalmatze commented 1 year ago

I know the role.yaml is a snowflake and I make sure we currently don't undo those changes... 😅

The rest should be updated in a PR and seems to be outdated. It's not too bad, I think as it's probably just another version of the controller generator. Feel free to send a PR for those.

Maybe we can also patch the changes to the role.yaml from the Makefile after it has been generated. 😊