From fdcfb1aa92efe1cbbc097e50b0f56b1ca3f7d741 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Mon, 15 Apr 2024 14:16:17 +0200 Subject: dashboard: include fix commits into terminal page JSONs There's little sense to make users query that information in separate queries when we already have it available. --- dashboard/app/getjson_test.go | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'dashboard/app/getjson_test.go') diff --git a/dashboard/app/getjson_test.go b/dashboard/app/getjson_test.go index 03ad24682..ebf943438 100644 --- a/dashboard/app/getjson_test.go +++ b/dashboard/app/getjson_test.go @@ -63,7 +63,24 @@ func TestJSONAPIIntegration(t *testing.T) { sampleFixedBugGroupDescr := []byte(`{ "version": 1, - "Bugs": null + "Bugs": [ + { + "title": "title2", + "link": "/bug?extid=0267d1c87b9ed4eb5def", + "fix-commits": [ + { + "title": "foo: fix1", + "repo": "git://syzkaller.org", + "branch": "branch10" + }, + { + "title": "foo: fix2", + "repo": "git://syzkaller.org", + "branch": "branch10" + } + ] + } + ] }`) c := NewCtx(t) @@ -85,6 +102,13 @@ func TestJSONAPIIntegration(t *testing.T) { checkBugPageJSONIs(c, bugReport2.ID, sampleCrashWithReproDescr) checkBugGroupPageJSONIs(c, "/test1?json=1", sampleOpenBugGroupDescr) + + c.client.ReportingUpdate(&dashapi.BugUpdate{ + ID: bugReport2.ID, + Status: dashapi.BugStatusOpen, + FixCommits: []string{"foo: fix1", "foo: fix2"}, + }) + checkBugGroupPageJSONIs(c, "/test1/fixed?json=1", sampleFixedBugGroupDescr) } -- cgit mrf-deployment