test: include integration test coverage in coverage gate

- Add lcov to nix flake (required for flutter --merge-coverage)
- stalwart-dev/test.sh: collect and merge coverage when unit baseline exists
- run_unit_tests.sh: remove inline coverage check (now in dedicated task)
- Taskfile: add coverage task; check runs test → integration → coverage
  sequentially so the gate sees combined unit + integration data
- check-fast (pre-commit) omits coverage gate since integration tests
  don't run there; full gate runs only in task check
- Drop two untestable fake-only tests (UID-validity reset, malformed envelope)
- Coverage threshold restored to 80% (84% with merged data)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Güttler
2026-04-21 08:27:16 +02:00
co-authored by Claude Sonnet 4.6
parent ef7974a60a
commit 1820487c46
6 changed files with 28 additions and 60 deletions
+9 -1
View File
@@ -62,6 +62,14 @@ export STALWART_IMAP_HOST="127.0.0.1"
export STALWART_SMTP_HOST="127.0.0.1"
START=$(date +%s)
fvm flutter test --concurrency=1 test/integration/
# If unit tests already produced a coverage baseline, merge integration coverage
# into it so the final gate reflects both suites.
if [ -f coverage/lcov.info ]; then
cp coverage/lcov.info coverage/lcov.base.info
fvm flutter test --concurrency=1 --coverage --merge-coverage test/integration/
rm -f coverage/lcov.base.info
else
fvm flutter test --concurrency=1 test/integration/
fi
END=$(date +%s)
echo "integration: $((END - START))s"