Commit 4c0cc875 authored by Grant Young's avatar Grant Young

Update Web Projects tests to not call README

File can be different on projects or not even there
parent 0dd99ef0
......@@ -44,13 +44,13 @@ def generate_comparision_table(results)
last_test_result = results[result_num - 1]['test_results'].find { |res| res['name'] == test_result["name"] } unless result_num.zero?
if last_test_result
last_test_difference = test_result['ttfb_p95'].to_f - last_test_result['ttfb_p95'].to_f
last_test_diff_perc = (last_test_difference * 100 / last_test_result['ttfb_p95'].to_f).round(2)
last_test_difference = test_result['ttfb_p90'].to_f - last_test_result['ttfb_p90'].to_f
last_test_diff_perc = (last_test_difference * 100 / last_test_result['ttfb_p90'].to_f).round(2)
last_test_difference_str = last_test_difference.positive? ? "_+#{last_test_diff_perc}%_" : "**#{last_test_diff_perc}%**"
results_comparision_data[test_result["name"]][result["version"].tr('.', '-')] = "#{test_result['ttfb_p95']}ms (#{last_test_difference_str})"
results_comparision_data[test_result["name"]][result["version"].tr('.', '-')] = "#{test_result['ttfb_p90']}ms (#{last_test_difference_str})"
else
results_comparision_data[test_result["name"]][result["version"].tr('.', '-')] = "#{test_result['ttfb_p95']}ms (-)"
results_comparision_data[test_result["name"]][result["version"].tr('.', '-')] = "#{test_result['ttfb_p90']}ms (-)"
end
end
end
......
......@@ -114,7 +114,7 @@ unless tests_with_issues.empty? || ENV['GPT_SKIP_KNOWN_ISSUES'] == 'true'
puts "\n█ Known issues\n\nNote that the following endpoints below have known issues. These tests have either been run with a custom lower threshold limit applied or are quarantined until the issue is fixed:\n\n"
tp.set(:max_width, 100)
tp(tests_with_issues, :name, :issues)
puts "\nFull list of issues found both past and present can be found here: https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=Quality%3Aperformance-issues\n"
puts "\nFull list of issues found both past and present can be found here: https://gitlab.com/gitlab-org/gitlab/-/issues?label_name%5B%5D=Quality%3Aperformance-issues\n"
end
# Output and save test results
......
......@@ -2,7 +2,7 @@
/*
@endpoint: `GET /groups/:id`
@description: [Get all details of a group](https://docs.gitlab.com/ee/api/groups.html#details-of-a-group)
@issue: TBC
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/211504
*/
import http from "k6/http";
......
......@@ -2,6 +2,7 @@
/*
@endpoint: `GET /groups/:id/projects`
@description: [Get a list of projects in this group](https://docs.gitlab.com/ee/api/groups.html#list-a-groups-projects)
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/211498
*/
import http from "k6/http";
......
......@@ -2,7 +2,7 @@
/*
@endpoint: `GET /projects?pagination=keyset&order_by=id&sort=asc`
@description: [Get a list of all visible projects across GitLab for the authenticated user using keyset-pagination](https://docs.gitlab.com/ee/api/projects.html#list-all-projects)
@issue: https://gitlab.com/gitlab-org/gitlab/issues/30181
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/30181, https://gitlab.com/gitlab-org/gitlab/-/issues/211495
@gitlab_version: 12.7.0
*/
......
......@@ -2,7 +2,7 @@
/*
@endpoint: `GET /projects?order_by=id&sort=asc`
@description: [Get a list of all visible projects across GitLab for the authenticated user](https://docs.gitlab.com/ee/api/projects.html#list-all-projects)
@issue: https://gitlab.com/gitlab-org/gitlab/issues/30181
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/30181, https://gitlab.com/gitlab-org/gitlab/-/issues/211495
*/
import http from "k6/http";
......
......@@ -14,8 +14,8 @@ import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProj
checkAccessToken();
// Endpoint is below target threshold. Custom lower limit applied until fixed.
export let rpsThresholds = getRpsThresholds(0.05)
export let ttfbThreshold = getTtfbThreshold(20000)
export let rpsThresholds = getRpsThresholds(0.2)
export let ttfbThreshold = getTtfbThreshold(7500)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
......
......@@ -2,7 +2,7 @@
/*
@endpoint: `POST /projects/:id/repository/branches`
@description: [Create a new branch in the repository](https://docs.gitlab.com/ee/api/branches.html#create-repository-branch)
@issue: https://gitlab.com/gitlab-org/gitlab/issues/196788
@issue: https://gitlab.com/gitlab-org/gitlab/-/issues/196788
@flags: unsafe
*/
......
......@@ -9,20 +9,15 @@ 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 = 2
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 rpsThresholds = getRpsThresholds(__ENV.WEB_ENDPOINT_THROUGHPUT)
export let ttfbThreshold = getTtfbThreshold(750)
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
"successful_requests": [`rate>${__ENV.SUCCESS_RATE_THRESHOLD}`],
"http_req_waiting{endpoint:project}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:README.md}": [`p(90)<${ttfbThreshold}`],
"http_reqs": [`count>=${rpsThresholds['count']}`],
"http_reqs{endpoint:project}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:README.md}": [`count>=${rpsThresholds['count_per_endpoint']}`]
"http_reqs": [`count>=${rpsThresholds['count']}`]
},
rps: webProtoRps,
stages: webProtoStages
......@@ -34,7 +29,6 @@ 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}%`)
}
......@@ -43,12 +37,7 @@ export default function() {
group("Web - Project Page", function() {
let project = selectProject(projects);
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}`, null, {tags: {endpoint: 'project', controller: 'ProjectsController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/blob/master/README.md?format=json&viewer=rich`, null, {tags: {endpoint: 'README.md', controller: 'Projects::BlobController', action: 'show'}}]
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
let res = http.get(`${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}`);
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
}
......@@ -9,20 +9,15 @@ 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 = 2
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 rpsThresholds = getRpsThresholds(__ENV.WEB_ENDPOINT_THROUGHPUT)
export let ttfbThreshold = getTtfbThreshold()
export let successRate = new Rate("successful_requests")
export let options = {
thresholds: {
"successful_requests": [`rate>${__ENV.SUCCESS_RATE_THRESHOLD}`],
"http_req_waiting{endpoint:tree}": [`p(90)<${ttfbThreshold}`],
"http_req_waiting{endpoint:README.md}": [`p(90)<${ttfbThreshold}`],
"http_reqs": [`count>=${rpsThresholds['count']}`],
"http_reqs{endpoint:tree}": [`count>=${rpsThresholds['count_per_endpoint']}`],
"http_reqs{endpoint:README.md}": [`count>=${rpsThresholds['count_per_endpoint']}`]
"http_reqs": [`count>=${rpsThresholds['count']}`]
},
rps: webProtoRps,
stages: webProtoStages
......@@ -34,7 +29,6 @@ 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}%`)
}
......@@ -43,12 +37,7 @@ export default function() {
group("Web - Project Files Tree", function() {
let project = selectProject(projects);
let responses = http.batch([
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/tree/master`, null, {tags: {endpoint: 'tree', controller: 'Projects::TreeController', action: 'show'}}],
["GET", `${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/blob/master/README.md?format=json&viewer=rich`, null, {tags: {endpoint: 'README.md', controller: 'Projects::BlobController', action: 'show.json'}}]
]);
responses.forEach(function(res) {
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
let res = http.get(`${__ENV.ENVIRONMENT_URL}/${project['group']}/${project['name']}/tree/master`);
/20(0|1)/.test(res.status) ? successRate.add(true) : (successRate.add(false), logError(res));
});
}
}
\ No newline at end of file
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