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

Tests don't pass #23

Closed
cdrage opened this issue Feb 6, 2019 · 6 comments
Closed

Tests don't pass #23

cdrage opened this issue Feb 6, 2019 · 6 comments

Comments

@cdrage
Copy link
Contributor

cdrage commented Feb 6, 2019

I'm not too sure what I'm doing wrong, I'm using go 1.11.5 and this is on master:

dev/k8s/knative-client  master ✔                                                                                                                                            15h29m  ⍉
▶ go test ./pkg/...                                  
go: finding k8s.io/client-go/tools/metrics latest
go: finding k8s.io/client-go/transport latest
go: finding k8s.io/client-go/util/jsonpath latest
go: finding k8s.io/client-go/util/flowcontrol latest
go: finding k8s.io/client-go/testing latest
go: finding k8s.io/client-go/util/homedir latest
go: finding k8s.io/client-go/tools/clientcmd latest
go: finding k8s.io/client-go/util/cert latest
go: finding k8s.io/client-go/util/connrotation latest
go: finding k8s.io/client-go/tools/clientcmd/api latest
go: finding k8s.io/client-go/tools latest
go: finding k8s.io/client-go/util latest
go: finding k8s.io/client-go/tools/cache latest
# github.com/knative/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake
../../go/pkg/mod/github.com/knative/serving@v0.3.0/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake/fake_configuration.go:131:44: not enough arguments in call to testing.NewPatchSubresourceAction
        have (schema.GroupVersionResource, string, string, []byte, []string...)
        want (schema.GroupVersionResource, string, string, types.PatchType, []byte, ...string)
../../go/pkg/mod/github.com/knative/serving@v0.3.0/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake/fake_revision.go:131:44: not enough arguments in call to testing.NewPatchSubresourceAction
        have (schema.GroupVersionResource, string, string, []byte, []string...)
        want (schema.GroupVersionResource, string, string, types.PatchType, []byte, ...string)
../../go/pkg/mod/github.com/knative/serving@v0.3.0/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake/fake_route.go:131:44: not enough arguments in call to testing.NewPatchSubresourceAction
        have (schema.GroupVersionResource, string, string, []byte, []string...)
        want (schema.GroupVersionResource, string, string, types.PatchType, []byte, ...string)
../../go/pkg/mod/github.com/knative/serving@v0.3.0/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake/fake_service.go:131:44: not enough arguments in call to testing.NewPatchSubresourceAction
        have (schema.GroupVersionResource, string, string, []byte, []string...)
        want (schema.GroupVersionResource, string, string, types.PatchType, []byte, ...string)
FAIL    github.com/knative/client/pkg/kn/commands [build failed]

and using the other command go test ./...

dev/k8s/knative-client  master ✗                                                                                                                                          15h29m ⚑  ⍉
▶ go test ./...
# github.com/knative/serving/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake
../../go/pkg/mod/github.com/knative/serving@v0.3.0/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake/fake_configuration.go:131:44: not enough arguments in call to testing.NewPatchSubresourceAction
        have (schema.GroupVersionResource, string, string, []byte, []string...)
        want (schema.GroupVersionResource, string, string, types.PatchType, []byte, ...string)
../../go/pkg/mod/github.com/knative/serving@v0.3.0/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake/fake_revision.go:131:44: not enough arguments in call to testing.NewPatchSubresourceAction
        have (schema.GroupVersionResource, string, string, []byte, []string...)
        want (schema.GroupVersionResource, string, string, types.PatchType, []byte, ...string)
../../go/pkg/mod/github.com/knative/serving@v0.3.0/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake/fake_route.go:131:44: not enough arguments in call to testing.NewPatchSubresourceAction
        have (schema.GroupVersionResource, string, string, []byte, []string...)
        want (schema.GroupVersionResource, string, string, types.PatchType, []byte, ...string)
../../go/pkg/mod/github.com/knative/serving@v0.3.0/pkg/client/clientset/versioned/typed/serving/v1alpha1/fake/fake_service.go:131:44: not enough arguments in call to testing.NewPatchSubresourceAction
        have (schema.GroupVersionResource, string, string, []byte, []string...)
        want (schema.GroupVersionResource, string, string, types.PatchType, []byte, ...string)
