ci: run non-golden widget tests in CI coverage (#416)
This PR includes widget tests (excluding golden tests) in the CI coverage run, ensuring widget layout and UI logic are tested automatically. Co-authored-by: Thomas Güttler <thomas.guettler@syself.com> Reviewed-on: https://codeberg.org/guettli/sharedinbox/pulls/416
This commit was merged in pull request #416.
This commit is contained in:
committed by
guettli
co-authored by
guettli
Thomas Güttler
parent
f28630fd7e
commit
4ef441ab1b
+2
-2
@@ -461,12 +461,12 @@ func (m *Ci) CheckGenerated(ctx context.Context) (string, error) {
|
||||
Stdout(ctx)
|
||||
}
|
||||
|
||||
// Coverage runs unit tests with coverage gate.
|
||||
// Coverage runs unit and widget tests with coverage gate.
|
||||
func (m *Ci) Coverage(ctx context.Context) (string, error) {
|
||||
return m.setup(m.checkSrc()).
|
||||
WithExec([]string{"/bin/bash", "-c",
|
||||
`tmp=$(mktemp); trap 'rm -f "$tmp"' EXIT; ` +
|
||||
`flutter test test/unit --coverage --reporter expanded --no-pub >"$tmp" 2>&1 || { cat "$tmp"; exit 1; }; ` +
|
||||
`flutter test test/unit test/widget --exclude-tags golden --coverage --reporter expanded --no-pub >"$tmp" 2>&1 || { cat "$tmp"; exit 1; }; ` +
|
||||
`grep -E '^All [0-9]+ tests passed' "$tmp" || tail -1 "$tmp"`}).
|
||||
WithExec([]string{"dart", "scripts/check_coverage.dart"}).
|
||||
Stdout(ctx)
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
@Tags(['golden'])
|
||||
library;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/misc.dart' show Override;
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
Reference in New Issue
Block a user