Commit 8c453628 authored by Grant Young's avatar Grant Young

Merge branch 'gy-remove-search' into 'master'

Remove unneeded Search test

Closes #198

See merge request !120
parents 7c7fd01b 5a158006
......@@ -61,58 +61,39 @@ As an example, the following is one of our Environment Config Files, [`10k.json`
{
"name": "gitlabhq",
"group": "qa-perf-testing",
"data": {
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"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"
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"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"
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"user": "root"
},
{
"name": "gitlabhq2",
"group": "qa-perf-testing",
"data": {
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"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"
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
"branch": "10-0-stable",
"commit_sha": "0a99e022",
"commit_sha_signed": "6526e91f",
"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"
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"user": "root"
}
]
}
```
* The environment's Name and URL.
......@@ -131,7 +112,6 @@ As an example, the following is one of our Environment Config Files, [`10k.json`
* `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_global` - Search terms of specific types of data used for testing the [Global Search API](https://docs.gitlab.com/ee/api/search.html#global-search-api). This should be adapted to the project you're using with the aim of each search bring back a good number of results tuned to your environment's requirements. Currently the data can be search is `projects`, `issues`, `merge_requests`, `milestones` and `users`. Note that all of these are currently required for this test.
* `user` - The name of a valid user for testing related endpoints.
### Options
......
......@@ -19,13 +19,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
......@@ -43,13 +36,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -19,13 +19,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
......@@ -43,13 +36,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -19,13 +19,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
......@@ -43,13 +36,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -19,13 +19,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
......@@ -43,13 +36,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
......@@ -67,13 +53,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
......@@ -91,13 +70,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -19,13 +19,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
},
{
......@@ -43,13 +36,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -19,13 +19,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -19,13 +19,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
......@@ -19,13 +19,6 @@
},
"mr_commits_iid": "10495",
"mr_discussions_iid": "6958",
"search_global": {
"projects": "gitlab",
"issues": "broken",
"merge_requests": "update",
"milestones": "2.6",
"users": "root"
},
"user": "root"
}
]
......
/*global __ENV : true */
/*
@endpoint: `GET /search?scope=*`
@description: [Global Search](https://docs.gitlab.com/ee/api/search.html#global-search-api)
*/
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(17500)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
"successful_requests": [`rate>${__ENV.SUCCESS_RATE_THRESHOLD}`],
"http_req_waiting{endpoint:projects}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:issues}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:merge_requests}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:milestones}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:users}": [`p(90)<${ttfbThreshold}`],
"http_reqs": [`count>=${rpsThresholds['count']}`],
"http_reqs{endpoint:projects}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:issues}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:merge_requests}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:milestones}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:users}": [`count>=${rpsThresholds['count_per_endpoint']}`],
}
};
export let projects = getProjects(['search_global']);
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)*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_global']['projects']}`, null, Object.assign({}, params, { tags: { endpoint: 'projects' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=issues&search=${project['search_global']['issues']}`, null, Object.assign({}, params, { tags: { endpoint: 'issues' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=merge_requests&search=${project['search_global']['merge_requests']}`, null, Object.assign({}, params, { tags: { endpoint: 'merge_requests' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=milestones&search=${project['search_global']['milestones']}`, null, Object.assign({}, params, { tags: { endpoint: 'milestones' } })],
["GET", `${__ENV.ENVIRONMENT_URL}/api/v4/search?scope=users&search=${project['search_global']['users']}`, null, Object.assign({}, params, { tags: { endpoint: 'users' } })],
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
});
}
/*global __ENV : true */
/*
@endpoint: `GET /:search`
@description: Web - Global Search <br>Controllers: `SearchController#show`,`SearchController#count`</br>
*/
import http from "k6/http";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold, adjustRps, adjustStageVUs, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
export let endpointCount = 10
export let webProtoRps = adjustRps(__ENV.WEB_ENDPOINT_THROUGHPUT)
export let webProtoStages = adjustStageVUs(__ENV.WEB_ENDPOINT_THROUGHPUT)
export let rpsThresholds = getRpsThresholds(__ENV.WEB_ENDPOINT_THROUGHPUT, endpointCount)
export let ttfbThreshold = getTtfbThreshold(1000)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
"successful_requests": [`rate>${__ENV.SUCCESS_RATE_THRESHOLD}`],
"http_req_waiting{endpoint:projects}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:projects_count}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:issues}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:issues_count}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:merge_requests}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:merge_requests_count}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:milestones}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:milestones_count}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:users}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:users_count}": [`p(90)<${ttfbThreshold}`],
"http_reqs": [`count>=${rpsThresholds['count']}`],
"http_reqs{endpoint:projects}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:projects_count}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:issues}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:issues_count}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:merge_requests}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:merge_requests_count}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:milestones}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:milestones_count}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:users}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:users_count}": [`count>=${rpsThresholds['count_per_endpoint']}`],
},
rps: webProtoRps,
stages: webProtoStages
};
export let projects = getProjects(['search_global']);
export function setup() {
console.log('')
console.log(`Web Protocol RPS: ${webProtoRps}`)
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)*100}%`)
}
export default function() {
group("Web - Global Search", function() {
let project = selectProject(projects);
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/search?scope=projects&search=${project['search_global']['projects']}`, null, { tags: { endpoint: 'projects', controller: 'SearchController', action: 'show' } }],
["GET", `${__ENV.ENVIRONMENT_URL}/search/count?scope=projects&search=${project['search_global']['projects']}`, null, { tags: { endpoint: 'projects_count', controller: 'SearchController', action: 'count' } }],
["GET", `${__ENV.ENVIRONMENT_URL}/search?scope=issues&search=${project['search_global']['issues']}`, null, { tags: { endpoint: 'issues', controller: 'SearchController', action: 'show' } }],
["GET", `${__ENV.ENVIRONMENT_URL}/search/count?scope=issues&search=${project['search_global']['issues']}`, null, { tags: { endpoint: 'issues_count', controller: 'SearchController', action: 'count' } }],
["GET", `${__ENV.ENVIRONMENT_URL}/search?scope=merge_requests&search=${project['search_global']['merge_requests']}`, null, { tags: { endpoint: 'merge_requests', controller: 'SearchController', action: 'show' } }],
["GET", `${__ENV.ENVIRONMENT_URL}/search/count?scope=merge_requests&search=${project['search_global']['merge_requests']}`, null, { tags: { endpoint: 'merge_requests_count', controller: 'SearchController', action: 'count' } }],
["GET", `${__ENV.ENVIRONMENT_URL}/search?scope=milestones&search=${project['search_global']['milestones']}`, null, { tags: { endpoint: 'milestones', controller: 'SearchController', action: 'show' } }],
["GET", `${__ENV.ENVIRONMENT_URL}/search/count?scope=milestones&search=${project['search_global']['milestones']}`, null, { tags: { endpoint: 'milestones_count', controller: 'SearchController', action: 'count' } }],
["GET", `${__ENV.ENVIRONMENT_URL}/search?scope=users&search=${project['search_global']['users']}`, null, { tags: { endpoint: 'users', controller: 'SearchController', action: 'show' } }],
["GET", `${__ENV.ENVIRONMENT_URL}/search/count?scope=users&search=${project['search_global']['users']}`, null, { tags: { endpoint: 'users_count', controller: 'SearchController', action: 'count' } }],
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
});
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment