aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/reporting_test.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-12-19 15:04:24 +0100
committerAleksandr Nogikh <wp32pw@gmail.com>2022-12-19 15:20:29 +0100
commitc52b2efbf83e9d66fa9fa7b5416aa8eb4b839f20 (patch)
tree8be760309be54399e15b960e932a314cfbb7d88b /dashboard/app/reporting_test.go
parent05494336991504e3c6137b89eeddd492e17af6b6 (diff)
dashboard: adjust pollClosed behavior for decommissioned namespaces
Return bugs from decommissioned namespaces as closed to external reportings.
Diffstat (limited to 'dashboard/app/reporting_test.go')
-rw-r--r--dashboard/app/reporting_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/dashboard/app/reporting_test.go b/dashboard/app/reporting_test.go
index d8f574994..0768d9105 100644
--- a/dashboard/app/reporting_test.go
+++ b/dashboard/app/reporting_test.go
@@ -1005,3 +1005,26 @@ func TestFullBugInfo(t *testing.T) {
c.expectEQ(info.Crashes[i].Report, report)
}
}
+
+func TestReportDecommissionedBugs(t *testing.T) {
+ c := NewCtx(t)
+ defer c.Close()
+
+ build := testBuild(1)
+ c.client.UploadBuild(build)
+
+ crash := testCrash(build, 1)
+ c.client.ReportCrash(crash)
+ rep := c.client.pollBug()
+
+ closed, _ := c.client.ReportingPollClosed([]string{rep.ID})
+ c.expectEQ(len(closed), 0)
+
+ // And now let's decommission the namespace.
+ config.Namespaces[rep.Namespace].Decommissioned = true
+ defer func() { config.Namespaces[rep.Namespace].Decommissioned = false }()
+
+ closed, _ = c.client.ReportingPollClosed([]string{rep.ID})
+ c.expectEQ(len(closed), 1)
+ c.expectEQ(closed[0], rep.ID)
+}