Skip to content

Conversation

@gut
Copy link
Contributor

@gut gut commented Jun 3, 2018

No description provided.

@gut
Copy link
Contributor Author

gut commented Jun 3, 2018

Note: since googleapis/google-api-python-client#499, the python test that authenticate are actually broken. I'll fix it afterwards for all image_tests, ok?

@gut gut mentioned this pull request Jun 3, 2018
# traffic from a different IP even if the router is sending traffic to it.
# This was a test to guarantee that behavior.
try:
TestForwardingRule(MM(compute, testee), testee)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to raise an exception here: the TestForwardingRule should not work on this case. Hang on..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@gut gut force-pushed the network-integration-test branch 2 times, most recently from 7836abd to 28ba908 Compare June 5, 2018 15:35
@adjackura
Copy link
Contributor

/ok-to-test

@codecov
Copy link

codecov bot commented Jun 5, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@c184a43). Click here to learn what that means.
The diff coverage is 47.46%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #434   +/-   ##
=========================================
  Coverage          ?   71.76%           
=========================================
  Files             ?       39           
  Lines             ?     3814           
  Branches          ?        0           
=========================================
  Hits              ?     2737           
  Misses            ?      879           
  Partials          ?      198
Flag Coverage Δ
#go_unittests 71.76% <47.46%> (?)
Impacted Files Coverage Δ
daisy/region.go 0% <0%> (ø)
daisy/step.go 75.37% <0%> (ø)
daisy/workflow.go 79.78% <100%> (ø)
daisy/forwarding_rule.go 25.49% <25.49%> (ø)
daisy/target_instance.go 27.65% <27.65%> (ø)
daisy/resource.go 71.25% <31.81%> (ø)
daisy/compute/test_client.go 87.77% <54.54%> (ø)
daisy/compute/compute.go 67.94% <55.37%> (ø)
daisy/step_create_forwarding_rule.go 75% <75%> (ø)
daisy/step_create_target_instance.go 75% <75%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c184a43...7371fa9. Read the comment docs.

@gut gut force-pushed the network-integration-test branch from 28ba908 to 647e8f7 Compare June 5, 2018 21:54
@gut
Copy link
Contributor Author

gut commented Jun 5, 2018

rebased PR and adjusted content

@adjackura
Copy link
Contributor

I feel like a lot of this logic could and should be moved into the daisy workflow. I don't like the idea of maintaining an additional compute library just for tests when daisy can set all that up.

For example if we added steps to add forwarding rules, that way we don't need to add all the logic in for cleanup. This may require a test case for the positive case and the negative but thats ok if it means less code.

@gut
Copy link
Contributor Author

gut commented Jun 7, 2018

I feel like a lot of this logic could and should be moved into the daisy workflow. I don't like the idea of maintaining an additional compute library just for tests when daisy can set all that up.

That's right. It seems like a bunch of reimplementation, right? There is daisy, the python library, this utils.py... I may reanalize that as you suggested.

For example if we added steps to add forwarding rules, that way we don't need to add all the logic in for cleanup. This may require a test case for the positive case and the negative but thats ok if it means less code.

I can start by implementing this part but I guess we need to reassess what is being done on this python tests.

If that works well, then I'd rather send a new pull request than to update this one, if that's ok for you. If so, please close this without merging.

@gut
Copy link
Contributor Author

gut commented Jun 15, 2018

@zmarano btw, Is this test wrongly defined?
Ensure routes are added when enabling IP Forwarding

I expect it to be
Ensure routes are added when enabling ForwardingRule

right?

@gut
Copy link
Contributor Author

gut commented Jun 15, 2018

oh, I just noticed some confusing terms:
https://github.com/GoogleCloudPlatform/compute-image-packages/blob/master/google_compute_engine/networking/network_daemon.py#L116

this forwardedIPs list is actually the list of ForwardingRules IPs and not the canIpForward network parameter as on: https://cloud.google.com/vpc/docs/using-routes#canipforward

@gut gut force-pushed the network-integration-test branch from 647e8f7 to a6d7358 Compare June 15, 2018 01:33
@daisy-bot daisy-bot added size/XXL and removed size/L labels Jun 15, 2018
@gut
Copy link
Contributor Author

gut commented Jun 15, 2018

This PR was not closed so I just updated this one with the ForwardingRule and TargetInstances being created on daisy. It's much better this way, thanks for the idea!

@gut
Copy link
Contributor Author

gut commented Jun 15, 2018

ops, I completely forgot to extend the go tests. Hang on

@gut gut force-pushed the network-integration-test branch from a6d7358 to 03e321c Compare June 15, 2018 04:06
@gut
Copy link
Contributor Author

gut commented Jun 15, 2018

that's better :-)

@gut
Copy link
Contributor Author

gut commented Jun 15, 2018

@adjackura the PR is once again ready to be reviewed

Copy link
Contributor

@adjackura adjackura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few nits.
Also it looks like our linter isn't working as expected, I'll have to look into that

return nil
}

func (c *client) CreateForwardingRule(project, region string, ti *compute.ForwardingRule) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fr *compute.ForwardingRule

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also docstring

}

func (c *client) operationsWait(project, zone, name string) error {
type OperationGetterFunc func() (*compute.Operation, error)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this type need to be public?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I'll change it to be unexported.

@adjackura
Copy link
Contributor

/lint

Copy link

@daisy-bot daisy-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adjackura: 6 warnings.

Details

In response to this:

/lint

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.

// See the License for the specific language governing permissions and
// limitations under the License.

package daisy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golint comments: should have a package comment, unless it's in another file for this package. More info.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore this

// See the License for the specific language governing permissions and
// limitations under the License.

package daisy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golint comments: should have a package comment, unless it's in another file for this package. More info.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore this

// See the License for the specific language governing permissions and
// limitations under the License.

package daisy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golint comments: should have a package comment, unless it's in another file for this package. More info.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore this

}

func (c *client) operationsWait(project, zone, name string) error {
type OperationGetterFunc func() (*compute.Operation, error)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golint comments: exported type OperationGetterFunc should have comment or be unexported. More info.

// See the License for the specific language governing permissions and
// limitations under the License.

package daisy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golint comments: should have a package comment, unless it's in another file for this package. More info.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore this

// See the License for the specific language governing permissions and
// limitations under the License.

package daisy

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Golint comments: should have a package comment, unless it's in another file for this package. More info.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore this

@gut gut force-pushed the network-integration-test branch from 03e321c to 7371fa9 Compare June 15, 2018 20:24
@daisy-bot
Copy link

daisy-bot commented Jun 15, 2018

@gut: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
prow/presubmit/flake8 7371fa9 link /flake8

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

@gut
Copy link
Contributor Author

gut commented Jun 15, 2018

done. Thanks

@adjackura adjackura merged commit 09972f5 into GoogleCloudPlatform:master Jun 15, 2018
@gut gut deleted the network-integration-test branch June 15, 2018 22:38
gaohannk pushed a commit to gaohannk/compute-image-tools that referenced this pull request May 20, 2021
…heck

Ignore long job name in knative prow config check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants