feat(ci): run TestBackend and TestIntegration in parallel

Saves ~1 minute on every CI run by starting the integration test build
concurrently with the backend Stalwart tests instead of waiting for them
to finish first.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas SharedInbox
2026-05-20 08:58:55 +02:00
co-authored by Claude Sonnet 4.6
parent 2fd82eadc4
commit 2748517d1c
+16 -8
View File
@@ -5,6 +5,8 @@ import (
"dagger/ci/internal/dagger"
"fmt"
"time"
"golang.org/x/sync/errgroup"
)
// patchAabScript patches android:versionCode in an AAB's compiled manifest proto.
@@ -418,14 +420,20 @@ func (m *Ci) Check(ctx context.Context) (string, error) {
return coverage, err
}
testBackend, err := m.TestBackend(ctx)
if err != nil {
return testBackend, err
}
testIntegration, err := m.TestIntegration(ctx)
if err != nil {
return testIntegration, err
var testBackend, testIntegration string
eg, egCtx := errgroup.WithContext(ctx)
eg.Go(func() error {
var e error
testBackend, e = m.TestBackend(egCtx)
return e
})
eg.Go(func() error {
var e error
testIntegration, e = m.TestIntegration(egCtx)
return e
})
if err := eg.Wait(); err != nil {
return "", err
}
return fmt.Sprintf("All checks passed!\n\nAnalysis:\n%s\n\n%s\n\n%s\n\nBackend Tests:\n%s\n\nIntegration Tests:\n%s\n", analyze, mocks, coverage, testBackend, testIntegration), nil