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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
7e3ff5a0
Commit
7e3ff5a0
authored
Jul 21, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Retrieve and sync flaky specs report from and to S3
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
8f8fd342
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
147 additions
and
88 deletions
+147
-88
.gitlab-ci.yml
.gitlab-ci.yml
+125
-87
scripts/detect-new-flaky-examples
scripts/detect-new-flaky-examples
+21
-0
scripts/merge-reports
scripts/merge-reports
+1
-1
No files found.
.gitlab-ci.yml
View file @
7e3ff5a0
...
...
@@ -27,6 +27,7 @@ variables:
GET_SOURCES_ATTEMPTS
:
"
3"
KNAPSACK_RSPEC_SUITE_REPORT_PATH
:
knapsack/${CI_PROJECT_NAME}/rspec_report-master.json
KNAPSACK_SPINACH_SUITE_REPORT_PATH
:
knapsack/${CI_PROJECT_NAME}/spinach_report-master.json
FLAKY_RSPEC_SUITE_REPORT_PATH
:
rspec_flaky/${CI_PROJECT_NAME}/report-master.json
before_script
:
-
bundle --version
...
...
@@ -45,16 +46,17 @@ stages:
tags
:
-
gitlab-org
.
knapsack-state
:
&knapsack
-state
.
tests-metadata-state
:
&tests-metadata
-state
services
:
[]
variables
:
SETUP_DB
:
"
false"
USE_BUNDLE_INSTALL
:
"
false"
KNAPSACK
_S3_BUCKET
:
"
gitlab-ce-cache"
TESTS_METADATA
_S3_BUCKET
:
"
gitlab-ce-cache"
artifacts
:
expire_in
:
31d
paths
:
-
knapsack/
-
rspec_flaky/
.use-pg
:
&use-pg
services
:
...
...
@@ -86,7 +88,7 @@ stages:
except
:
-
/(^docs[\/-].*|.*-docs$)/
.rspec-
knapsack
:
&rspec-knapsack
.rspec-
metadata
:
&rspec-metadata
<<
:
*dedicated-runner
<<
:
*pull-cache
stage
:
test
...
...
@@ -96,8 +98,13 @@ stages:
-
export CI_NODE_TOTAL=${JOB_NAME[-1]}
-
export KNAPSACK_REPORT_PATH=knapsack/${CI_PROJECT_NAME}/${JOB_NAME[0]}_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
-
export KNAPSACK_GENERATE_REPORT=true
-
export ALL_FLAKY_RSPEC_REPORT_PATH=rspec_flaky/${CI_PROJECT_NAME}/all_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
-
export NEW_FLAKY_RSPEC_REPORT_PATH=rspec_flaky/${CI_PROJECT_NAME}/new_node_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
-
export FLAKY_RSPEC_GENERATE_REPORT=true
-
export CACHE_CLASSES=true
-
cp ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} ${KNAPSACK_REPORT_PATH}
-
cp ${FLAKY_RSPEC_SUITE_REPORT_PATH} ${ALL_FLAKY_RSPEC_REPORT_PATH}
-
'
[[
-f
$NEW_FLAKY_RSPEC_REPORT_PATH
]]
||
echo
"{}"
>
${NEW_FLAKY_RSPEC_REPORT_PATH}'
-
scripts/gitaly-test-spawn
-
knapsack rspec "--color --format documentation"
artifacts
:
...
...
@@ -106,20 +113,21 @@ stages:
paths
:
-
coverage/
-
knapsack/
-
rspec_flaky/
-
tmp/capybara/
.rspec-
knapsack-pg
:
&rspec-knapsack
-pg
<<
:
*rspec-
knapsack
.rspec-
metadata-pg
:
&rspec-metadata
-pg
<<
:
*rspec-
metadata
<<
:
*use-pg
<<
:
*except-docs
.rspec-
knapsack-mysql
:
&rspec-knapsack
-mysql
<<
:
*rspec-
knapsack
.rspec-
metadata-mysql
:
&rspec-metadata
-mysql
<<
:
*rspec-
metadata
<<
:
*use-mysql
<<
:
*only-if-want-mysql
<<
:
*except-docs
.spinach-
knapsack
:
&spinach-knapsack
.spinach-
metadata
:
&spinach-metadata
<<
:
*dedicated-runner
<<
:
*pull-cache
stage
:
test
...
...
@@ -140,13 +148,13 @@ stages:
-
knapsack/
-
tmp/capybara/
.spinach-
knapsack-pg
:
&spinach-knapsack
-pg
<<
:
*spinach-
knapsack
.spinach-
metadata-pg
:
&spinach-metadata
-pg
<<
:
*spinach-
metadata
<<
:
*use-pg
<<
:
*except-docs
.spinach-
knapsack-mysql
:
&spinach-knapsack
-mysql
<<
:
*spinach-
knapsack
.spinach-
metadata-mysql
:
&spinach-metadata
-mysql
<<
:
*spinach-
metadata
<<
:
*use-mysql
<<
:
*only-if-want-mysql
<<
:
*except-docs
...
...
@@ -176,40 +184,70 @@ build-package:
-
//@gitlab-org/gitlab-ce
-
//@gitlab-org/gitlab-ee
#
Prepare and merge knapsack tes
ts
knapsack
:
<<
:
*
knapsack
-state
#
Retrieve knapsack and rspec_flaky repor
ts
retrieve-tests-metadata
:
<<
:
*
tests-metadata
-state
<<
:
*dedicated-runner
<<
:
*except-docs
stage
:
prepare
cache
:
key
:
knapsack
paths
:
-
knapsack/
key
:
tests_metadata
policy
:
pull
script
:
-
mkdir -p knapsack/${CI_PROJECT_NAME}/
-
wget -O $KNAPSACK_RSPEC_SUITE_REPORT_PATH http://${
KNAPSACK
_S3_BUCKET}.s3.amazonaws.com/$KNAPSACK_RSPEC_SUITE_REPORT_PATH || rm $KNAPSACK_RSPEC_SUITE_REPORT_PATH
-
wget -O $KNAPSACK_SPINACH_SUITE_REPORT_PATH http://${
KNAPSACK
_S3_BUCKET}.s3.amazonaws.com/$KNAPSACK_SPINACH_SUITE_REPORT_PATH || rm $KNAPSACK_SPINACH_SUITE_REPORT_PATH
-
wget -O $KNAPSACK_RSPEC_SUITE_REPORT_PATH http://${
TESTS_METADATA
_S3_BUCKET}.s3.amazonaws.com/$KNAPSACK_RSPEC_SUITE_REPORT_PATH || rm $KNAPSACK_RSPEC_SUITE_REPORT_PATH
-
wget -O $KNAPSACK_SPINACH_SUITE_REPORT_PATH http://${
TESTS_METADATA
_S3_BUCKET}.s3.amazonaws.com/$KNAPSACK_SPINACH_SUITE_REPORT_PATH || rm $KNAPSACK_SPINACH_SUITE_REPORT_PATH
-
'
[[
-f
$KNAPSACK_RSPEC_SUITE_REPORT_PATH
]]
||
echo
"{}"
>
${KNAPSACK_RSPEC_SUITE_REPORT_PATH}'
-
'
[[
-f
$KNAPSACK_SPINACH_SUITE_REPORT_PATH
]]
||
echo
"{}"
>
${KNAPSACK_SPINACH_SUITE_REPORT_PATH}'
-
mkdir -p rspec_flaky/${CI_PROJECT_NAME}/
-
wget -O $FLAKY_RSPEC_SUITE_REPORT_PATH http://${TESTS_METADATA_S3_BUCKET}.s3.amazonaws.com/$FLAKY_RSPEC_SUITE_REPORT_PATH || rm $FLAKY_RSPEC_SUITE_REPORT_PATH
-
'
[[
-f
$FLAKY_RSPEC_SUITE_REPORT_PATH
]]
||
echo
"{}"
>
${FLAKY_RSPEC_SUITE_REPORT_PATH}'
update-
knapsack
:
<<
:
*
knapsack
-state
update-
tests-metadata
:
<<
:
*
tests-metadata
-state
<<
:
*dedicated-runner
<<
:
*only-canonical-masters
stage
:
post-test
cache
:
key
:
knapsack
key
:
tests_metadata
paths
:
-
knapsack/
-
rspec_flaky/
policy
:
push
script
:
-
retry gem install fog-aws mime-types
-
scripts/merge-reports ${KNAPSACK_RSPEC_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/rspec-pg_node_*.json
-
scripts/merge-reports ${KNAPSACK_SPINACH_SUITE_REPORT_PATH} knapsack/${CI_PROJECT_NAME}/spinach-pg_node_*.json
-
'
[[
-z
${KNAPSACK_S3_BUCKET}
]]
||
scripts/sync-reports
put
$KNAPSACK_S3_BUCKET
$KNAPSACK_RSPEC_SUITE_REPORT_PATH
$KNAPSACK_SPINACH_SUITE_REPORT_PATH'
-
scripts/merge-reports ${FLAKY_RSPEC_SUITE_REPORT_PATH} rspec_flaky/${CI_PROJECT_NAME}/all_node_*.json
-
'
[[
-z
${TESTS_METADATA_S3_BUCKET}
]]
||
scripts/sync-reports
put
$TESTS_METADATA_S3_BUCKET
$KNAPSACK_RSPEC_SUITE_REPORT_PATH
$KNAPSACK_SPINACH_SUITE_REPORT_PATH'
-
'
[[
-z
${TESTS_METADATA_S3_BUCKET}
]]
||
scripts/sync-reports
put
$TESTS_METADATA_S3_BUCKET
$FLAKY_RSPEC_SUITE_REPORT_PATH'
-
rm -f knapsack/${CI_PROJECT_NAME}/*_node_*.json
-
rm -f rspec_flaky/${CI_PROJECT_NAME}/all_node_*.json
flaky-examples-check
:
<<
:
*dedicated-runner
image
:
ruby:2.3-alpine
services
:
[]
before_script
:
[]
cache
:
{}
variables
:
SETUP_DB
:
"
false"
USE_BUNDLE_INSTALL
:
"
false"
NEW_FLAKY_SPECS_REPORT
:
rspec_flaky/${CI_PROJECT_NAME}/new_rspec_flaky_examples.json
stage
:
post-test
allow_failure
:
yes
only
:
-
branches
except
:
-
master
artifacts
:
expire_in
:
30d
paths
:
-
rspec_flaky/
script
:
-
'
[[
-f
$NEW_FLAKY_SPECS_REPORT
]]
||
echo
"{}"
>
${NEW_FLAKY_SPECS_REPORT}'
-
scripts/merge-reports $NEW_FLAKY_SPECS_REPORT rspec_flaky/${CI_PROJECT_NAME}/new_node_*.json
-
scripts/detect-new-flaky-examples $NEW_FLAKY_SPECS_REPORT
setup-test-env
:
<<
:
*use-pg
...
...
@@ -232,69 +270,69 @@ setup-test-env:
-
public/assets
-
tmp/tests
rspec-pg 0 25
:
*rspec-
knapsack
-pg
rspec-pg 1 25
:
*rspec-
knapsack
-pg
rspec-pg 2 25
:
*rspec-
knapsack
-pg
rspec-pg 3 25
:
*rspec-
knapsack
-pg
rspec-pg 4 25
:
*rspec-
knapsack
-pg
rspec-pg 5 25
:
*rspec-
knapsack
-pg
rspec-pg 6 25
:
*rspec-
knapsack
-pg
rspec-pg 7 25
:
*rspec-
knapsack
-pg
rspec-pg 8 25
:
*rspec-
knapsack
-pg
rspec-pg 9 25
:
*rspec-
knapsack
-pg
rspec-pg 10 25
:
*rspec-
knapsack
-pg
rspec-pg 11 25
:
*rspec-
knapsack
-pg
rspec-pg 12 25
:
*rspec-
knapsack
-pg
rspec-pg 13 25
:
*rspec-
knapsack
-pg
rspec-pg 14 25
:
*rspec-
knapsack
-pg
rspec-pg 15 25
:
*rspec-
knapsack
-pg
rspec-pg 16 25
:
*rspec-
knapsack
-pg
rspec-pg 17 25
:
*rspec-
knapsack
-pg
rspec-pg 18 25
:
*rspec-
knapsack
-pg
rspec-pg 19 25
:
*rspec-
knapsack
-pg
rspec-pg 20 25
:
*rspec-
knapsack
-pg
rspec-pg 21 25
:
*rspec-
knapsack
-pg
rspec-pg 22 25
:
*rspec-
knapsack
-pg
rspec-pg 23 25
:
*rspec-
knapsack
-pg
rspec-pg 24 25
:
*rspec-
knapsack
-pg
rspec-mysql 0 25
:
*rspec-
knapsack
-mysql
rspec-mysql 1 25
:
*rspec-
knapsack
-mysql
rspec-mysql 2 25
:
*rspec-
knapsack
-mysql
rspec-mysql 3 25
:
*rspec-
knapsack
-mysql
rspec-mysql 4 25
:
*rspec-
knapsack
-mysql
rspec-mysql 5 25
:
*rspec-
knapsack
-mysql
rspec-mysql 6 25
:
*rspec-
knapsack
-mysql
rspec-mysql 7 25
:
*rspec-
knapsack
-mysql
rspec-mysql 8 25
:
*rspec-
knapsack
-mysql
rspec-mysql 9 25
:
*rspec-
knapsack
-mysql
rspec-mysql 10 25
:
*rspec-
knapsack
-mysql
rspec-mysql 11 25
:
*rspec-
knapsack
-mysql
rspec-mysql 12 25
:
*rspec-
knapsack
-mysql
rspec-mysql 13 25
:
*rspec-
knapsack
-mysql
rspec-mysql 14 25
:
*rspec-
knapsack
-mysql
rspec-mysql 15 25
:
*rspec-
knapsack
-mysql
rspec-mysql 16 25
:
*rspec-
knapsack
-mysql
rspec-mysql 17 25
:
*rspec-
knapsack
-mysql
rspec-mysql 18 25
:
*rspec-
knapsack
-mysql
rspec-mysql 19 25
:
*rspec-
knapsack
-mysql
rspec-mysql 20 25
:
*rspec-
knapsack
-mysql
rspec-mysql 21 25
:
*rspec-
knapsack
-mysql
rspec-mysql 22 25
:
*rspec-
knapsack
-mysql
rspec-mysql 23 25
:
*rspec-
knapsack
-mysql
rspec-mysql 24 25
:
*rspec-
knapsack
-mysql
spinach-pg 0 5
:
*spinach-
knapsack
-pg
spinach-pg 1 5
:
*spinach-
knapsack
-pg
spinach-pg 2 5
:
*spinach-
knapsack
-pg
spinach-pg 3 5
:
*spinach-
knapsack
-pg
spinach-pg 4 5
:
*spinach-
knapsack
-pg
spinach-mysql 0 5
:
*spinach-
knapsack
-mysql
spinach-mysql 1 5
:
*spinach-
knapsack
-mysql
spinach-mysql 2 5
:
*spinach-
knapsack
-mysql
spinach-mysql 3 5
:
*spinach-
knapsack
-mysql
spinach-mysql 4 5
:
*spinach-
knapsack
-mysql
rspec-pg 0 25
:
*rspec-
metadata
-pg
rspec-pg 1 25
:
*rspec-
metadata
-pg
rspec-pg 2 25
:
*rspec-
metadata
-pg
rspec-pg 3 25
:
*rspec-
metadata
-pg
rspec-pg 4 25
:
*rspec-
metadata
-pg
rspec-pg 5 25
:
*rspec-
metadata
-pg
rspec-pg 6 25
:
*rspec-
metadata
-pg
rspec-pg 7 25
:
*rspec-
metadata
-pg
rspec-pg 8 25
:
*rspec-
metadata
-pg
rspec-pg 9 25
:
*rspec-
metadata
-pg
rspec-pg 10 25
:
*rspec-
metadata
-pg
rspec-pg 11 25
:
*rspec-
metadata
-pg
rspec-pg 12 25
:
*rspec-
metadata
-pg
rspec-pg 13 25
:
*rspec-
metadata
-pg
rspec-pg 14 25
:
*rspec-
metadata
-pg
rspec-pg 15 25
:
*rspec-
metadata
-pg
rspec-pg 16 25
:
*rspec-
metadata
-pg
rspec-pg 17 25
:
*rspec-
metadata
-pg
rspec-pg 18 25
:
*rspec-
metadata
-pg
rspec-pg 19 25
:
*rspec-
metadata
-pg
rspec-pg 20 25
:
*rspec-
metadata
-pg
rspec-pg 21 25
:
*rspec-
metadata
-pg
rspec-pg 22 25
:
*rspec-
metadata
-pg
rspec-pg 23 25
:
*rspec-
metadata
-pg
rspec-pg 24 25
:
*rspec-
metadata
-pg
rspec-mysql 0 25
:
*rspec-
metadata
-mysql
rspec-mysql 1 25
:
*rspec-
metadata
-mysql
rspec-mysql 2 25
:
*rspec-
metadata
-mysql
rspec-mysql 3 25
:
*rspec-
metadata
-mysql
rspec-mysql 4 25
:
*rspec-
metadata
-mysql
rspec-mysql 5 25
:
*rspec-
metadata
-mysql
rspec-mysql 6 25
:
*rspec-
metadata
-mysql
rspec-mysql 7 25
:
*rspec-
metadata
-mysql
rspec-mysql 8 25
:
*rspec-
metadata
-mysql
rspec-mysql 9 25
:
*rspec-
metadata
-mysql
rspec-mysql 10 25
:
*rspec-
metadata
-mysql
rspec-mysql 11 25
:
*rspec-
metadata
-mysql
rspec-mysql 12 25
:
*rspec-
metadata
-mysql
rspec-mysql 13 25
:
*rspec-
metadata
-mysql
rspec-mysql 14 25
:
*rspec-
metadata
-mysql
rspec-mysql 15 25
:
*rspec-
metadata
-mysql
rspec-mysql 16 25
:
*rspec-
metadata
-mysql
rspec-mysql 17 25
:
*rspec-
metadata
-mysql
rspec-mysql 18 25
:
*rspec-
metadata
-mysql
rspec-mysql 19 25
:
*rspec-
metadata
-mysql
rspec-mysql 20 25
:
*rspec-
metadata
-mysql
rspec-mysql 21 25
:
*rspec-
metadata
-mysql
rspec-mysql 22 25
:
*rspec-
metadata
-mysql
rspec-mysql 23 25
:
*rspec-
metadata
-mysql
rspec-mysql 24 25
:
*rspec-
metadata
-mysql
spinach-pg 0 5
:
*spinach-
metadata
-pg
spinach-pg 1 5
:
*spinach-
metadata
-pg
spinach-pg 2 5
:
*spinach-
metadata
-pg
spinach-pg 3 5
:
*spinach-
metadata
-pg
spinach-pg 4 5
:
*spinach-
metadata
-pg
spinach-mysql 0 5
:
*spinach-
metadata
-mysql
spinach-mysql 1 5
:
*spinach-
metadata
-mysql
spinach-mysql 2 5
:
*spinach-
metadata
-mysql
spinach-mysql 3 5
:
*spinach-
metadata
-mysql
spinach-mysql 4 5
:
*spinach-
metadata
-mysql
# Static analysis jobs
.ruby-static-analysis
:
&ruby-static-analysis
...
...
scripts/detect-new-flaky-examples
0 → 100755
View file @
7e3ff5a0
#!/usr/bin/env ruby
require
'json'
report_file
=
ARGV
.
shift
unless
report_file
puts
'usage: detect-new-flaky-examples <report-file>'
exit
1
end
puts
"Loading
#{
report_file
}
..."
report
=
JSON
.
parse
(
File
.
read
(
report_file
))
if
report
.
any?
puts
"New flaky examples were detected!
\n
"
puts
JSON
.
pretty_generate
(
report
)
exit
1
else
puts
"No new flaky examples detected.
\n
"
exit
0
end
scripts/merge-reports
View file @
7e3ff5a0
...
...
@@ -4,7 +4,7 @@ require 'json'
main_report_file
=
ARGV
.
shift
unless
main_report_file
puts
'usage: merge
_
reports <main-report> [extra reports...]'
puts
'usage: merge
-
reports <main-report> [extra reports...]'
exit
1
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