tests: SSE parsing + relay event handling, update AGENTS.md

- New test module test/RelaySpec.hs (20 tests):
  - extractLines: line splitting, CRLF, partial lines, empty input
  - foldLines: single/two push events, non-push ignored, comments, no-space colon,
    partial state carry-over across batches
  - parseEvent: valid push, non-push, malformed JSON, multi-line data
  - handleSSEEvent: pull on matching repo, ignore wrong gitea_repo/branch,
    skip pull when merge/rebase/operation in progress
- Exported PushEvent(..), extractLines, foldLines, parseEvent, handleSSEEvent
- Fixed data line order (append instead of prepend+reverse) and event ordering
- Updated AGENTS.md: relay architecture, Go component, new deps, file layout
This commit is contained in:
2026-05-14 14:40:47 -04:00
parent 7feff5abfa
commit 662854a977
4 changed files with 360 additions and 4 deletions
+2
View File
@@ -3,6 +3,7 @@ module Main (main) where
import qualified GitCommitSpec
import qualified GitPullSpec
import qualified GitSafetySpec
import qualified RelaySpec
import Test.Hspec
main :: IO ()
@@ -10,3 +11,4 @@ main = hspec $ do
GitCommitSpec.spec
GitPullSpec.spec
GitSafetySpec.spec
RelaySpec.spec