From f27d8b3b175b6cb803a6b361e4f73aec6ecab6a5 Mon Sep 17 00:00:00 2001 From: Bernardo Guerreiro Date: Thu, 25 Jan 2024 09:52:17 +0000 Subject: [PATCH] test: add ensure and expect --- performance/get-all-movies-then-get-one.yml | 22 +++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/performance/get-all-movies-then-get-one.yml b/performance/get-all-movies-then-get-one.yml index 08ef609..2bd36a7 100644 --- a/performance/get-all-movies-then-get-one.yml +++ b/performance/get-all-movies-then-get-one.yml @@ -1,6 +1,7 @@ config: processor: "./processor.js" plugins: + expect: {} metrics-by-endpoint: useOnlyRequestNames: true publish-metrics: @@ -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: @@ -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 @@ -56,6 +70,10 @@ scenarios: name: GET /movies url: /movies afterResponse: getRandomMovieId + expect: + - statusCode: 200 - get: - name: GET /movies/{id} - url: /movies/{{ movieId }} \ No newline at end of file + name: GET /movies/id + url: /movies/{{ movieId }} + expect: + - statusCode: 200 \ No newline at end of file