Skip to content

Conversation

bianpengyuan
Copy link
Contributor

Fix #3418

This test is duplicated from globalcheckandreport with ingress as destination in request count query.

@bianpengyuan bianpengyuan requested a review from a team February 15, 2018 07:06
@istio-testing
Copy link
Collaborator

Hi @bianpengyuan. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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

@bianpengyuan
Copy link
Contributor Author

/assign @douglas-reid

@douglas-reid
Copy link
Contributor

/ok-to-test

}
allowPrometheusSync()

log.Info("Successfully sent request(s) to /productpage; checking metrics...")
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of weaving together t.Log and log.Info statements, should we have consistency here of always using t.Log?

@ldemailly
Copy link
Member

/test e2e-suite-rbac-auth

@ldemailly
Copy link
Member

filled the unrelated failure issue #3600

t.Logf("Baseline established: prior200s = %f", prior200s)
t.Log("Visiting product page...")

// visit production page as well as ingress.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Visit product page through ingress.

@mandarjog
Copy link
Contributor

@bianpengyuan Thanks for the PR.

  1. This just adds report verification, we also need check.
  2. Can you refactor code so that there is common code between globalcheckandreport and IngressCheckAndReport instead of copying?

@bianpengyuan bianpengyuan requested a review from a team February 22, 2018 18:02
@bianpengyuan
Copy link
Contributor Author

@mandarjog Thanks for reviewing and sorry for the delay.

  1. An ingress denial rule check test has been added for ingress. Let me know if this is enough or I need to add more for testing check.
  2. For metric report, I extracted out the same code into a method. I am having a hard time to come up an elegant way to construct these tests. Let me know if you have a better idea. Also I have changed GlobalCheckAndReport to just GlobalReport -- there is no check rules at all in it.

@@ -414,19 +425,25 @@ func TestNewMetrics(t *testing.T) {
}

func TestDenials(t *testing.T) {
testDenials(t, denialRule)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add 2 top level tests func TestIngressDenial and func TestDenial.
This way there is better visibility about what exactly failed.

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.

@@ -275,20 +285,21 @@ func TestGlobalCheckAndReport(t *testing.T) {
t.Logf("Baseline established: prior200s = %f", prior200s)
t.Log("Visiting product page...")

// visit production page.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: product page.
I think you have used production page here and elsewhere.

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.

// establish baseline
t.Log("Establishing metrics baseline for test...")
query := fmt.Sprintf("istio_request_count{%s=\"%s\"}", destLabel, fqdn("productpage"))
checkMetricReport(t, promAPI, "productpage")
Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to check Please add 2 top level tests for TestMetric and TestIngressMetric

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.

@mandarjog
Copy link
Contributor

Hey @bianpengyuan apart from my comments everything else looks good.
Using top level test names gives better visibility, thanks.

Copy link
Contributor

@mandarjog mandarjog 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

@mandarjog
Copy link
Contributor

/lgtm

@istio-merge-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mandarjog

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@mandarjog
Copy link
Contributor

One last thing before merge, please update the PR title and description to reflect what it does now.

@bianpengyuan bianpengyuan changed the title Add a mixer e2e test for ingress metric report. Add e2e tests to verify mixer report and check for ingress Feb 22, 2018
@istio-merge-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@istio-testing
Copy link
Collaborator

istio-testing commented Feb 22, 2018

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

Test name Commit Details Rerun command
prow/e2e-suite-rbac-auth.sh 71ec871 link /test e2e-suite-rbac-auth

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.

@istio-merge-robot
Copy link

Automatic merge from submit-queue.

@istio-merge-robot istio-merge-robot merged commit 4f98ea3 into istio:master Feb 22, 2018
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

Successfully merging this pull request may close these issues.

7 participants