-
Notifications
You must be signed in to change notification settings - Fork 382
New controller tests - deletion resources #2596
New controller tests - deletion resources #2596
Conversation
Hi @piotrmiskiewicz. Thanks for your PR. I'm waiting for a kubernetes-incubator or kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/hold |
a4547f2
to
9210c5f
Compare
9210c5f
to
f4b8666
Compare
b29ad9e
to
3894618
Compare
/ok-to-test |
/hold cancel |
What's the status of this? Is it ready to go? |
I would rebase this on master, as we've upgraded the kube dependencies since this was written. I'm getting a buncha test failures when I rebase this on master and run the units. |
I'll do the rebase |
c8990ad
to
4631811
Compare
It is ready to go |
4631811
to
6c7df3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not forget to execute make format
(because of that travis build failed)
Please also fix the commit message "New controller tests - deletion resources" cause it does not illustrate well what you implemented in that PR.
An additional thing that I found:
when previously it was around 0.2sec
IMO we should introduce the After rewriting all tests then the old one can be removed and under |
6c7df3e
to
f909efe
Compare
I've added |
@@ -284,13 +284,15 @@ test-update-goldenfiles: .init | |||
|
|||
build-integration: .generate_files | |||
$(DOCKER_CMD) go test -race github.com/kubernetes-sigs/service-catalog/test/integration/... -c | |||
$(DOCKER_CMD) go test --tags="integration" -race github.com/kubernetes-sigs/service-catalog/pkg/controller/... -c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we probably don't need to do this anymore. go caching should have improved everything enough that this doesn't save any time.
Need to ensure DOCKER_CMD mounts the cache dir, and we can drop the build ahead of running the tests part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree with you but maybe let's do that as the follow-up and remove the building from all the test stages (build-integration and build-e2e).
@@ -1,3 +1,5 @@ | |||
// +build integration | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these actually integration tests, or can they be moved with all of the others that already exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these actually integration tests,
those tests have the same contracts as the current integration tests but just not starting the API Server.
Some time ago we discussed that current integration tests will not work for CRDs implementation and because of that, there was created such issue: #2597
basically, the goal is to replace the integration tests of the API Server with the logic which does not require to start the API Server at all. Thanks to that we still testing the contract described in integration tests but such approach allows us to do that both for API Server and CRD implementation.
The first part was already migrated: #2580 (comment)
This is the second PR, and after merging that we will submit the 3rd PR - the final one which will move all rest tests (we have that PR already prepared)
about adding // +build integration
tag, please ready this comment
I'm having difficulties running the tests due to import conflicts from the migration, do you think you could rebase this on master? |
func (ct *controllerTest) CreateSimpleClusterServiceBroker() error { | ||
_, err := ct.scInterface.ClusterServiceBrokers().Create(ct.fixClusterServiceBroker()) | ||
return err | ||
} | ||
|
||
// CreateClusterServiceBrokerWithBasicAuth creates a ClusterServiceBroker with basic auth. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting in comments as you go, even if you weren't touching these
@@ -308,8 +484,34 @@ func (ct *controllerTest) CreateServiceInstance() error { | |||
return err | |||
} | |||
|
|||
func (ct *controllerTest) DeleteServiceInstance() error { | |||
return ct.scInterface.ServiceInstances(testNamespace).Delete(testServiceInstanceName, &v1.DeleteOptions{}) | |||
func (ct *controllerTest) UpdateServiceInstanceParameters() error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment for this one?
@@ -395,6 +634,22 @@ func (ct *controllerTest) WaitForNotReadyBinding() error { | |||
}) | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments for all these too, if you could
Took a look, it looks pretty good. |
f909efe
to
e275ae9
Compare
/test pull-service-catalog-xbuild |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jberkhahn, piotrmiskiewicz 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 |
This PR is a
What this PR does / why we need it:
The PR indroduces controller tests which will replace current integration tests, see #2597
rewritten tests:
Please leave this checklist in the PR comment so that maintainers can ensure a good PR.
Merge Checklist:
breaking the chart release and existing clients who provide a
flag that will get an error when they try to update