Skip to content

Commit 17b8de6

Browse files
committed
dashboard/app: enable coverage pages formatting
cover.Format controls the resulting view. It allows to: 1. Remove records with 0 covered blocks. 2. Remove lines with low (user defined) coverage. 3. Order records by the covered lines drop value. The corresponding GET parameters are: 1. Implicitly enabled for onlyUnique records. 2. min-cover-lines-drop=%d 3. order-by-cover-lines-drop=1
1 parent 939f5c2 commit 17b8de6

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

dashboard/app/coverage.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,6 @@ func handleHeatmap(c context.Context, w http.ResponseWriter, r *http.Request, f
121121

122122
onlyUnique := r.FormValue("unique-only") == "1"
123123
orderByCoverLinesDrop := r.FormValue("order-by-cover-lines-drop") == "1"
124-
minPercentDrop, err := strconv.Atoi("0" + r.FormValue("min-percent-drop"))
125-
if err != nil {
126-
return fmt.Errorf("min-percent-drop should be integer")
127-
}
128124
minCoverLinesDrop, err := strconv.Atoi("0" + r.FormValue("min-cover-lines-drop"))
129125
if err != nil {
130126
return fmt.Errorf("min-cover-lines-drop should be integer")
@@ -141,7 +137,6 @@ func handleHeatmap(c context.Context, w http.ResponseWriter, r *http.Request, f
141137
},
142138
onlyUnique, subsystems, managers,
143139
cover.Format{
144-
FilterMinPercentDrop: minPercentDrop,
145140
FilterMinCoveredLinesDrop: minCoverLinesDrop,
146141
OrderByCoveredLinesDrop: orderByCoverLinesDrop,
147142
DropCoveredLines0: onlyUnique,

pkg/cover/heatmap_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ func TestFilesCoverageToTemplateData(t *testing.T) {
156156
}
157157
}
158158

159+
// nolint: dupl
159160
func TestFormatResult(t *testing.T) {
160161
tests := []struct {
161162
name string

0 commit comments

Comments
 (0)