Skip to content

Commit 77ce2ae

Browse files
Fix screenshot tests failing in CI by tagging style_screen_screenshot_test
The `style_screen_screenshot_test.dart` was missing the `@Tags(['screenshot'])` annotation, causing it to: 1. Run during regular test execution (with `--exclude-tags=screenshot`) 2. Fail golden file validation (screenshots don't exist or differ in CI) 3. Not run during screenshot generation (only `test/screenshots/` folder was targeted) Fixed by: - Adding `@Tags(['screenshot'])` to `test/style_screen_screenshot_test.dart` - Changing workflow to use `--tags=screenshot` instead of targeting `test/screenshots/` directory This ensures: - Screenshot tests are excluded from regular test runs - All screenshot tests (regardless of location) run during screenshot generation - No test failures due to golden file mismatches Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
1 parent 6a11b98 commit 77ce2ae

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

.github/workflows/build-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
run: cp coverage/lcov.info coverage/lcov.main.info
7979

8080
- name: Run screenshot tests with coverage
81-
run: flutter test test/screenshots/ --update-goldens --coverage
81+
run: flutter test --tags=screenshot --update-goldens --coverage
8282

8383
- name: Install lcov for merging coverage
8484
run: sudo apt-get update && sudo apt-get install -y lcov

test/style_screen_screenshot_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import 'package:shared_preferences/shared_preferences.dart';
99

1010
import 'provider_test.mocks.dart';
1111

12+
@Tags(['screenshot'])
1213
void main() {
1314
group('StyleScreen Screenshot Tests', () {
1415
late MockBeerApiService mockApiService;

0 commit comments

Comments
 (0)