mirror of
https://github.com/gmeligio/flutter-docker-image.git
synced 2026-05-24 12:30:34 +00:00
792b91c445
- **`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>
4.3 KiB
4.3 KiB
1. Fix the broken Dockerfile copy and Pester typo
- 1.1 In
windows.Dockerfile, change theCOPY ./test/Windows.Tests.ps1line to source./test/windows/Windows.Tests.ps1; keep the destination.\test\Windows.Tests.ps1. - 1.2 In
test/windows/Windows.Tests.ps1, change the CMake assertion pattern from,versiona*to,version=*. Apply the same,version=*form to the Win11SDK and VCTools assertions for consistency.
2. Make the test stage self-running
- 2.1 In
windows.Dockerfile, replace the trailing# CMD Invoke-Pester ...comment in theteststage withCMD ["powershell", "-NoLogo", "-NoProfile", "-File", ".\\script\\RunPester.ps1"](or equivalent that invokesRunPester.ps1). - 2.2 Verify locally that
docker compose run --rm windows-testruns Pester and exits with the Pester exit code. (Skip if no Windows host available; rely on the CI run for confirmation.)
3. Add the Flutter version Pester test
- 3.1 In
windows.Dockerfile'steststage, addCOPY ./config/version.json .\config\version.jsonso the manifest is available at test time. - 3.2 In
test/windows/Windows.Tests.ps1, add a newDescribe "Flutter version"block with a test that:- reads
config\version.jsonviaGet-Content | ConvertFrom-Json; - extracts
flutter.version; - runs
flutter --versionand parses the first line into a semver string; - asserts the parsed version equals the manifest version, with a failure message naming both values.
- reads
4. Add the flutter doctor smoke test
- 4.1 In
test/windows/Windows.Tests.ps1, add aDescribe "Flutter doctor"block that runsflutter doctorand captures stdout. At the top ofscript/RunPester.ps1(or in aBeforeAllfor this Describe), force[Console]::OutputEncoding = [System.Text.Encoding]::UTF8so the[✓]/[!]/[✗]glyphs survive PowerShell's default OEM encoding onwindows-2025. - 4.2 Implement a parser that classifies each line by its platform header and applies the per-line rule from the
flutter doctorfailure-mode decision indesign.md:- Skip lines whose header is one of
Android,iOS,macOS,Linux,Web,Chrome(intentionally disabled viaflutter config --no-enable-*). - Fail unless
[✓]for headers that start withWindows VersionorVisual Studio(any[!]or[✗]here is a real toolchain regression — see the Flutter validator sources cited indesign.md). - Fail only on
[✗]for any other header (e.g.,Flutter,Connected device,Network resources);[!]on these is informational in a CI container. - To survive encoding edge cases, match markers by character class (e.g.,
^\[(✓|✔|!|✗|✘|x|X)\]) rather than literal codepoints, mapping✓/✔→ pass,!→ partial,✗/✘/x/X→ fail.
- Skip lines whose header is one of
- 4.3 The test passes when at least the
Windows VersionandVisual Studio - develop Windows appslines are tagged[✓]and no other non-skipped line is tagged[✗].
5. Delete the dead Go/dockertest harness
- 5.1 Delete
test/windows/main.go,test/windows/main_test.go,test/windows/go.mod,test/windows/go.sum. - 5.2 Confirm that no workflow under
.github/workflows/still references Go ordockertest(grep -r "dockertest\|go test\|go mod" .github/workflows/).
6. Clean up commented-out workflow blocks
- 6.1 In
.github/workflows/windows.yml, delete the commented-outScan with Docker Scoutstep block. - 6.2 In
.github/workflows/windows.yml, delete the commented-outPush to Docker Hubstep block (release path is the subject ofp2-release-windows-image). - 6.3 In
.github/workflows/windows.yml, delete the commented-outvalidate_versionjob block (it references the deletedconfig/version.cue).
7. Verify and ship
- 7.1 Push the branch; wait for the
test_windowsjob in.github/workflows/windows.ymlto complete onwindows-2025. - 7.2 Confirm the job exits 0 with all Pester tests reporting
Passed. - 7.3 Update PR #339 (or open a replacement) with a non-empty body referencing this proposal: link to
openspec/changes/p1-fix-windows-ci-tests/proposal.mdand list the assertions now enforced. - 7.4 Merge.
8. Archive
- 8.1 After merge, archive this change by running the
openspec-archive-changeflow so thewindows-image-testingspec is promoted toopenspec/specs/windows-image-testing/spec.md.