Skip to content

Commit 28f2d19

Browse files
authored
More coverage cleanup (#328)
Apply a new style + remove function coverage report
1 parent f913480 commit 28f2d19

File tree

3 files changed

+160
-2
lines changed

3 files changed

+160
-2
lines changed

Diff for: .circleci/generate_coverage.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ rust-profdata merge -sparse /tmp/pgcat-*.profraw -o /tmp/pgcat.profdata
1212

1313
bash -c "rust-cov export -ignore-filename-regex='rustc|registry' -Xdemangler=rustfilt -instr-profile=/tmp/pgcat.profdata $TEST_OBJECTS --object ./target/debug/pgcat --format lcov > ./lcov.info"
1414

15-
genhtml lcov.info -show-details --highlight --ignore-errors source --legend --output-directory /tmp/cov --prefix $(pwd)
15+
genhtml lcov.info --title "PgCat Code Coverage" --css-file ./cov-style.css --no-function-coverage --highlight --ignore-errors source --legend --output-directory /tmp/cov --prefix $(pwd)

Diff for: cov-style.css

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
/*
2+
* Copyright 2021 Collabora, Ltd.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining
5+
* a copy of this software and associated documentation files (the
6+
* "Software"), to deal in the Software without restriction, including
7+
* without limitation the rights to use, copy, modify, merge, publish,
8+
* distribute, sublicense, and/or sell copies of the Software, and to
9+
* permit persons to whom the Software is furnished to do so, subject to
10+
* the following conditions:
11+
*
12+
* The above copyright notice and this permission notice (including the
13+
* next paragraph) shall be included in all copies or substantial
14+
* portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20+
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21+
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
* SOFTWARE.
24+
*/
25+
26+
body {
27+
background-color: #f2f2f2;
28+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
29+
"Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif,
30+
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
31+
"Noto Color Emoji";
32+
}
33+
34+
.sourceHeading, .source, .coverFn,
35+
.testName, .testPer, .testNum,
36+
.coverLegendCovLo, .headerCovTableEntryLo, .coverPerLo, .coverNumLo,
37+
.coverLegendCovMed, .headerCovTableEntryMed, .coverPerMed, .coverNumMed,
38+
.coverLegendCovHi, .headerCovTableEntryHi, .coverPerHi, .coverNumHi,
39+
.coverFile {
40+
font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono",
41+
"Consolas", "Ubuntu Mono", "Courier New", "andale mono",
42+
"lucida console", monospace;
43+
}
44+
45+
pre {
46+
font-size: 0.7875rem;
47+
}
48+
49+
.headerCovTableEntry, .testPer, .testNum, .testName,
50+
.coverLegendCovLo, .headerCovTableEntryLo, .coverPerLo, .coverNumLo,
51+
.coverLegendCovMed, .headerCovTableEntryMed, .coverPerMed, .coverNumMed,
52+
.coverLegendCovHi, .headerCovTableEntryHi, .coverPerHi, .coverNumHi {
53+
text-align: right;
54+
white-space: nowrap;
55+
}
56+
57+
.coverPerLo, .coverPerMed, .coverPerHi, .testPer {
58+
/* font-weight: bold;*/
59+
}
60+
61+
.coverNumLo, .coverNumMed, .coverNumHi, .testNum {
62+
font-style: italic;
63+
font-size: 90%;
64+
padding-left: 1em;
65+
}
66+
67+
.title {
68+
font-size: 200%;
69+
}
70+
71+
.tableHead {
72+
text-align: center;
73+
font-weight: bold;
74+
background-color: #bfbfbf;
75+
}
76+
77+
.coverFile, .coverBar, .coverFn {
78+
background-color: #d9d9d9;
79+
}
80+
81+
.headerCovTableHead {
82+
font-weight: bold;
83+
text-align: right;
84+
}
85+
86+
.headerCovTableEntry {
87+
background-color: #d9d9d9;
88+
}
89+
90+
.coverFnLo,
91+
.coverLegendCovLo, .headerCovTableEntryLo, .coverPerLo, .coverNumLo {
92+
background-color: #f2dada;
93+
}
94+
95+
.coverFnHi,
96+
.coverLegendCovMed, .headerCovTableEntryMed, .coverPerMed, .coverNumMed {
97+
background-color: #add9ad;
98+
}
99+
100+
.coverLegendCovHi, .headerCovTableEntryHi, .coverPerHi, .coverNumHi {
101+
background-color: #59b359;
102+
}
103+
104+
.coverBarOutline {
105+
border-style: solid;
106+
border-width: 1px;
107+
border-color: black;
108+
padding: 0px;
109+
}
110+
111+
.coverFnLo, .coverFnHi {
112+
text-align: right;
113+
}
114+
115+
.lineNum {
116+
background-color: #d9d9d9;
117+
}
118+
119+
.coverLegendCov, .lineCov, .branchCov {
120+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAABCAIAAABsYngUAAADAXpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjazZVbktwgDEX/WUWWgCSExHIwj6rsIMvPxcY9PY9MzVTyEVMNtCwkoYNwGL9+zvADDxHHkNQ8l5wjnlRS4YqJx+upZ08xnf313O/otTw8FBgzwShbP2/5gJyhz1vetp0KuT4ZKmO/OF6/qNsQ+3ZwO9yOhC4HcRsOdRsS3p7T9f+4thVzcXveQtv6sz5t1dfW0CUxzprJEvrE0SwXzJ1jMuStr0CPvhfqdvTmf7hVGTHxEJKI3leEsn4kFWNCT/CGfUnBXDEuyd4yaHGIhnm58/r581nk4Q59Y32N+p69Qc3xPelwJvRWkTeE8mP8UE76Ig/PSE9uT55z3jN+LZ/pJaibXLjxzdl9znHtrqaMLee9qXuL5wx6x8rWuSqjGX4afSV7tYLmKImGc9RxyA60RoUYGCcl6lRp0jjHRg0hJh4MjszcALcFCB0wCjcgJYBGo8kGzF0cB6DhOAik/IiFTrfldNfI4biTB5wegjHCkr9q4StKc66CIlq55CtXiItXwhHFIkeE6ocaiNDcSdUzwXd7+yyuAoJ6ptmxwRqPZQH4D6WXwyUnaIGiYrwKmKxvA0gRIlAEQwICMZMoZYrGHIwIiXQAqgidJfEBLKTKHUFyEsmAgyqAb6wxOlVZ+RLjIgQIlRzEwAaFCFgpKc6PJccZqiqaVDWrqWvRmiWvCsvZ8rpRq4klU8tm5lasBhdPrp7d3L14LVwEN64W1GPxUkqtcFphuWJ1hUKtBx9ypEOPfNjhRzlq49CkpaYtN2veSqudu3TUcc/duvfS66CBozTS0JGHDR9l1ImjNmWmqTNPmz5LmPVBbWN9175BjTY1PkktRXtQg9TsNkHrOtHFDMQ4EYDbIkASmBez6JQSL3KLWSyMqlBGkLrgdFrEQDANYp30YPdCToPkf8MtAAT/C3JhofsCuffcPqLW6/mhk5PQKsOV1CiovpHgnx3LcCvhwlnz9dF8P4Y/vfju+J8aQpZK+A373P3XzDqcKwAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB+UEEQYyDQA04tUAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAADklEQVQI12PULVBlwAYAEagAxGHRDdwAAAAASUVORK5CYII=');
121+
background-repeat: repeat-y;
122+
background-position: left top;
123+
background-color: #c6ffb8;
124+
}
125+
126+
.coverLegendNoCov, .lineNoCov, .branchNoCov, .branchNoExec {
127+
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAABCAIAAABsYngUAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAAB3RJTUUH5QMUCiMidNgp2gAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAAPSURBVAjXY/wZIcWADQAAIa4BbZaExr0AAAAASUVORK5CYII=');
128+
background-repeat: repeat-y;
129+
background-position: left top;
130+
background-color: #ffcfbb;
131+
}
132+
133+
.coverLegendCov, .coverLegendNoCov {
134+
padding: 0em 1em 0em 1em;
135+
}
136+
137+
.headerItem, .headerValue, .headerValueLeg {
138+
white-space: nowrap;
139+
}
140+
141+
.headerItem {
142+
text-align: right;
143+
font-weight: bold;
144+
}
145+
146+
.ruler {
147+
background-color: #d9d9d9;
148+
}
149+
150+
.detail {
151+
font-size: 80%;
152+
}
153+
154+
.versionInfo {
155+
font-size: 80%;
156+
text-align: right;
157+
}
158+

Diff for: tests/docker/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ rust-profdata merge -sparse /app/pgcat-*.profraw -o /app/pgcat.profdata
3131

3232
bash -c "rust-cov export -ignore-filename-regex='rustc|registry' -Xdemangler=rustfilt -instr-profile=/app/pgcat.profdata $TEST_OBJECTS --object ./target/debug/pgcat --format lcov > ./lcov.info"
3333

34-
genhtml lcov.info -show-details --highlight --ignore-errors source --legend --output-directory cov --prefix $(pwd)
34+
genhtml lcov.info --title "PgCat Code Coverage" --css-file ./cov-style.css --highlight --no-function-coverage --ignore-errors source --legend --output-directory cov --prefix $(pwd)
3535

3636
rm /app/*.profraw
3737
rm /app/pgcat.profdata

0 commit comments

Comments
 (0)