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
iv
gitlab-ce
Commits
792670f4
Commit
792670f4
authored
Jun 03, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge knapsack reports and upload them to external server
parent
95c3a927
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
1 deletion
+47
-1
.gitlab-ci.yml
.gitlab-ci.yml
+18
-1
scripts/merge-reports
scripts/merge-reports
+29
-0
No files found.
.gitlab-ci.yml
View file @
792670f4
...
...
@@ -28,6 +28,7 @@ before_script:
stages
:
-
prepare
-
test
-
post-test
-
notifications
prepare
:
...
...
@@ -36,7 +37,7 @@ prepare:
USE_DB
:
"
false"
script
:
-
bundle exec rake assets:precompile
-
mkdir knapsack/
-
mkdir
-p
knapsack/
-
echo "{}" > knapsack/rspec_report.json
-
echo "{}" > knapsack/spinach_report.json
artifacts
:
...
...
@@ -57,6 +58,22 @@ prepare:
paths
:
-
knapsack/
post-tests
:
stage
:
post-test
variables
:
USE_DB
:
"
false"
script
:
-
scripts/merge-reports knapsack/rspec_report.json knapsack/rspec_node_*.json
-
scripts/merge-reports knapsack/spinach_report.json knapsack/spinach_node_*.json
-
rm -f knapsack/*_node_*.json
cache
:
key
:
"
knapsack"
paths
:
-
knapsack/
artifacts
:
paths
:
-
knapsack/
.exec
:
&exec
stage
:
test
script
:
...
...
scripts/merge-reports
0 → 100755
View file @
792670f4
#!/usr/bin/env ruby
require
'json'
require
'yaml'
main_report_file
=
ARGV
.
shift
unless
main_report_file
puts
'usage: merge_reports <main-report> [extra reports...]'
exit
1
end
puts
"Loading
#{
main_report_file
}
..."
main_report
=
JSON
.
parse
(
File
.
read
(
main_report_file
))
new_report
=
main_report
.
dup
ARGV
.
each
do
|
report_file
|
report
=
JSON
.
parse
(
File
.
read
(
report_file
))
# Remove existing values
updates
=
report
.
delete_if
do
|
key
,
value
|
main_report
[
key
]
&&
main_report
[
key
]
==
value
end
new_report
.
merge!
(
updates
)
puts
"Merged
#{
report_file
}
adding
#{
updates
.
size
}
results."
end
File
.
write
(
main_report_file
,
JSON
.
pretty_generate
(
new_report
))
puts
"Saved
#{
main_report_file
}
."
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