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
3cd4828c
Commit
3cd4828c
authored
Apr 21, 2020
by
Rémy Coutable
Committed by
Lin Jen-Shin
Apr 21, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix jobs used to generate the Knapsack report
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
d2958460
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
11 deletions
+38
-11
.gitlab/ci/rules.gitlab-ci.yml
.gitlab/ci/rules.gitlab-ci.yml
+3
-1
.gitlab/ci/test-metadata.gitlab-ci.yml
.gitlab/ci/test-metadata.gitlab-ci.yml
+13
-0
scripts/rspec_helpers.sh
scripts/rspec_helpers.sh
+22
-10
No files found.
.gitlab/ci/rules.gitlab-ci.yml
View file @
3cd4828c
...
...
@@ -559,7 +559,9 @@
rules
:
-
<<
:
*if-dot-com-ee-schedule
changes
:
*code-backstage-patterns
when
:
on_success
-
changes
:
-
"
.gitlab/ci/test-metadata.gitlab-ci.yml"
-
"
scripts/rspec_helpers.sh"
##############
# YAML rules #
...
...
.gitlab/ci/test-metadata.gitlab-ci.yml
View file @
3cd4828c
...
...
@@ -31,6 +31,19 @@ update-tests-metadata:
-
.tests-metadata-state
-
.test-metadata:rules:update-tests-metadata
stage
:
post-test
dependencies
:
-
setup-test-env pg11
-
rspec migration pg11
-
rspec unit pg11
-
rspec integration pg11
-
rspec system pg11
-
rspec-ee migration pg11
-
rspec-ee unit pg11
-
rspec-ee integration pg11
-
rspec-ee system pg11
-
rspec-ee unit pg11 geo
-
rspec-ee integration pg11 geo
-
rspec-ee system pg11 geo
cache
:
policy
:
push
script
:
...
...
scripts/rspec_helpers.sh
View file @
3cd4828c
...
...
@@ -15,9 +15,13 @@ function retrieve_tests_metadata() {
function
update_tests_metadata
()
{
echo
"{}"
>
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
scripts/merge-reports
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
knapsack/rspec
*
_pg9_
*
.json
scripts/merge-reports
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
knapsack/rspec
*
.json
if
[[
-n
"
${
TESTS_METADATA_S3_BUCKET
}
"
]]
;
then
if
[[
"
$CI_PIPELINE_SOURCE
"
==
"schedule"
]]
;
then
scripts/sync-reports put
"
${
TESTS_METADATA_S3_BUCKET
}
"
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
else
echo
"Not uplaoding report to S3 as the pipeline is not a scheduled one."
fi
fi
rm
-f
knapsack/rspec
*
.json
...
...
@@ -28,12 +32,20 @@ function update_tests_metadata() {
scripts/flaky_examples/prune-old-flaky-examples
"
${
FLAKY_RSPEC_SUITE_REPORT_PATH
}
"
if
[[
-n
${
TESTS_METADATA_S3_BUCKET
}
]]
;
then
if
[[
"
$CI_PIPELINE_SOURCE
"
==
"schedule"
]]
;
then
scripts/sync-reports put
"
${
TESTS_METADATA_S3_BUCKET
}
"
"
${
FLAKY_RSPEC_SUITE_REPORT_PATH
}
"
else
echo
"Not uploading report to S3 as the pipeline is not a scheduled one."
fi
fi
rm
-f
rspec_flaky/all_
*
.json rspec_flaky/new_
*
.json
if
[[
"
$CI_PIPELINE_SOURCE
"
==
"schedule"
]]
;
then
scripts/insert-rspec-profiling-data
else
echo
"Not inserting profiling data as the pipeline is not a scheduled one."
fi
}
function
rspec_simple_job
()
{
...
...
@@ -47,10 +59,10 @@ function rspec_simple_job() {
}
function
rspec_paralellized_job
()
{
read
-ra
job_name
<<<
"
$
CI_JOB_NAME
"
read
-ra
job_name
<<<
"
$
{
CI_JOB_NAME
}
"
local
test_tool
=
"
${
job_name
[0]
}
"
local
test_level
=
"
${
job_name
[1]
}
"
local
database
=
"
${
job_name
[2]
}
"
local
report_name
=
$(
echo
"
${
CI_JOB_NAME
}
"
|
sed
-E
's|[/ ]|_|g'
)
# e.g. 'rspec unit pg11 1/24' would become 'rspec_unit_pg11_1_24'
local
rspec_opts
=
"
${
1
}
"
local
spec_folder_prefix
=
""
...
...
@@ -59,7 +71,7 @@ function rspec_paralellized_job() {
fi
export
KNAPSACK_LOG_LEVEL
=
"debug"
export
KNAPSACK_REPORT_PATH
=
"knapsack/
${
test_tool
}
_
${
test_level
}
_
${
database
}
_
${
CI_NODE_INDEX
}
_
${
CI_NODE_TOTAL
}
_report.json"
export
KNAPSACK_REPORT_PATH
=
"knapsack/
${
report_name
}
_report.json"
cp
"
${
KNAPSACK_RSPEC_SUITE_REPORT_PATH
}
"
"
${
KNAPSACK_REPORT_PATH
}
"
...
...
@@ -74,8 +86,8 @@ function rspec_paralellized_job() {
export
KNAPSACK_GENERATE_REPORT
=
"true"
export
FLAKY_RSPEC_GENERATE_REPORT
=
"true"
export
SUITE_FLAKY_RSPEC_REPORT_PATH
=
"
${
FLAKY_RSPEC_SUITE_REPORT_PATH
}
"
export
FLAKY_RSPEC_REPORT_PATH
=
"rspec_flaky/all_
${
test_tool
}
_
${
CI_NODE_INDEX
}
_
${
CI_NODE_TOTAL
}
_report.json"
export
NEW_FLAKY_RSPEC_REPORT_PATH
=
"rspec_flaky/new_
${
test_tool
}
_
${
CI_NODE_INDEX
}
_
${
CI_NODE_TOTAL
}
_report.json"
export
FLAKY_RSPEC_REPORT_PATH
=
"rspec_flaky/all_
${
report_name
}
_report.json"
export
NEW_FLAKY_RSPEC_REPORT_PATH
=
"rspec_flaky/new_
${
report_name
}
_report.json"
if
[[
!
-f
$FLAKY_RSPEC_REPORT_PATH
]]
;
then
echo
"{}"
>
"
${
FLAKY_RSPEC_REPORT_PATH
}
"
...
...
@@ -90,7 +102,7 @@ function rspec_paralellized_job() {
mkdir
-p
tmp/memory_test
export
MEMORY_TEST_PATH
=
"tmp/memory_test/
${
test_tool
}
_
${
test_level
}
_
${
database
}
_
${
CI_NODE_INDEX
}
_
${
CI_NODE_TOTAL
}
_memory.csv"
export
MEMORY_TEST_PATH
=
"tmp/memory_test/
${
report_name
}
_memory.csv"
knapsack rspec
"-Ispec --color --format documentation --format RspecJunitFormatter --out junit_rspec.xml
${
rspec_opts
}
"
...
...
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