Commit 38a6f085 authored by Grant Young's avatar Grant Young

Merge branch 'gy-api-projects' into 'master'

Add back in API Projects test

See merge request !116
parents 9d95eb0d 574a3a11
......@@ -306,8 +306,9 @@ You can also run the tool natively on a Linux machine with some caveats:
* The tool has been tested on Debian and Alpine based distros (but it should be able to run on others as well).
* This method will require the machine running the tool to have internet access to install Ruby Gems and k6 (if not already present).
Before running some setup is required for tool's Ruby Gems:
Before running some setup is required for the tool:
1. That [Git LFS]( is installed and any LFS data is confirmed pulled via `git lfs pull`.
1. First, set up [`Ruby`]( and [`Ruby Bundler`]( if they aren't already available on the machine.
1. Next, install the required Ruby Gems via Bundler
* `bundle install`
......@@ -13,9 +13,9 @@
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
"branch_name": "12-1-auto-deploy-20190714"
"branch_current_head_sha": "efc9f72c9ffaa76f966b8c162a9d184d7aa1ff18",
"branch_new_head_sha": "b028afaede664580e04cddf0dd98faeff28ffbef",
"branch_name": "12-1-auto-deploy-0011201"
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
/*global __ENV : true */
@endpoint: `GET /projects`
@description: [Get all projects](
import http from "k6/http";
import { group, fail } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
if (!__ENV.ACCESS_TOKEN) fail('ACCESS_TOKEN has not been set. Skipping...')
export let rpsThresholds = getRpsThresholds(0.2)
export let ttfbThreshold = getTtfbThreshold(5000)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
"successful_requests": [`rate>${__ENV.SUCCESS_RATE_THRESHOLD}`],
"http_req_waiting": [`p(90)<${ttfbThreshold}`],
"http_reqs": [`count>=${rpsThresholds['count']}`]
export function setup() {
console.log(`RPS Threshold: ${rpsThresholds['mean']}/s (${rpsThresholds['count']})`)
console.log(`TTFB P90 Threshold: ${ttfbThreshold}ms`)
console.log(`Success Rate Threshold: ${parseFloat(__ENV.SUCCESS_RATE_THRESHOLD)*100}%`)
export default function() {
group("API - Projects", function() {
let params = { headers: { "Accept": "application/json", "PRIVATE-TOKEN": `${__ENV.ACCESS_TOKEN}` } };
let res = http.get(`${__ENV.ENVIRONMENT_URL}/api/v4/projects`, params);
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment