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

Bug 1903206: Add unit tests to verify NotReadyAddresses in EndpointSlices #231

Conversation

frobware
Copy link
Contributor

@frobware frobware commented Dec 3, 2020

Moved the existing utility function into endpointsubset package. Added
unit tests to assert on EndpointSlices having Ready/NotReady
conditions.

Follow on from #229

@openshift-ci-robot openshift-ci-robot added the bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. label Dec 3, 2020
@openshift-ci-robot
Copy link
Contributor

@frobware: This pull request references Bugzilla bug 1903206, which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, ON_DEV, POST, POST, but it is ON_QA instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1903206: Add unit tests to verify NotReadyAddresses in EndpointSlices

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.

@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Dec 3, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 3, 2020
@frobware
Copy link
Contributor Author

frobware commented Dec 3, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Dec 3, 2020
@openshift-ci-robot
Copy link
Contributor

@frobware: This pull request references Bugzilla bug 1903206, which is valid. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

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.

@frobware frobware force-pushed the routes-traffic-bz-1903206-unit-test branch from 39d3506 to 9d643ff Compare December 3, 2020 14:05
@frobware
Copy link
Contributor Author

frobware commented Dec 3, 2020

/cherry-pick release-4.6

@openshift-cherrypick-robot

@frobware: once the present PR merges, I will cherry-pick it on top of release-4.6 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.6

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.

@frobware frobware force-pushed the routes-traffic-bz-1903206-unit-test branch from 9d643ff to dad618f Compare December 3, 2020 14:37
Moved the existing utility function into endpointsubset package. Added
unit tests to assert on EndpointSlices having Ready/NotReady
conditions.

Follow on from openshift#229
@frobware frobware force-pushed the routes-traffic-bz-1903206-unit-test branch from dad618f to 26cbd10 Compare December 3, 2020 15:14
@sgreene570
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: frobware, sgreene570

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:
  • OWNERS [frobware,sgreene570]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@frobware
Copy link
Contributor Author

frobware commented Dec 3, 2020

test failures:

failed to acquire lease: resources not found

/retest

@openshift-merge-robot openshift-merge-robot merged commit 64487b0 into openshift:master Dec 3, 2020
@openshift-ci-robot
Copy link
Contributor

@frobware: All pull requests linked via external trackers have merged:

Bugzilla bug 1903206 has been moved to the MODIFIED state.

In response to this:

Bug 1903206: Add unit tests to verify NotReadyAddresses in EndpointSlices

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.

@openshift-cherrypick-robot

@frobware: #231 failed to apply on top of branch "release-4.6":

Applying: Add unit tests to verify NotReadyAddresses in EndpointSlices
Using index info to reconstruct a base tree...
M	pkg/router/controller/router_controller.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/router/controller/router_controller.go
CONFLICT (content): Merge conflict in pkg/router/controller/router_controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Add unit tests to verify NotReadyAddresses in EndpointSlices
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-4.6

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.

@frobware
Copy link
Contributor Author

frobware commented Dec 4, 2020

package endpointsubset

Although this has merged I disagree. In general always test the public API, using _test was a deliberate choice.

@frobware
Copy link
Contributor Author

frobware commented Dec 4, 2020

				t.Errorf("ConvertEndpointSlice() failed (-got +want):\n%s", diff)

@frobware: #231 failed to apply on top of branch "release-4.6":

Applying: Add unit tests to verify NotReadyAddresses in EndpointSlices
Using index info to reconstruct a base tree...
M	pkg/router/controller/router_controller.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/router/controller/router_controller.go
CONFLICT (content): Merge conflict in pkg/router/controller/router_controller.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Add unit tests to verify NotReadyAddresses in EndpointSlices
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

The cherry-pick needs #230

@frobware
Copy link
Contributor Author

frobware commented Dec 4, 2020

/cherry-pick release-4.6

@openshift-cherrypick-robot

@frobware: new pull request created: #232

In response to this:

/cherry-pick release-4.6

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.

@Miciah
Copy link
Contributor

Miciah commented Dec 4, 2020

package endpointsubset

Although this has merged I disagree. In general always test the public API, using _test was a deliberate choice.

Interesting. I didn't realize that that was allowed, but

% go help test
usage: go test [build/test flags] [packages] [build/test flags & test binary flags]

[...]

Test files that declare a package with the suffix "_test" will be compiled as a
separate package, and then linked and run with the main test binary.

https://stackoverflow.com/questions/19998250/proper-package-naming-for-testing-with-the-go-language

TIL.

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. bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants