Add success conditions to k6 load tests
Problem statement
Currently, the load tests always pass and do not give us an alert when an endpoint starts to misbehave as we are not comparing the latencies with a base line.
Note
When the notes below were written we were using Artillery. Now that we've switched to k6, I think this link is the jumping off point in the k6 docs.
Solution
We need to add success conditions to the load tests.
How?
We will need to provide the failure threshold in an environment variable that will be used by the ensure config in the artillery script. Also, since the threshold values will vary for each environment we test against (currently testbed and staging), we would need to feed the values to the artillery-api-single-scenario script using env specific (yaml?) files.
We have enough runs against the environments to help determine baseline p95 latency for the success conditions.