← スキル一覧に戻る

flutter-test-runner
by calcitem
flutter-test-runnerは、other分野における実用的なスキルです。複雑な課題への対応力を強化し、業務効率と成果の質を改善します。
⭐ 187🍴 27📅 2026年1月20日
SKILL.md
name: "Flutter Test Runner" description: "Run Sanmill's Flutter test suite, including unit tests, widget tests, and integration tests; use when running tests or checking test coverage."
Flutter Test Runner
Purpose
This skill helps run and manage Sanmill's Flutter test suite, ensuring code quality and functional correctness.
Use Cases
- Run unit and widget tests
- Run integration tests with real AI engine
- Generate and view test coverage reports
- Verify functionality after code modifications
- Validate changes in CI/CD pipelines
Test Structure Overview
src/ui/flutter_app/
├── test/ # Unit and widget tests (Dart VM, fast)
├── integration_test/ # Integration tests (real platform + AI engine)
└── test_driver/ # Test drivers
Quick Commands
Unit and Widget Tests
cd src/ui/flutter_app
# Run all tests
flutter test
# Run specific test file
flutter test test/game/position_test.dart
# Run with coverage
flutter test --coverage
Integration Tests
# From repository root - use the project script (recommended)
./run-integration-test.sh --full # Complete test suite
./run-integration-test.sh --single # Single test case
./run-integration-test.sh --help # Show options
# Manual execution (from src/ui/flutter_app)
flutter test integration_test/ -d linux # Linux
flutter test integration_test/ -d macos # macOS
flutter test integration_test/ -d windows # Windows
Test Types Comparison
| Type | Environment | Native Code | Speed | Use For |
|---|---|---|---|---|
| Unit/Widget | Dart VM | ❌ No | ⚡ Fast | Pure Dart logic, UI components |
| Integration | Real platform | ✅ Yes | 🐌 Slower | AI behavior, platform features |
Key difference: Integration tests use the real C++ AI engine and must run on actual platforms, not the Dart VM.
Coverage Reports
# Generate coverage
flutter test --coverage
# View summary (requires lcov)
lcov --summary coverage/lcov.info
# Generate HTML report
genhtml coverage/lcov.info -o coverage/html
# Then open coverage/html/index.html
Coverage targets: Overall ≥80%, Critical logic ≥90%, UI ≥70%
Common Issues & Solutions
1. MissingPluginException
- Symptom: Tests fail with plugin errors
- Cause: Running integration tests with
flutter test test/ - Fix: Use
flutter test integration_test/ -d <platform>
2. Import Errors
- Fix: Run
flutter pub getorflutter clean && flutter pub get
3. Integration Test Failures (AI-related)
- Cause: AI behavior may vary between runs
- Solution:
- Check if AI moves are reasonable
- Update expected sequences in test data if needed
- Ensure consistent AI configuration
4. Timeout Issues
- Increase test timeout in test configuration
- Check async operation handling
- Adjust
maxWaitTimeMsfor AI tests
Best Practices
- Run unit tests frequently - Fast feedback loop
- Run integration tests before commits - Catch platform-specific issues
- Check coverage for new code - Maintain quality standards
- Keep tests independent - Tests should not depend on each other
- Update expectations carefully - For AI tests, verify moves are actually correct
Reference Documentation
- Integration tests:
src/ui/flutter_app/integration_test/AUTOMATED_MOVE_TESTS_README.md - Flutter testing guide: https://docs.flutter.dev/testing
- Test directories:
src/ui/flutter_app/test/andsrc/ui/flutter_app/integration_test/
Output Format
Test results should report:
- ✓ Pass/fail status with counts
- ✗ Failure details with stack traces
- 📊 Coverage percentage (if generated)
- ⏱ Execution time
- 💡 Actionable recommendations
スコア
総合スコア
80/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
✓LICENSE
ライセンスが設定されている
+10
✓説明文
100文字以上の説明がある
+10
✓人気
GitHub Stars 100以上
+5
✓最近の活動
1ヶ月以内に更新
+10
✓フォーク
10回以上フォークされている
+5
○Issue管理
オープンIssueが50未満
0/5
✓言語
プログラミング言語が設定されている
+5
✓タグ
1つ以上のタグが設定されている
+5
レビュー
💬
レビュー機能は近日公開予定です


