Skip to content

Commit

Permalink
Adjust test command to exlucde untestable code in coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ngoc-quoc-huynh committed Nov 4, 2024
1 parent e7f4d39 commit 3531c43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
- name: Run tests
run: |
flutter test --coverage --test-randomize-ordering-seed=random --dart-define=CI=true
dart run test_cov_console --exclude=static
dart run test_cov_console --exclude=static,domain/interfaces,injector.dart
working-directory: ./app
- name: Upload golden test failures
if: failure()
Expand Down
14 changes: 11 additions & 3 deletions app/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: i18n check-i18n check-code style test update-goldens launcher-icon splash-screen check-code check-files apk
.PHONY: i18n check-i18n check-code style test test-unit test-ui update-goldens launcher-icon splash-screen check-code check-files apk

i18n:
dart run slang
Expand All @@ -18,8 +18,16 @@ style:
dart run dart_code_linter:metrics analyze . --set-exit-on-violation-level=warning

test:
flutter test --coverage --test-randomize-ordering-seed=random --dart-define=CI=true
dart run test_cov_console --exclude=static
flutter test --coverage --test-randomize-ordering-seed=$(or $(seed),random)
dart run test_cov_console --exclude=static,domain/interfaces,injector.dart

test-unit:
flutter test test/domain test/infrastructure --coverage --test-randomize-ordering-seed=$(or $(seed),random)
dart run test_cov_console --exclude=static,ui,domain/interfaces,injector.dart

test-ui:
flutter test test/ui --coverage --test-randomize-ordering-seed=$(or $(seed),random)
dart run test_cov_console --exclude=static,domain,infrastructure,injector.dart

update-goldens:
flutter test test/ui/ --update-goldens --tags=golden
Expand Down

0 comments on commit 3531c43

Please # to comment.