Commit 474cdf32 authored by Grant Young's avatar Grant Young

Add failsafe for env settings check

Also adjust success rate for search api endpoints
parent 549ac245
......@@ -59,7 +59,7 @@ raise "Options config file '#{opts[:options]}' not found as given or in default
env_vars = RunK6.setup_env_vars(env_file: env_file, options_file: options_file)
start_time = Time.now
tests = RunK6.get_tests(k6_dir: k6_dir, test_paths: opts[:tests], test_excludes: opts[:excludes], quarantined: opts[:quarantined], scenarios: opts[:scenarios], unsafe: opts[:unsafe], env_version: env_vars['ENVIRONMENT_VERSION'], env_vars: env_vars)
tests = RunK6.get_tests(k6_dir: k6_dir, test_paths: opts[:tests], test_excludes: opts[:excludes], quarantined: opts[:quarantined], scenarios: opts[:scenarios], unsafe: opts[:unsafe], env_vars: env_vars)
RunK6.prepare_tests(tests: tests, env_vars: env_vars)
results_home = ENV['GPT_DOCKER_RESULTS_DIR'] || "#{k6_dir}/results"
......@@ -82,6 +82,8 @@ tests.each do |test_file|
aggregated_results << RunK6.get_test_results(test_file: test_file, status: status, output: output)
aggregated_success &&= status
sleep ENV['GPT_SLEEP_BETWEEN'].to_i if ENV['GPT_SLEEP_BETWEEN']
rescue Interrupt
warn Rainbow("Caught the interrupt. Stopping.").yellow
exit
......@@ -89,7 +91,7 @@ rescue ArgumentError => e
warn Rainbow(e).yellow
next
rescue NoMethodError
warn Rainbow("Test failed and output couldn't be parsed - \n#{e}").yellow
warn Rainbow("Test failed and output couldn't be parsed: \n#{e}").yellow
next
rescue StandardError => e
warn Rainbow("Test failed: #{e}").red
......
......@@ -55,7 +55,7 @@ As an example, the following is one of our Environment Config Files, [`10k.json`
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"tree_path": "app%2Fassets%2Fimages%2Femoji",
"dir_path": "app%2Fassets%2Fimages%2Femoji",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
......@@ -63,6 +63,14 @@ As an example, the following is one of our Environment Config Files, [`10k.json`
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
},
......@@ -74,7 +82,7 @@ As an example, the following is one of our Environment Config Files, [`10k.json`
"commit_sha_signed": "6526e91f",
"compare_commits_sha": ["aec887ab", "5bfb7558"],
"file_path": "qa%2fqa%2erb",
"tree_path": "app%2Fassets%2Fimages%2Femoji",
"dir_path": "app%2Fassets%2Fimages%2Femoji",
"git_push_data": {
"branch_current_head_sha": "8606c89683c913641243fc667edeb90600fe1a0e",
"branch_new_head_sha": "8bcb4fd6f5780ebe9dc1ec80904b060b89a937d2",
......@@ -82,6 +90,14 @@ As an example, the following is one of our Environment Config Files, [`10k.json`
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
}
......@@ -111,6 +127,13 @@ Details for each of the settings are as follows. Some are also available to be c
* `branch_name` - Existing branch name.
* `mr_commits_iid` - The [iid](https://docs.gitlab.com/ee/api/#id-vs-iid) of a merge request available in the project that has a large number of commits. The size of the MR should be tuned to your environment's requirements.
* `mr_discussions_iid` - The [iid](https://docs.gitlab.com/ee/api/#id-vs-iid) of a merge request available in the project that has a large number of discussions / comments. The size of the MR discussions should be tuned to your environment's requirements.
* `search` - A list of search terms to used against [GitLab Advanced Search](https://docs.gitlab.com/ee/user/search/advanced_global_search.html) (this needs to be configured on the environment specifically). Each item is what term to search with for the specified scope against both the API and Web UI. Currently the ones shown above are supported at this time.
* `projects` - [Projects Scope](https://docs.gitlab.com/ee/api/search.html#scope-projects) search term.
* `issues` - [Issues Scope](https://docs.gitlab.com/ee/api/search.html#scope-issues) search term.
* `commits` - [Commits Scope](https://docs.gitlab.com/ee/api/search.html#scope-commits-starter) search term.
* `merge_requests` - [Merge Requests Scope](https://docs.gitlab.com/ee/api/search.html#scope-merge_requests) search term.
* `milestones` - [Milestones Scope](https://docs.gitlab.com/ee/api/search.html#scope-milestones) search term.
* `users` - [Users Scope](https://docs.gitlab.com/ee/api/search.html#scope-users) search term.
* `issue_iid` - The [iid](https://docs.gitlab.com/ee/api/#id-vs-iid) of an issue available in the project that has a large number of discussions / comments. The size of the issue discussions should be tuned to your environment's requirements.
* `user` - The name of a valid user for testing related endpoints.
......
......@@ -24,6 +24,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
},
......@@ -43,6 +52,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
}
......
......@@ -24,6 +24,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
},
......@@ -43,6 +52,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
},
......@@ -62,6 +80,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
}
......
......@@ -24,6 +24,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
},
......@@ -43,6 +52,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
}
......
......@@ -24,6 +24,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
},
......@@ -43,6 +52,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
},
......@@ -62,6 +80,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
},
......@@ -80,6 +107,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
}
......
......@@ -24,6 +24,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
},
......@@ -43,6 +52,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
}
......
......@@ -24,6 +24,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
}
......
......@@ -24,6 +24,15 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search": {
"projects": "gitlab",
"issues": "broken",
"commits": "fix",
"merge_requests": "fix",
"milestones": "2.6",
"blobs": "test",
"users": "root"
},
"issue_iid": "4218",
"user": "root"
}
......
......@@ -11,7 +11,7 @@ export function logError(res) {
} catch (e) {
error = res.body
}
if (logError.last != error) {
logError.last = error;
console.warn(`Error detected: '${logError.last}'`);
......
......@@ -6,13 +6,13 @@ When this is the case some will redirect if that dash is missing, which inflates
as they count redirects twice.
This function can be used to check if an endpoint path does redirect and pass that back into
the test and maintain the numbers. */
export function checkProjEndpointPath(projectPath, endpointPath) {
let res = http.get(`${projectPath}/${endpointPath}`);
if (!/20(0|1)/.test(res.status)) fail(`Failed to check if Project Endpoint path '${projectPath}/${endpointPath}' is correct - ${res.body}`);
export function checkProjEndpointPath(projectUrl, endpointPath) {
let res = http.get(`${projectUrl}/${endpointPath}`);
if (!/20(0|1)/.test(res.status)) fail(`Failed to check if Project Endpoint path '${projectUrl}/${endpointPath}' is correct - ${res.body}`);
console.log(`Endpoint full URL is ${res.url}`)
let pathRegex = new RegExp(`${projectPath}/(.*)`);
let pathRegex = new RegExp(`${projectUrl}/(.*)`);
let actualPath = res.url.match(pathRegex)[1];
return actualPath
}
\ No newline at end of file
}
{
"stages": [
{ "duration": "5s", "target": 60 },
{ "duration": "50s", "target": 60 },
{ "duration": "5s", "target": 0 }
],
"rps": 60,
"batchPerHost": 0
}
{
"stages": [
{ "duration": "5s", "target": 80 },
{ "duration": "50s", "target": 80 },
{ "duration": "5s", "target": 0 }
],
"rps": 80,
"batchPerHost": 0
}
......@@ -2,6 +2,7 @@
/*
@endpoint: `GET /projects/:id/issues/:issue_iid`
@description: [Get a single project issue](https://docs.gitlab.com/ee/api/issues.html#single-issue)
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/213708
*/
import http from "k6/http";
......
......@@ -12,7 +12,7 @@ import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
export let rpsThresholds = getRpsThresholds(0.2)
export let ttfbThreshold = getTtfbThreshold(5000)
export let ttfbThreshold = getTtfbThreshold(7500)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -11,7 +11,7 @@ import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
export let rpsThresholds = getRpsThresholds(0.2)
export let ttfbThreshold = getTtfbThreshold(6000)
export let ttfbThreshold = getTtfbThreshold(7500)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
/*global __ENV : true */
/*
@endpoint: `GET /search?scope=*`
@description: [Global Search API](https://docs.gitlab.com/ee/api/search.html#global-search-api)
@gitlab_settings: { "elasticsearch_indexing": true, "elasticsearch_search": true }
@flags: search
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/214482, https://gitlab.com/gitlab-org/gitlab/-/issues/214830
*/
import http from "k6/http";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
export let endpointCount = 6
export let rpsThresholds = getRpsThresholds(0.3, endpointCount)
export let ttfbThreshold = getTtfbThreshold(25000)
export let successRate = new Rate("successful_requests")
let scopes = ['projects', 'issues', 'commits', 'merge_requests', 'milestones', 'users']
let scopes_thresholds = {
"successful_requests": [`rate>${__ENV.SUCCESS_RATE_THRESHOLD * 0.1}`],
"http_reqs": [`count>=${rpsThresholds['count']}`],
}
scopes.forEach(scope => {
scopes_thresholds[`http_req_waiting{endpoint:${scope}}`] = [`p(90)<${ttfbThreshold}`],
scopes_thresholds[`http_reqs{endpoint:${scope}}`] = [`count>=${rpsThresholds['count_per_endpoint']}`]
})
export let options = {
thresholds: scopes_thresholds
};
export let projects = getProjects(['search']);
export function setup() {
console.log('')
console.log(`RPS Threshold: ${rpsThresholds['mean']}/s (${rpsThresholds['count']})`)
console.log(`RPS Threshold per Endpoint: ${rpsThresholds['mean_per_endpoint']}/s (${rpsThresholds['count_per_endpoint']})`)
console.log(`TTFB P90 Threshold: ${ttfbThreshold}ms`)
console.log(`Success Rate Threshold: ${parseFloat(__ENV.SUCCESS_RATE_THRESHOLD * 0.1)*100}%`)
}
export default function() {
group("API - Global Search", function() {
let project = selectProject(projects);
let params = { headers: { "Accept": "application/json", "PRIVATE-TOKEN": `${__ENV.ACCESS_TOKEN}` } };
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=projects&search=${project['search']['projects']}`, null, Object.assign({}, params, { tags: { endpoint: 'projects' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=issues&search=${project['search']['issues']}`, null, Object.assign({}, params, { tags: { endpoint: 'issues' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=commits&search=${project['search']['commits']}`, null, Object.assign({}, params, { tags: { endpoint: 'commits' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=merge_requests&search=${project['search']['merge_requests']}`, null, Object.assign({}, params, { tags: { endpoint: 'merge_requests' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=milestones&search=${project['search']['milestones']}`, null, Object.assign({}, params, { tags: { endpoint: 'milestones' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=users&search=${project['search']['users']}`, null, Object.assign({}, params, { tags: { endpoint: 'users' } })],
// Blobs are disabled due to bad performance causing errors and knock on effects
//["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=blobs&search=${project['search']['blobs']}`, null, Object.assign({}, params, { tags: { endpoint: 'blobs' } })],
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
});
}
\ No newline at end of file
/*global __ENV : true */
/*
@endpoint: `GET /groups/:id/search?scope=*`
@description: [Group Search API](https://docs.gitlab.com/ee/api/search.html#group-search-api)
@gitlab_settings: { "elasticsearch_indexing": true, "elasticsearch_search": true }
@flags: search
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/214482, https://gitlab.com/gitlab-org/gitlab/-/issues/214830
*/
import http from "k6/http";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
export let endpointCount = 6
export let rpsThresholds = getRpsThresholds(0.3, endpointCount)
export let ttfbThreshold = getTtfbThreshold(25000)
export let successRate = new Rate("successful_requests")
let scopes = ['projects', 'issues', 'commits', 'merge_requests', 'milestones', 'users']
let scopes_thresholds = {
"successful_requests": [`rate>${__ENV.SUCCESS_RATE_THRESHOLD * 0.1}`],
"http_reqs": [`count>=${rpsThresholds['count']}`],
}
scopes.forEach(scope => {
scopes_thresholds[`http_req_waiting{endpoint:${scope}}`] = [`p(90)<${ttfbThreshold}`],
scopes_thresholds[`http_reqs{endpoint:${scope}}`] = [`count>=${rpsThresholds['count_per_endpoint']}`]
})
export let options = {
thresholds: scopes_thresholds
};
export let projects = getProjects(['search']);
export function setup() {
console.log('')
console.log(`RPS Threshold: ${rpsThresholds['mean']}/s (${rpsThresholds['count']})`)
console.log(`RPS Threshold per Endpoint: ${rpsThresholds['mean_per_endpoint']}/s (${rpsThresholds['count_per_endpoint']})`)
console.log(`TTFB P90 Threshold: ${ttfbThreshold}ms`)
console.log(`Success Rate Threshold: ${parseFloat(__ENV.SUCCESS_RATE_THRESHOLD * 0.1)*100}%`)
}
export default function() {
group("API - Group Search", function() {
let project = selectProject(projects);
let params = { headers: { "Accept": "application/json", "PRIVATE-TOKEN": `${__ENV.ACCESS_TOKEN}` } };
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/groups/${project['group']}/search?scope=projects&search=${project['search']['projects']}`, null, Object.assign({}, params, { tags: { endpoint: 'projects' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/groups/${project['group']}/search?scope=issues&search=${project['search']['issues']}`, null, Object.assign({}, params, { tags: { endpoint: 'issues' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/groups/${project['group']}/search?scope=commits&search=${project['search']['commits']}`, null, Object.assign({}, params, { tags: { endpoint: 'commits' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/groups/${project['group']}/search?scope=merge_requests&search=${project['search']['merge_requests']}`, null, Object.assign({}, params, { tags: { endpoint: 'merge_requests' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/groups/${project['group']}/search?scope=milestones&search=${project['search']['milestones']}`, null, Object.assign({}, params, { tags: { endpoint: 'milestones' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/groups/${project['group']}/search?scope=users&search=${project['search']['users']}`, null, Object.assign({}, params, { tags: { endpoint: 'users' } })],
// Blobs are disabled due to bad performance causing errors and knock on effects
// ["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/groups/${project['group']}/search?scope=blobs&search=${project['search']['blobs']}`, null, Object.assign({}, params, { tags: { endpoint: 'blobs' } })],
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
});
}
\ No newline at end of file
/*global __ENV : true */
/*
@endpoint: `GET /projects/:id/search?scope=*`
@description: [Project Search API](https://docs.gitlab.com/ee/api/search.html#project-search-api)
@gitlab_settings: { "elasticsearch_indexing": true, "elasticsearch_search": true }
@flags: search
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/214482, https://gitlab.com/gitlab-org/gitlab/-/issues/214830
*/
import http from "k6/http";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
export let endpointCount = 5
export let rpsThresholds = getRpsThresholds(0.3, endpointCount)
export let ttfbThreshold = getTtfbThreshold(25000)
export let successRate = new Rate("successful_requests")
let scopes = ['issues', 'commits', 'merge_requests', 'milestones', 'users']
let scopes_thresholds = {
"successful_requests": [`rate>${__ENV.SUCCESS_RATE_THRESHOLD * 0.1}`],
"http_reqs": [`count>=${rpsThresholds['count']}`],
}
scopes.forEach(scope => {
scopes_thresholds[`http_req_waiting{endpoint:${scope}}`] = [`p(90)<${ttfbThreshold}`],
scopes_thresholds[`http_reqs{endpoint:${scope}}`] = [`count>=${rpsThresholds['count_per_endpoint']}`]
})
export let options = {
thresholds: scopes_thresholds
};
export let projects = getProjects(['search']);
export function setup() {
console.log('')
console.log(`RPS Threshold: ${rpsThresholds['mean']}/s (${rpsThresholds['count']})`)
console.log(`RPS Threshold per Endpoint: ${rpsThresholds['mean_per_endpoint']}/s (${rpsThresholds['count_per_endpoint']})`)
console.log(`TTFB P90 Threshold: ${ttfbThreshold}ms`)
console.log(`Success Rate Threshold: ${parseFloat(__ENV.SUCCESS_RATE_THRESHOLD * 0.1)*100}%`)
}
export default function() {
group("API - Project Search", function() {
let project = selectProject(projects);
let params = { headers: { "Accept": "application/json", "PRIVATE-TOKEN": `${__ENV.ACCESS_TOKEN}` } };
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/projects/${project['group']}%2F${project['name']}/search?scope=issues&search=${project['search']['issues']}`, null, Object.assign({}, params, { tags: { endpoint: 'issues' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/projects/${project['group']}%2F${project['name']}/search?scope=commits&search=${project['search']['commits']}`, null, Object.assign({}, params, { tags: { endpoint: 'commits' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/projects/${project['group']}%2F${project['name']}/search?scope=merge_requests&search=${project['search']['merge_requests']}`, null, Object.assign({}, params, { tags: { endpoint: 'merge_requests' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/projects/${project['group']}%2F${project['name']}/search?scope=milestones&search=${project['search']['milestones']}`, null, Object.assign({}, params, { tags: { endpoint: 'milestones' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/projects/${project['group']}%2F${project['name']}/search?scope=users&search=${project['search']['users']}`, null, Object.assign({}, params, { tags: { endpoint: 'users' } })],
// Blobs are disabled due to bad performance causing errors and knock on effects
//["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/projects/${project['group']}%2F${project['name']}/search?scope=blobs&search=${project['search']['blobs']}`, null, Object.assign({}, params, { tags: { endpoint: 'blobs' } })],
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
});
}
\ No newline at end of file
......@@ -2,7 +2,8 @@
/*
@endpoint: `GET /projects/:id/search?scope=blobs&search=:query`
@description: [Search throught the code within the specified project](https://docs.gitlab.com/ee/api/search.html#scope-blobs)
@flags: repo_storage
@flags: search
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/214830
*/
import http from "k6/http";
......@@ -10,8 +11,8 @@ import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
export let rpsThresholds = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getRpsThresholds(0.5) : getRpsThresholds()
export let ttfbThreshold = __ENV.ENVIRONMENT_REPO_STORAGE == "nfs" ? getTtfbThreshold(3000) : getTtfbThreshold()
export let rpsThresholds = getRpsThresholds(0.1)
export let ttfbThreshold = getTtfbThreshold(15000)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
/*global __ENV : true */
/*
@endpoint: `GET /:search`
@description: Web - Global Search <br>Controllers: `SearchController#show`,`SearchController#count`</br>
@gitlab_settings: { "elasticsearch_indexing": true, "elasticsearch_search": true }
@flags: search
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/214830
*/
import http from "k6/http";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, adjustRps, adjustStageVUs