summaryrefslogtreecommitdiff
path: root/qa/Rakefile
diff options
context:
space:
mode:
authorSanad Liaquat <sliaquat@gitlab.com>2019-03-19 05:09:30 +0000
committerRamya Authappan <rauthappan@gitlab.com>2019-03-19 05:09:30 +0000
commitf9832a08c513853ab10dd86adc9c7dd596e30da0 (patch)
tree1651cbd87f77b947f3042a0d71fc80c7b0c1f69b /qa/Rakefile
parent3c5a81cb83e6022530e53b1b6cdedf94c92d980e (diff)
downloadgitlab-ce-f9832a08c513853ab10dd86adc9c7dd596e30da0.tar.gz
Add load testing script for artillery.io
Also add rake tasks that makes use of existing performance data genertion task.
Diffstat (limited to 'qa/Rakefile')
-rw-r--r--qa/Rakefile22
1 files changed, 22 insertions, 0 deletions
diff --git a/qa/Rakefile b/qa/Rakefile
index b6ad09f9b00..d0101740f1a 100644
--- a/qa/Rakefile
+++ b/qa/Rakefile
@@ -16,3 +16,25 @@ desc "Generate Performance Testdata"
task :generate_perf_testdata do
QA::Tools::GeneratePerfTestdata.new.run
end
+
+desc "Run artillery load tests"
+task :run_artillery_load_tests do
+ unless ENV['HOST_URL'] && ENV['LARGE_ISSUE_URL'] && ENV['LARGE_MR_URL']
+ urls_file = ENV['URLS_FILE_PATH'] || 'urls.yml'
+
+ unless File.exist?(urls_file)
+ raise "\n#{urls_file} file is missing. Please provide correct URLS_FILE_PATH or all of HOST_URL, LARGE_ISSUE_URL and LARGE_MR_URL\n\n"
+ end
+
+ urls = YAML.safe_load(File.read(urls_file))
+ ENV['HOST_URL'] = urls[:host]
+ ENV['LARGE_ISSUE_URL'] = urls[:large_issue]
+ ENV['LARGE_MR_URL'] = urls[:large_mr]
+ end
+
+ sh('artillery run load/artillery.yml -o report.json')
+ sh('artillery report report.json -o report.html && rm report.json')
+end
+
+desc "Generate data and run load tests"
+task generate_data_and_run_load_test: [:generate_perf_testdata, :run_artillery_load_tests]