?       github.com/knative/client/cmd/kn        [no test files]
FAIL    github.com/knative/client/pkg/kn/commands [build failed]
@cdrage cdrage mentioned this issue Feb 6, 2019
@copejon
Copy link

copejon commented Mar 5, 2019

I've just hit this issue as well in my own project. The generated clientset code's tests appear to have malformed parameters lists:

$ go build -a ./...
# <omitted>
pkg/client/clientset/versioned/typed/objectbucket.io/v1alpha1/fake/fake_objectbucket.go:126:48: not enough arguments in call to testing.NewRootPatchSubresourceAction
        have (schema.GroupVersionResource, string, []byte, []string...)
        want (schema.GroupVersionResource, string, types.PatchType, []byte, ...string)
pkg/client/clientset/versioned/typed/objectbucket.io/v1alpha1/fake/fake_objectbucketclaim.go:134:44: not enough arguments in call to testing.NewPatchSubresourceAction
        have (schema.GroupVersionResource, string, string, []byte, []string...)
        want (schema.GroupVersionResource, string, string, types.PatchType, []byte, ...string)

I've tried deleting and regenerated the respective files without success.

Using k8s.io/code-generator (from dep's Gopkg.toml)

[[override]]
  name = "k8s.io/code-generator"
  version = "kubernetes-1.12.3"

@copejon
Copy link

copejon commented Mar 5, 2019

Found a solution here: kubernetes-retired/cluster-registry#271

I fixed this in my project by updating my deps to 1.13.1 and regenerating the clientset:

[[override]]
  name = "k8s.io/code-generator"
  version = "kubernetes-1.13.1"

[[constraint]]
  name = "k8s.io/client-go"
  version = "kubernetes-1.13.1"

[[constraint]]
  name = "k8s.io/apimachinery"
  version = "kubernetes-1.13.1"

[[constraint]]
  name = "k8s.io/api"
  version = "kubernetes-1.13.1"

@cdrage
Copy link
Contributor Author

cdrage commented Mar 5, 2019

@copejon Do you know what the steps are to fix? I thought the dependencies were pinned (ping @sixolet). Bit confused how to actually fix / prevent this from happening.

@navidshaikh
Copy link
Collaborator

navidshaikh commented Mar 6, 2019

@cdrage : I think the tests are passing now

➜  client git:(master)  go test -v ./pkg/...
go: finding github.com/knative/test-infra/scripts latest
go: finding github.com/knative/test-infra latest
go: downloading github.com/knative/test-infra v0.0.0-20190305224539-804daea55392
=== RUN   TestDummy
--- PASS: TestDummy (0.00s)
PASS
ok  	github.com/knative/client/pkg	0.001s
=== RUN   TestDescribeRevisionWithNoName
--- PASS: TestDescribeRevisionWithNoName (0.00s)
=== RUN   TestDescribeRevisionYaml
--- PASS: TestDescribeRevisionYaml (0.00s)
=== RUN   TestEmptyServiceDescribe
--- PASS: TestEmptyServiceDescribe (0.00s)
=== RUN   TestServiceDescribeDefaultOutput
--- PASS: TestServiceDescribeDefaultOutput (0.00s)
=== RUN   TestListEmpty
--- PASS: TestListEmpty (0.00s)
=== RUN   TestListDefaultOutput
--- PASS: TestListDefaultOutput (0.00s)
PASS
ok  	github.com/knative/client/pkg/kn/commands	(cached)

@copejon
Copy link

copejon commented Mar 12, 2019

@cdrage The steps to fix are a bit messy. Describing exactly what I did won't be very useful as it was specific to my dependencies' versions. The end goal with k8s dependencies was to get them all on the same version. The version mismatch between code-generation, schema packages, client-go, and apimachinery meant that older versions of generated code caused more recently versioned consumers of that code to fail.

Specifically, k8s 1.13 packages couldn't use older generated client code. So I had to update all my k8s package versions in the Gopkg.toml, run deps ensure --update and regenerated the client with the (no updated) code-generator scripts.

@frobware
Copy link

cc @frobware

@sixolet sixolet closed this as completed May 17, 2019
coryrc pushed a commit to coryrc/client that referenced this issue May 14, 2020
* add functions in `library.sh` to install the latest Knative Serving and Knative Build;
* fix getting the canonical path to the end-to-end test script in `e2e-tests.sh`;
* fix call to `dump_cluster_state` on failure in `e2e-tests.sh`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants