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
f286d097
Commit
f286d097
authored
Oct 04, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve the flaky examples detection jobs
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
ebfb5a50
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
11 deletions
+14
-11
.gitlab-ci.yml
.gitlab-ci.yml
+10
-10
spec/spec_helper.rb
spec/spec_helper.rb
+4
-1
No files found.
.gitlab-ci.yml
View file @
f286d097
...
...
@@ -27,7 +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
FLAKY_RSPEC_SUITE_REPORT_PATH
:
rspec_flaky/
report-suite
.json
before_script
:
-
bundle --version
...
...
@@ -87,12 +87,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 SUITE_FLAKY_RSPEC_REPORT_PATH=${FLAKY_RSPEC_SUITE_REPORT_PATH}
-
export FLAKY_RSPEC_REPORT_PATH=rspec_flaky/all_${JOB_NAME[0]}_${CI_NODE_INDEX}_${CI_NODE_TOTAL}_report.json
-
export NEW_FLAKY_RSPEC_REPORT_PATH=rspec_flaky/new_${JOB_NAME[0]}_${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
$FLAKY_RSPEC_REPORT_PATH
]]
||
echo
"{}"
>
${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"
...
...
@@ -233,7 +234,7 @@ retrieve-tests-metadata:
-
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}/
-
mkdir -p rspec_flaky/
-
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}'
...
...
@@ -252,22 +253,21 @@ update-tests-metadata:
-
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
-
scripts/merge-reports ${FLAKY_RSPEC_SUITE_REPORT_PATH} rspec_flaky/
${CI_PROJECT_NAME}/all_node
_*.json
-
scripts/merge-reports ${FLAKY_RSPEC_SUITE_REPORT_PATH} rspec_flaky/
all_*
_*.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}/*_node
_*.json
-
rm -f rspec_flaky/
all_*.json rspec_flaky/new
_*.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
NEW_FLAKY_SPECS_REPORT
:
rspec_flaky/
report-new
.json
stage
:
post-test
allow_failure
:
yes
only
:
...
...
@@ -281,7 +281,7 @@ flaky-examples-check:
-
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/merge-reports $
{NEW_FLAKY_SPECS_REPORT} rspec_flaky/new_*
_*.json
-
scripts/detect-new-flaky-examples $NEW_FLAKY_SPECS_REPORT
setup-test-env
:
...
...
spec/spec_helper.rb
View file @
f286d097
...
...
@@ -81,7 +81,10 @@ RSpec.configure do |config|
if
ENV
[
'CI'
]
# This includes the first try, i.e. tests will be run 4 times before failing.
config
.
default_retry_count
=
4
config
.
reporter
.
register_listener
(
RspecFlaky
::
Listener
.
new
,
:example_passed
,
:dump_summary
)
config
.
reporter
.
register_listener
(
RspecFlaky
::
Listener
.
new
,
:example_passed
,
:dump_summary
)
end
config
.
before
(
:suite
)
do
...
...
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