flutter/flutter
Testing is extensive and shard-oriented. dev/bots/test.dart is the single entrypoint: it maps SHARD/SUBSHARD env vars to suite runners under dev/bots/suite_runners and randomizes test order within shards (seeded via --test-randomize-ordering-seed). Framework unit/widget tests live in packages/flutter/test mirroring lib/; tool tests live in packages/flutter_tools/test split into shard dirs (general.shard, commands.shard/{hermetic,permeable}, web.shard, integration.shard, android_*_integration.shard). Engine C++ unit tests sit next to sources (*_unittests.cc). Golden-image testing goes through packages/flutter_goldens (Skia Gold), device-level integration through dev/devicelab and dev/integration_tests, and coverage via .github/workflows/coverage.yml.
- dev/bots/test.dart is the repo-wide test entrypoint: `dart dev/bots/test.dart` runs all tests; SHARD and SUBSHARD env vars select subsets (e.g. SHARD=framework_tests SUBSHARD=widgets, SHARD=tool_tests SUBSHARD=general); --dry-run lists what would run.
- Tests within a shard are executed in random order to catch inter-test dependencies; --test-randomize-ordering-seed=<n> reproduces a given order.
- Suite runners are modular: dev/bots/suite_runners/run_*.dart files each own one shard (framework, web, analyze, customer_testing, docs, verify_binaries_codesigned, fuchsia_precache, skp_generator, android hardware smoke, java17 integration, preview integration).
- Framework tests live in packages/flutter/test mirroring lib/ structure (animation, cupertino, material, widgets, services, semantics, rendering, ...); flutter_test provides testWidgets/pumpWidget and _goldens_io.dart/_goldens_web.dart for golden comparisons.
- Tool tests are sharded by directory: packages/flutter_tools/test/{general.shard,commands.shard,web.shard,integration.shard,android_java17_integration.shard,android_preview_integration.shard}; commands.shard is further split into hermetic and permeable subdirs.
- Engine C++ code uses gtest-style unit tests co-located with sources (engine_unittests.cc, animator_unittests.cc, rasterizer_unittests.cc, pipeline_unittests.cc, persistent_cache_unittests.cc) under engine/src/flutter/shell/common; there is also engine/src/flutter/testing for harnesses.
- Device-lab integration tests run on real hardware via dev/devicelab (bin/run.dart task runner + lib/tasks task library); dev/integration_tests contains ~35 test apps wired into the pub workspace.
- CI wiring: .ci.yaml declares per-commit LUCI targets with platform_properties (OS, cores, device_type, kvm, dependencies like android_sdk/open_jdk/gradle_dists versions) and enabled_branches master + release candidates.
- GitHub Actions runs auxiliary checks only: tool-test-general.yml runs the tool_tests general subshard on PRs touching dev/, packages/flutter_tools/, bin/, engine/, .ci.yaml, DEPS; coverage.yml handles coverage.
- Static analysis is enforced: root analysis_options.yaml + analysis_options_common.yaml apply repo-wide lints, and dev/bots/analyze.dart is a custom analysis shard runner (plus check_code_samples.dart, check_examples_cross_imports.dart).
- Test ownership is tracked in TESTOWNERS at repo root; dev/forbidden_from_release_tests guards that certain tests never run on release branches.
- Coverage/testing gaps are partially self-reported: framework_coverage is its own shard (run_framework_coverage_tests.dart) implying measured coverage enforcement rather than incidental. (inferred)