Skip to content

Commit f0ab87d

Browse files
committed
fix(test): unwrap IssueL through .base.id in ErrorPatternsSpec
IssueL is a list-view wrapper around Issue (`{ base :: Issue, ... }`), so the `id` field is reached through `.base`. Four sites in ErrorPatternsSpec called `issue.id` directly, which type-errored after IssueL gained its current shape. Matches the pattern used in src/Pages/Anomalies.hs (`errL.base.id`).
1 parent 2a1abf3 commit f0ab87d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

test/integration/Pages/ErrorPatternsSpec.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ spec = aroundAll withTestResources do
242242

243243
-- Acknowledge existing issues so ON CONFLICT doesn't deduplicate the new spike issue
244244
(issues, _) <- runTestBg frozenTime tr $ Issues.selectIssues pid Nothing (Just False) Nothing 100 0 Nothing Nothing "24h" [] []
245-
forM_ issues \issue -> runTestBg frozenTime tr $ Issues.acknowledgeIssue issue.id sess.user.id
245+
forM_ issues \issue -> runTestBg frozenTime tr $ Issues.acknowledgeIssue issue.base.id sess.user.id
246246

247247
-- Find an established pattern with stddev > 0
248248
errRates' <- runTestBg frozenTime tr $ ErrorPatterns.getErrorPatternsWithCurrentRates pid frozenTime
@@ -307,7 +307,7 @@ spec = aroundAll withTestResources do
307307
-- Acknowledge existing RuntimeException issues to avoid ON CONFLICT dedup
308308
let sess = Servant.getResponse tr.trSessAndHeader
309309
(issues, _) <- runTestBg frozenTime tr $ Issues.selectIssues pid Nothing (Just False) Nothing 100 0 Nothing Nothing "24h" [] []
310-
forM_ issues \issue -> runTestBg frozenTime tr $ Issues.acknowledgeIssue issue.id sess.user.id
310+
forM_ issues \issue -> runTestBg frozenTime tr $ Issues.acknowledgeIssue issue.base.id sess.user.id
311311

312312
-- Insert a massive spike (200, well above mean=100 + minAbsoluteDelta=50)
313313
let spikeTime = addUTCTime 7200 frozenTime
@@ -348,7 +348,7 @@ spec = aroundAll withTestResources do
348348
-- Acknowledge existing issues to avoid ON CONFLICT dedup
349349
let sess = Servant.getResponse tr.trSessAndHeader
350350
(issues, _) <- runTestBg frozenTime tr $ Issues.selectIssues pid Nothing (Just False) Nothing 100 0 Nothing Nothing "24h" [] []
351-
forM_ issues \issue -> runTestBg frozenTime tr $ Issues.acknowledgeIssue issue.id sess.user.id
351+
forM_ issues \issue -> runTestBg frozenTime tr $ Issues.acknowledgeIssue issue.base.id sess.user.id
352352

353353
issuesBefore <- countIssues tr Issues.RuntimeException
354354
runTestBg spikeTime tr $ BackgroundJobs.detectErrorSpikes pid
@@ -379,7 +379,7 @@ spec = aroundAll withTestResources do
379379
-- Acknowledge existing issues to avoid ON CONFLICT dedup
380380
let sess = Servant.getResponse tr.trSessAndHeader
381381
(issues, _) <- runTestBg frozenTime tr $ Issues.selectIssues pid Nothing (Just False) Nothing 100 0 Nothing Nothing "24h" [] []
382-
forM_ issues \issue -> runTestBg frozenTime tr $ Issues.acknowledgeIssue issue.id sess.user.id
382+
forM_ issues \issue -> runTestBg frozenTime tr $ Issues.acknowledgeIssue issue.base.id sess.user.id
383383
-- Spike both patterns in the same hour bucket
384384
let concurrentTime = addUTCTime 14400 frozenTime
385385
forM_ [r1, r2] \r -> do

0 commit comments

Comments
 (0)