aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/cover/heatmap_test.go
diff options
context:
space:
mode:
authorTaras Madan <tarasmadan@google.com>2024-08-26 12:32:02 +0200
committerTaras Madan <tarasmadan@google.com>2024-08-27 15:12:58 +0000
commite4f3ea1bc2e083feadcf5a6083a5d7e74e9fc53e (patch)
treed9efa4202bea3cee892525837201d188c782179c /pkg/cover/heatmap_test.go
parent5fc2677b4aeffac87aef5092b99ca41ccefa57fa (diff)
pkg/covermerger: add tooltips to every coverage number
Hover mouse onto the percent value to see details. To test: $ go run ./tools/syz-cover -heatmap upstream -from 2024-08-23 -to 2024-08-23 $ google-chrome upstream.html
Diffstat (limited to 'pkg/cover/heatmap_test.go')
-rw-r--r--pkg/cover/heatmap_test.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg/cover/heatmap_test.go b/pkg/cover/heatmap_test.go
index 3d54f5b40..f83b31191 100644
--- a/pkg/cover/heatmap_test.go
+++ b/pkg/cover/heatmap_test.go
@@ -46,6 +46,9 @@ func TestFilesCoverageToTemplateData(t *testing.T) {
IsDir: false,
Depth: 0,
LastDayInstrumented: 1,
+ Tooltips: []string{
+ "Instrumented:\t1 blocks\nCovered:\t1 blocks",
+ },
},
},
Name: "",
@@ -53,6 +56,9 @@ func TestFilesCoverageToTemplateData(t *testing.T) {
IsDir: false,
Depth: 0,
LastDayInstrumented: 1,
+ Tooltips: []string{
+ "Instrumented:\t1 blocks\nCovered:\t1 blocks",
+ },
},
Dates: []string{"2024-07-01"},
},
@@ -85,6 +91,10 @@ func TestFilesCoverageToTemplateData(t *testing.T) {
IsDir: false,
Depth: 1,
LastDayInstrumented: 0,
+ Tooltips: []string{
+ "Instrumented:\t1 blocks\nCovered:\t1 blocks",
+ "Instrumented:\t0 blocks\nCovered:\t0 blocks",
+ },
},
{
Items: []*templateHeatmapRow{},
@@ -93,6 +103,10 @@ func TestFilesCoverageToTemplateData(t *testing.T) {
IsDir: false,
Depth: 1,
LastDayInstrumented: 1,
+ Tooltips: []string{
+ "Instrumented:\t0 blocks\nCovered:\t0 blocks",
+ "Instrumented:\t1 blocks\nCovered:\t0 blocks",
+ },
},
},
Name: "dir",
@@ -100,11 +114,19 @@ func TestFilesCoverageToTemplateData(t *testing.T) {
IsDir: true,
Depth: 0,
LastDayInstrumented: 1,
+ Tooltips: []string{
+ "Instrumented:\t1 blocks\nCovered:\t1 blocks",
+ "Instrumented:\t1 blocks\nCovered:\t0 blocks",
+ },
},
},
Name: "",
Coverage: []int64{100, 0},
LastDayInstrumented: 1,
+ Tooltips: []string{
+ "Instrumented:\t1 blocks\nCovered:\t1 blocks",
+ "Instrumented:\t1 blocks\nCovered:\t0 blocks",
+ },
},
Dates: []string{"2024-07-01", "2024-07-02"},
},