Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f57e36d6
Commit
f57e36d6
authored
Mar 19, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
5b835145
909161dd
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
52 additions
and
6 deletions
+52
-6
qa/.gitignore
qa/.gitignore
+1
-1
qa/Rakefile
qa/Rakefile
+22
-0
qa/load/artillery.yml
qa/load/artillery.yml
+22
-0
qa/qa/tools/generate_perf_testdata.rb
qa/qa/tools/generate_perf_testdata.rb
+7
-5
No files found.
qa/.gitignore
View file @
f57e36d6
tmp/
tmp/
.ruby-version
.ruby-version
urls.
txt
urls.
yml
qa/Rakefile
View file @
f57e36d6
...
@@ -16,3 +16,25 @@ desc "Generate Performance Testdata"
...
@@ -16,3 +16,25 @@ desc "Generate Performance Testdata"
task
:generate_perf_testdata
do
task
:generate_perf_testdata
do
QA
::
Tools
::
GeneratePerfTestdata
.
new
.
run
QA
::
Tools
::
GeneratePerfTestdata
.
new
.
run
end
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
]
qa/load/artillery.yml
0 → 100644
View file @
f57e36d6
config
:
target
:
"
{{
$processEnvironment.HOST_URL
}}"
phases
:
-
duration
:
60
arrivalRate
:
1
name
:
"
Warm
up"
-
duration
:
120
arrivalRate
:
1
rampTo
:
50
name
:
"
Gradual
ramp
up"
-
duration
:
60
arrivalRate
:
50
name
:
"
Sustained
max
load"
scenarios
:
-
name
:
"
Visit
large
issue
url"
flow
:
-
get
:
url
:
"
{{
$processEnvironment.LARGE_ISSUE_URL
}}"
-
name
:
"
Visit
large
MR
url"
flow
:
-
get
:
url
:
"
{{
$processEnvironment.LARGE_MR_URL
}}"
qa/qa/tools/generate_perf_testdata.rb
View file @
f57e36d6
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
require
'securerandom'
require
'securerandom'
require
'faker'
require
'faker'
require
'yaml'
require_relative
'../../qa'
require_relative
'../../qa'
# This script generates testdata for Performance Testing.
# This script generates testdata for Performance Testing.
# Required environment variables: PERSONAL_ACCESS_TOKEN and GITLAB_ADDRESS
# Required environment variables: PERSONAL_ACCESS_TOKEN and GITLAB_ADDRESS
...
@@ -20,7 +21,8 @@ module QA
...
@@ -20,7 +21,8 @@ module QA
@api_client
=
Runtime
::
API
::
Client
.
new
(
ENV
[
'GITLAB_ADDRESS'
],
personal_access_token:
ENV
[
'PERSONAL_ACCESS_TOKEN'
])
@api_client
=
Runtime
::
API
::
Client
.
new
(
ENV
[
'GITLAB_ADDRESS'
],
personal_access_token:
ENV
[
'PERSONAL_ACCESS_TOKEN'
])
@group_name
=
"gitlab-qa-perf-sandbox-
#{
SecureRandom
.
hex
(
8
)
}
"
@group_name
=
"gitlab-qa-perf-sandbox-
#{
SecureRandom
.
hex
(
8
)
}
"
@project_name
=
"my-test-project-
#{
SecureRandom
.
hex
(
8
)
}
"
@project_name
=
"my-test-project-
#{
SecureRandom
.
hex
(
8
)
}
"
@urls
=
{}
@visibility
=
"public"
@urls
=
{
host:
ENV
[
'GITLAB_ADDRESS'
]
}
end
end
def
run
def
run
...
@@ -39,26 +41,26 @@ module QA
...
@@ -39,26 +41,26 @@ module QA
threads_arr
=
[]
threads_arr
=
[]
methods_arr
.
each
do
|
m
|
methods_arr
.
each
do
|
m
|
threads_arr
<<
Thread
.
new
{
m
.
call
}
threads_arr
<<
Thread
.
new
{
m
.
call
}
end
end
threads_arr
.
each
(
&
:join
)
threads_arr
.
each
(
&
:join
)
STDOUT
.
puts
"
\n
URLs:
#{
@urls
}
"
STDOUT
.
puts
"
\n
URLs:
#{
@urls
}
"
File
.
open
(
"urls.
txt"
,
"w"
)
{
|
file
|
file
.
puts
@urls
.
to_s
}
File
.
open
(
"urls.
yml"
,
"w"
)
{
|
file
|
file
.
puts
@urls
.
to_yaml
}
STDOUT
.
puts
"
\n
Done"
STDOUT
.
puts
"
\n
Done"
end
end
private
private
def
create_group
def
create_group
group_search_response
=
post
Runtime
::
API
::
Request
.
new
(
@api_client
,
"/groups"
).
url
,
"name=
#{
@group_name
}
&path=
#{
@group_name
}
"
group_search_response
=
post
Runtime
::
API
::
Request
.
new
(
@api_client
,
"/groups"
).
url
,
"name=
#{
@group_name
}
&path=
#{
@group_name
}
&visibility=
#{
@visibility
}
"
group
=
JSON
.
parse
(
group_search_response
.
body
)
group
=
JSON
.
parse
(
group_search_response
.
body
)
@urls
[
:group_page
]
=
group
[
"web_url"
]
@urls
[
:group_page
]
=
group
[
"web_url"
]
group
[
"id"
]
group
[
"id"
]
end
end
def
create_project
(
group_id
)
def
create_project
(
group_id
)
create_project_response
=
post
Runtime
::
API
::
Request
.
new
(
@api_client
,
"/projects"
).
url
,
"name=
#{
@project_name
}
&namespace_id=
#{
group_id
}
"
create_project_response
=
post
Runtime
::
API
::
Request
.
new
(
@api_client
,
"/projects"
).
url
,
"name=
#{
@project_name
}
&namespace_id=
#{
group_id
}
&visibility=
#{
@visibility
}
"
@urls
[
:project_page
]
=
JSON
.
parse
(
create_project_response
.
body
)[
"web_url"
]
@urls
[
:project_page
]
=
JSON
.
parse
(
create_project_response
.
body
)[
"web_url"
]
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment