- **`windows.Dockerfile`** — fixes the `COPY` source path from `./test/Windows.Tests.ps1` to `./test/windows/Windows.Tests.ps1` (root cause of the 12-month "in_progress forever" state); adds `COPY ./config/version.json` to the `test` stage; replaces the commented `CMD` with a real `CMD` so `docker run`/`docker compose run` invokes Pester without arguments. - **`test/windows/Windows.Tests.ps1`** — fixes the `VC.CMake.Project` pattern typo (`,versiona*` → `,version=*`) and standardises all three VS-component patterns to `,version=*`; adds a `Flutter version` test that reads `config/version.json` and asserts `flutter --version` inside the container reports the same version; adds a `Flutter doctor` test with a per-line parser (skip disabled platforms, fail on any non-`[✓]` for Windows toolchain lines, fail on `[✗]` elsewhere). - **`script/RunPester.ps1`** — forces `[Console]::OutputEncoding = UTF8` so the `[✓]`/`[!]`/`[✗]` doctor glyphs survive the `windows-2025` runner's default OEM codepage. - **`test/windows/`** — deletes the dead `ory/dockertest` Go skeleton (`main.go`, `main_test.go`, `go.mod`, `go.sum`) that was never wired into CI and had its only meaningful assertion commented out. - **`.github/workflows/windows.yml`** — deletes three commented-out blocks (`Scan with Docker Scout`, `Push to Docker Hub`, `validate_version` job referencing the deleted `config/version.cue`); drops the now-unused elevated permissions (`packages: write`, `pull-requests: write`, `security-events: write`). --------- Co-authored-by: verified-commit[bot] <180343340+verified-commit[bot]@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3.8 KiB
Why
PR #339 ("ci: test windows image") has been open for ~12 months and still cannot turn green: windows.Dockerfile copies ./test/Windows.Tests.ps1 from a path that no longer exists (the file was moved to ./test/windows/ when the dockertest skeleton was added), and the Pester pattern for the VC.CMake.Project package has a typo (,versiona*) that would never match a real Visual Studio package directory. As a result the flutter-windows image has zero automated verification on every PR, while the flutter-android image runs container-structure-test and Docker Scout. This change is what's needed to actually land PR #339 and start producing a meaningful CI signal for the Windows image.
What Changes
- Fix
windows.DockerfileCOPYto source./test/windows/Windows.Tests.ps1(the real path). - Fix
test/windows/Windows.Tests.ps1BeLikeExactlypattern:,versiona*→,version=*to match the pattern actually written byvs_BuildTools.exe. - Add a Flutter version assertion that reads
config/version.jsonand assertsflutter --versioninside the container reports the sameflutter.version. This converts the test job from "image builds" to "image is the version we shipped." - Add a
flutter doctorsmoke assertion that fails the test when doctor reports any error (warnings on platform-specific tooling are tolerated). - Set a default
CMDin theteststage ofwindows.Dockerfilesodocker compose run windows-test(and equivalent local invocations) actually runs Pester instead of exiting silently. The CI workflow continues to invokeRunPester.ps1explicitly. - Remove the dead
test/windows/main.go,test/windows/main_test.go,test/windows/go.mod,test/windows/go.sum. Theory/dockertestharness was scaffolded in commitdf7666ebut never wired into CI, never builds the image it tries to run, and has its only useful assertion (the PesterExec) commented out. Pester running inside the container is the chosen verification mechanism. - Either delete or wire up the two commented-out blocks in
.github/workflows/windows.yml: thedocker/scout-actionstep and thevalidate_versionjob (which still references the deletedconfig/version.cue). This change deletes them because Scout/version-validation parity is out of scope; the follow-up changes (p2,p3) reintroduce them deliberately. - Set a non-empty body on PR #339 describing the test surface.
Capabilities
New Capabilities
windows-image-testing: defines what.github/workflows/windows.ymlandtest/windows/Windows.Tests.ps1are required to verify about theflutter-windowsDocker image on every pull request — Flutter version match, doctor health, presence of pinned Visual Studio components, and analytics-disabled telemetry config.
Modified Capabilities
None. The Windows image previously had no spec; the existing flutter-version-update and actions-version-tracking specs are not touched.
Impact
- Affected files:
windows.Dockerfile,test/windows/Windows.Tests.ps1,.github/workflows/windows.yml,script/RunPester.ps1(no change expected, but inputs change),docker-compose.yml(windows-test service still works). - Removed files:
test/windows/main.go,test/windows/main_test.go,test/windows/go.mod,test/windows/go.sum. - No release/publish behavior changes —
release.ymlis untouched. Distribution of the Windows image is the explicit subject ofp2-release-windows-image. - No version manifest changes —
config/schema.cueis untouched. Tracking VS BuildTools / Win11 SDK / CMake versions inconfig/version.jsonis the explicit subject ofp3-windows-version-schema. - Risk: the only CI signal here is a slow (
windows-2025, multi-hour) Windows container build. This change does not address build duration; a green check is the success criterion, not a fast green check.