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

refactor(serving): KnClient interface for single point of cluster access [ginkgo version] #214

Closed
wants to merge 2 commits into from

Conversation

rhuss
Copy link
Contributor

@rhuss rhuss commented Jun 29, 2019

This PR exactly the same as #134 except that the test is implemented with Gingko.

The purpose of this PR is to get a feeling for the difference in writing tests in Ginkgo and/or a testframework baset on Golang's intrinsic testing with some sugar added.

The relevant tests to compare are:

Follow the discussion overthere whether to pick up this PR or #134

@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jun 29, 2019
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhuss

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

@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 29, 2019
@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-client-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/kn/commands/namespaced.go 87.5% 72.7% -14.8
pkg/kn/commands/revision/revision_describe.go 79.2% 78.3% -0.9
pkg/kn/commands/revision/revision_list.go 81.2% 80.6% -0.7
pkg/kn/commands/service/service_create.go 69.0% 68.6% -0.4
pkg/kn/commands/service/service_describe.go 79.2% 78.3% -0.9
pkg/kn/commands/service/service_list.go 80.0% 79.2% -0.8
pkg/serving/schema_handling.go Do not exist 91.7%
pkg/serving/v1alpha1/client.go Do not exist 75.7%

@rhuss rhuss added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 29, 2019
@maximilien
Copy link
Contributor

Thanks for doing this work @rhuss!
Nice of you going the extra mile to show concrete non-trivial example.
I am ambivalent as to which wins. The great thing is either will be better than what we have now.
So happy whichever decision we (as a team makes): Ginkgo or gotest.tools.

🍻

@rhuss
Copy link
Contributor Author

rhuss commented Jul 1, 2019

I am ambivalent as to which wins. The great thing is either will be better than what we have now.
So happy whichever decision we (as a team makes): Ginkgo or gotest.tools.

cool, thanks for your feedback. Let's see how this discussion goes tomorrow, but I expect a definitive decision then.

Then, when we merge either of the two PR, we have also the benefit that in the command unit tests we soon don't have to bother with faking the knative API directly (this is done in the test for KnClient as shown), but with an own mock implementation of the KnClient interface. I will work on this soon after one of these PRs are merged.

@rhuss
Copy link
Contributor Author

rhuss commented Jul 2, 2019

closing as the gotest.tools version from #134 goes in.

@rhuss rhuss closed this Jul 2, 2019
@rhuss rhuss deleted the pr/add-schema-handling-ginko-test branch March 9, 2021 10:32
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. cla: yes Indicates the PR's author has signed the CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants