-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests (find): extend metrics find e2e tests
- Loading branch information
Showing
3 changed files
with
168 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
version: "v1" | ||
test: | ||
apps: | ||
- name: "carbonapi" | ||
binary: "./carbonapi" | ||
args: | ||
- "-config" | ||
- "./cmd/mockbackend/testcases/render_error/carbonapi.yaml" | ||
queries: | ||
- endpoint: "http://127.0.0.1:8081" | ||
type: "GET" | ||
URL: "/metrics/find?query=a&format=json" | ||
expectedResponse: | ||
httpCode: 200 | ||
contentType: "application/json" | ||
expectedResults: | ||
- metricsFind: | ||
- allowChildren: 0 | ||
expandable: 0 | ||
leaf: 1 | ||
id: "a" | ||
text: "a" | ||
context: {} | ||
|
||
# empty | ||
- endpoint: "http://127.0.0.1:8081" | ||
type: "GET" | ||
URL: "/render/?target=b&format=json" | ||
expectedResponse: | ||
httpCode: 200 | ||
contentType: "application/json" | ||
|
||
- endpoint: "http://127.0.0.1:8081" | ||
type: "GET" | ||
URL: "/metrics/find?query=a&query=b&format=json" | ||
expectedResponse: | ||
httpCode: 200 | ||
contentType: "application/json" | ||
expectedResults: | ||
- metricsFind: | ||
- allowChildren: 0 | ||
expandable: 0 | ||
leaf: 1 | ||
id: "a" | ||
text: "a" | ||
context: {} | ||
|
||
# timeout | ||
- endpoint: "http://127.0.0.1:8081" | ||
type: "GET" | ||
URL: "/metrics/find?query=c&format=json" | ||
expectedResponse: | ||
httpCode: 503 | ||
contentType: "text/plain; charset=utf-8" | ||
|
||
# 503 | ||
- endpoint: "http://127.0.0.1:8081" | ||
type: "GET" | ||
URL: "/metrics/find?query=d&format=json" | ||
expectedResponse: | ||
httpCode: 503 | ||
contentType: "text/plain; charset=utf-8" | ||
|
||
# 503, partial success | ||
- endpoint: "http://127.0.0.1:8081" | ||
type: "GET" | ||
URL: "/metrics/find?query=a&query=d&format=json" | ||
expectedResponse: | ||
httpCode: 503 | ||
contentType: "text/plain; charset=utf-8" | ||
|
||
listeners: | ||
- address: ":9070" | ||
expressions: | ||
"a": | ||
pathExpression: "a" | ||
data: | ||
- metricName: "a" | ||
values: [0,1,2,2,3] | ||
|
||
# timeout | ||
"c": | ||
pathExpression: "b" | ||
emptyBody: true | ||
httpCode: 404 | ||
replyDelayMS: 7000 | ||
data: | ||
- metricName: "c" | ||
values: [0,1,2,2,3] | ||
|
||
"d": | ||
pathExpression: "d" | ||
emptyBody: true | ||
httpCode: 503 |