Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
eth-log-alerting
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Server Tools
eth-log-alerting
Merge requests
!4
Better CI
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Better CI
fix/7-improve-ci
into
master
Overview
0
Commits
11
Pipelines
10
Changes
4
Merged
Erick Hitter
requested to merge
fix/7-improve-ci
into
master
6 years ago
Overview
0
Commits
11
Pipelines
10
Changes
4
Expand
Fixes
#7 (closed)
Edited
6 years ago
by
Erick Hitter
0
0
Merge request reports
Compare
master
version 9
5859b51e
6 years ago
version 8
36819465
6 years ago
version 7
dfa1f983
6 years ago
version 6
fb232095
6 years ago
version 5
402ed32d
6 years ago
version 4
f47dc63d
6 years ago
version 3
71925def
6 years ago
version 2
a994ea5f
6 years ago
version 1
3bf5374a
6 years ago
master (base)
and
latest version
latest version
d23d4184
11 commits,
6 years ago
version 9
5859b51e
10 commits,
6 years ago
version 8
36819465
9 commits,
6 years ago
version 7
dfa1f983
8 commits,
6 years ago
version 6
fb232095
7 commits,
6 years ago
version 5
402ed32d
6 commits,
6 years ago
version 4
f47dc63d
5 commits,
6 years ago
version 3
71925def
3 commits,
6 years ago
version 2
a994ea5f
2 commits,
6 years ago
version 1
3bf5374a
1 commit,
6 years ago
4 files
+
135
−
23
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
tools/coverage.sh
0 → 100755
+
29
−
0
Options
#!/bin/bash
#
# Code coverage generation
COVERAGE_DIR
=
"
${
COVERAGE_DIR
:-
coverage
}
"
PKG_LIST
=
$(
go list ./... |
grep
-v
/vendor/
)
# Create the coverage files directory
mkdir
-p
"
$COVERAGE_DIR
"
;
# Create a coverage file for each package
for
package
in
${
PKG_LIST
}
;
do
go
test
-covermode
=
count
-coverprofile
"
${
COVERAGE_DIR
}
/
${
package
##*/
}
.cov"
"
$package
"
;
done
;
# Merge the coverage profile files
echo
'mode: count'
>
"
${
COVERAGE_DIR
}
"
/coverage.cov
;
tail
-q
-n
+2
"
${
COVERAGE_DIR
}
"
/
*
.cov
>>
"
${
COVERAGE_DIR
}
"
/coverage.cov
;
# Display the global code coverage
go tool cover
-func
=
"
${
COVERAGE_DIR
}
"
/coverage.cov
;
# If needed, generate HTML report
if
[
"
$1
"
==
"html"
]
;
then
go tool cover
-html
=
"
${
COVERAGE_DIR
}
"
/coverage.cov
-o
coverage.html
;
fi
# Remove the coverage files directory
rm
-rf
"
$COVERAGE_DIR
"
;
Loading