Commit 7f7d202b authored by Grant Young's avatar Grant Young

Ensure script and tests run without ACCESS_TOKEN

parent 6f4ead53
......@@ -17,7 +17,7 @@ require 'tmpdir'
k6_dir = Pathname.new(File.expand_path('../k6', __dir__)).relative_path_from(Dir.pwd)
gpt_version = '1.3.0'
gpt_version = '1.3.1'
puts Rainbow("GitLab Performance Tool (GPT) v#{gpt_version} - Performance test runner for GitLab environments based on k6").color(230, 83, 40)
opts = Optimist.options do
......
......@@ -268,7 +268,7 @@ The recommended way to run the Tool is with our Docker image, [gitlab/gitlab-per
The image will start running the tests when it's called. The full options for running the tool can be seen by getting the help output by running `docker run -it gitlab/gitlab-performance-tool --help`:
```
GitLab Performance Tool (GPT) v1.3.0 - Performance test runner for GitLab environments based on k6
GitLab Performance Tool (GPT) v1.3.1 - Performance test runner for GitLab environments based on k6
Documentation: https://gitlab.com/gitlab-org/quality/performance/blob/master/docs/README.md
......@@ -361,7 +361,7 @@ Once all tests have completed you will be presented with a results summary. As a
* Option: 60s_200rps
* Date: 2020-02-06
* Run Time: 43m 20.28s (Start: 14:16:29 UTC, End: 14:59:49 UTC)
* GPT Version: v1.3.0
* GPT Version: v1.3.1
█ Overall Results Score: 97.28%
......
......@@ -8,7 +8,9 @@
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";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold(1500)
......
......@@ -8,7 +8,9 @@
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";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold(2000)
......
......@@ -8,7 +8,9 @@
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";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
// Endpoint is below target threshold. Custom limits applied until fixed.
export let rpsThresholds = getRpsThresholds(0.6)
......
......@@ -7,7 +7,9 @@
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";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......
......@@ -7,7 +7,9 @@
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";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......
......@@ -7,7 +7,9 @@
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";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
export let rpsThresholds = getRpsThresholds()
export let ttfbThreshold = getTtfbThreshold()
......
......@@ -9,7 +9,9 @@
import http from "k6/http";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
export let rpsThresholds = getRpsThresholds(0.2)
export let ttfbThreshold = getTtfbThreshold(7500)
......
......@@ -8,7 +8,9 @@
import http from "k6/http";
import { group } from "k6";
import { Rate } from "k6/metrics";
import { logError, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
export let rpsThresholds = getRpsThresholds(0.2)
export let ttfbThreshold = getTtfbThreshold(7500)
......
......@@ -10,7 +10,9 @@
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";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
export let endpointCount = 6
export let rpsThresholds = getRpsThresholds(0.3, endpointCount)
......
......@@ -10,7 +10,9 @@
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";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
export let endpointCount = 6
export let rpsThresholds = getRpsThresholds(0.3, endpointCount)
......
......@@ -10,7 +10,9 @@
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";
import { logError, checkAccessToken, getRpsThresholds, getTtfbThreshold, getProjects, selectProject } from "../../lib/gpt_k6_modules.js";
checkAccessToken();
export let endpointCount = 5
export let rpsThresholds = getRpsThresholds(0.3, endpointCount)
......
......@@ -51,7 +51,7 @@ module RunK6
end
def get_env_settings(env_url:)
return false unless ENV['ACCESS_TOKEN']
return nil unless ENV['ACCESS_TOKEN']
headers = { 'PRIVATE-TOKEN': ENV['ACCESS_TOKEN'] }
res = GPTCommon.make_http_request(method: 'get', url: "#{env_url}/api/v4/application/settings", headers: headers, fail_on_error: false)
......
......@@ -80,7 +80,8 @@ module TestInfo
def test_supported_by_gitlab_settings?(test_file, gitlab_settings)
test_required_settings = get_test_tag_value(test_file, 'gitlab_settings')
return true if test_required_settings.nil? || gitlab_settings.empty?
return true if test_required_settings.nil?
return false if gitlab_settings.nil?
JSON.parse(test_required_settings).each do |setting, value|
if gitlab_settings[setting] != value
......
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