Skip to content

Commit

Permalink
test: add ensure and expect
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardobridge committed Jan 25, 2024
1 parent de972eb commit f27d8b3
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions performance/get-all-movies-then-get-one.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
config:
processor: "./processor.js"
plugins:
expect: {}
metrics-by-endpoint:
useOnlyRequestNames: true
publish-metrics:
Expand Down Expand Up @@ -38,6 +39,13 @@ config:
- duration: 10min
arrivalRate: 100
name: Baseline
plugins:
ensure:
maxErrorRate: 0.1
thresholds:
- "plugins.metrics-by-endpoint.response_time.GET /movies.p99": 1000
- "plugins.metrics-by-endpoint.response_time.GET /movies/id.p99": 500

regression-custom:
target: "{{ $env.SERVICE_URL }}"
phases:
Expand All @@ -48,6 +56,12 @@ config:
- duration: 10min
arrivalRate: 100
name: Baseline
plugins:
ensure:
maxErrorRate: 0.1
thresholds:
- "plugins.metrics-by-endpoint.response_time.GET /movies.p99": 1000
- "plugins.metrics-by-endpoint.response_time.GET /movies/id.p99": 500

scenarios:
- name: get-all-movies-then-get-one
Expand All @@ -56,6 +70,10 @@ scenarios:
name: GET /movies
url: /movies
afterResponse: getRandomMovieId
expect:
- statusCode: 200
- get:
name: GET /movies/{id}
url: /movies/{{ movieId }}
name: GET /movies/id
url: /movies/{{ movieId }}
expect:
- statusCode: 200

0 comments on commit f27d8b3

Please sign in to comment.