From aa47157c8ec3df5a6d16e3866b095c8f91026465 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Wed, 29 Jan 2025 10:06:00 +0100 Subject: dashboard/app: change coverage links It will simplify the json API links. --- pkg/cover/heatmap.go | 2 +- pkg/cover/heatmap_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'pkg') diff --git a/pkg/cover/heatmap.go b/pkg/cover/heatmap.go index ce98113cf..f02ee132f 100644 --- a/pkg/cover/heatmap.go +++ b/pkg/cover/heatmap.go @@ -101,7 +101,7 @@ func (thm *templateHeatmapRow) prepareDataFor(pageColumns []pageColumnTarget, sk thm.instrumented[tp], thm.covered[tp])) if !thm.IsDir { thm.FileCoverageLink = append(thm.FileCoverageLink, - fmt.Sprintf("/graph/coverage/file?dateto=%s&period=%s&commit=%s&filepath=%s", + fmt.Sprintf("/coverage/file?dateto=%s&period=%s&commit=%s&filepath=%s", tp.DateTo.String(), tp.Type, pageColumn.Commit, diff --git a/pkg/cover/heatmap_test.go b/pkg/cover/heatmap_test.go index 3a90dba10..60660b0a0 100644 --- a/pkg/cover/heatmap_test.go +++ b/pkg/cover/heatmap_test.go @@ -292,7 +292,7 @@ func TestFilesCoverageToTemplateData(t *testing.T) { "Instrumented:\t1 blocks\nCovered:\t1 blocks", }, FileCoverageLink: []string{ - "/graph/coverage/file?dateto=2024-07-01&period=day&commit=commit1&filepath=file1"}, + "/coverage/file?dateto=2024-07-01&period=day&commit=commit1&filepath=file1"}, }, }, Name: "", @@ -341,8 +341,8 @@ func TestFilesCoverageToTemplateData(t *testing.T) { "Instrumented:\t0 blocks\nCovered:\t0 blocks", }, FileCoverageLink: []string{ - "/graph/coverage/file?dateto=2024-07-01&period=day&commit=commit1&filepath=dir/file1", - "/graph/coverage/file?dateto=2024-07-02&period=day&commit=commit2&filepath=dir/file1"}, + "/coverage/file?dateto=2024-07-01&period=day&commit=commit1&filepath=dir/file1", + "/coverage/file?dateto=2024-07-02&period=day&commit=commit2&filepath=dir/file1"}, }, { Name: "file2", @@ -355,8 +355,8 @@ func TestFilesCoverageToTemplateData(t *testing.T) { "Instrumented:\t1 blocks\nCovered:\t0 blocks", }, FileCoverageLink: []string{ - "/graph/coverage/file?dateto=2024-07-01&period=day&commit=commit1&filepath=dir/file2", - "/graph/coverage/file?dateto=2024-07-02&period=day&commit=commit2&filepath=dir/file2"}, + "/coverage/file?dateto=2024-07-01&period=day&commit=commit1&filepath=dir/file2", + "/coverage/file?dateto=2024-07-02&period=day&commit=commit2&filepath=dir/file2"}, }, }, Name: "dir", -- cgit mrf-deployment