-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add e2e test of Grafana dashboard #71
Conversation
Trying to gather some preliminary feedback about the testcase design and test approach, before adding all the testcases for all queries. Thanks |
2efa196
to
9f23d3e
Compare
Given the current testcase code takes a big code block, I thought about whether we want to move the Grafana test to another file. The thing is, the actual test part takes very short time(0.32s) to finish. The test setup time is relatively very long. If we want to separate it into another test to make it looks better, it must sacrifice the overall e2e test running time. What's your opinion on that? --- PASS: TestFlowVisibility (243.58s) |
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.
Looks like queryList
accounts for most of lines, how about sepearting those test data into files and import them during test running?
This will keep Grafana test inside this test file to avoid long setup time and keep code clean.
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 agree to Yongming that repeating the same setting up is not recommended. We can move some grafana related functions and test data initialization to another file and use them in flowvisibility_test.go
. The overall test logic looks good to me, only some nits.
/theia-test-e2e |
/theia-test-e2e |
b927d89
to
0e61601
Compare
LGTM |
This commit adds e2e test of pre-built Grafana dashboards, by: 1. Get dashboard JSON by uid 2. Read dashboard JSON file and get the queries 3. Execute the queries and check whether the expected contents is contained in the result data frame Given we cannot access Grafana through nodePort on Kind cluster, before sending request to Grafana backend HTTP API, we firstly port-forward Grafana Service port to a local port. Signed-off-by: heanlan <hanlan@vmware.com>
Signed-off-by: heanlan <hanlan@vmware.com>
Previously in the networkpolicy_dashboard throughput of deny NPs queries we require AVG(throughput) > 0, it turns out to be almost all the deny connection have throughput = 0. That is because they only send one packet, and the byte counts is too small. In the throughput calculation, the very small byte counts yields a 0 throughput as the integer result. Thus, we change AVG(throughput) to SUM(octetDeltaCount), which effectively help us avoid the issue. Signed-off-by: heanlan <hanlan@vmware.com>
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.
LGTM
/theia-test-e2e |
This commit adds e2e test of pre-built Grafana dashboards, by:
contained in the result data frame
Given we cannot access Grafana through nodePort on Kind cluster,
before sending request to Grafana backend HTTP API, we firstly
port-forward Grafana Service port to a local port.
Fixes: #52
Signed-off-by: heanlan hanlan@vmware.com