From 24b800d48d27a90447bfb9765f23093e5b9bde41 Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 5 Mar 2026 12:29:08 +0100 Subject: [PATCH] feat: add mage test:e2e-api target for e2e API tests --- magefile.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/magefile.go b/magefile.go index e7782c89c..ba5634527 100644 --- a/magefile.go +++ b/magefile.go @@ -73,6 +73,7 @@ var ( "dev:prepare-worktree": Dev.PrepareWorktree, "dev:tag-release": Dev.TagRelease, "test:e2e": Test.E2E, + "test:e2e-api": Test.E2EApi, "plugins:build": Plugins.Build, "lint": Check.Golangci, "lint:fix": Check.GolangciFix, @@ -424,7 +425,15 @@ func (Test) Filter(filter string) error { func (Test) All() { mg.Deps(initVars) - mg.Deps(Test.Feature, Test.Web) + mg.Deps(Test.Feature, Test.Web, Test.E2EApi) +} + +// E2EApi runs the end-to-end API tests in pkg/e2etests. +// These tests use the real event system (not events.Fake()) to verify +// the full async pipeline: web handler → DB → event dispatch → watermill → listener. +func (Test) E2EApi() error { + mg.Deps(initVars) + return runAndStreamOutput("go", "test", goDetectVerboseFlag(), "-p", "1", "-timeout", "45m", "./pkg/e2etests") } // E2E builds the API, starts it with an in-memory database and the frontend dev server,