Skip to content

ci: run full test suite on Windows - #3866

Open
Sayt-0 wants to merge 16 commits into
mainfrom
ci/windows-all-tests
Open

ci: run full test suite on Windows#3866
Sayt-0 wants to merge 16 commits into
mainfrom
ci/windows-all-tests

Conversation

@Sayt-0

@Sayt-0 Sayt-0 commented Jul 29, 2026

Copy link
Copy Markdown
Member

Summary

  • run the full Go test suite natively on windows-latest as a blocking CI gate
  • execute the plan-storage packages first because their file-locking and path semantics require native Windows coverage
  • run all remaining packages afterwards without duplicating the plan tests
  • fix the Windows-specific product and test issues exposed by the new gate

Why this is useful

The project publishes Windows binaries and contains Windows-specific implementations for file locking, atomic writes, paths, sockets, processes, and executable handling. Cross-compilation proves that these implementations compile, but only a native Windows runner exercises their real filesystem and process semantics.

The initial observational run exposed failures in 36 packages. The fixes in this PR address those failures rather than hiding them behind continue-on-error, including:

  • Windows executable installation and .exe resolution
  • standard LSP file:// URI handling
  • portable HOME, path, shell, PowerShell, file-mode, and symlink behavior
  • deterministic resource cleanup for SQLite databases, listeners, and os.Root handles
  • Windows drag-and-drop path parsing and cassette path normalization
  • Windows-safe content-store filenames

CI design

Area Behavior
Plan packages Blocking native Windows tests, executed first
Remaining Go packages Blocking native Windows tests
Plan test duplication None; excluded from the remaining package list
Windows runner setup One checkout and one Go setup
Binary and Docker E2E Not included in this change
Timeout 30 minutes

Validation

Check Result
Native Windows full suite pass, 8m56s
Linux build and tests pass, 8m02s
Lint and workflow lint pass
Linux amd64 image build pass
Linux arm64 image build pass
License check pass

Latest fully green run: https://github.com/docker/docker-agent/actions/runs/30551413628

The Windows runner reports GOOS=windows, GOARCH=amd64, CGO_ENABLED=1, and CC=gcc.

@Sayt-0
Sayt-0 requested a review from a team as a code owner July 29, 2026 14:57
@aheritier aheritier added area/ci CI/CD workflows and pipeline kind/chore Maintenance, deps, CI, tooling (maps to chore: commit prefix) labels Jul 29, 2026
@Sayt-0
Sayt-0 marked this pull request as draft July 29, 2026 15:02
@Sayt-0
Sayt-0 marked this pull request as ready for review July 30, 2026 15:32
@Sayt-0
Sayt-0 enabled auto-merge July 30, 2026 15:35
Comment thread .github/workflows/ci.yml
Comment on lines 95 to +120
- name: Run plan tests
run: go test ./pkg/tools/builtin/plan/ ./pkg/plans/
run: go test -count=1 ./pkg/tools/builtin/plan/ ./pkg/plans/

# Run everything except the plan packages covered above. Splatting the
# package list avoids command-line length limits and quoting ambiguity.
- name: Run remaining tests
env:
# Mirror .env.test: blank out provider credentials on the runner.
DOCKER_AGENT_MODELS_GATEWAY: ""
OPENAI_API_KEY: ""
ANTHROPIC_API_KEY: ""
GOOGLE_API_KEY: ""
GOOGLE_GENAI_USE_VERTEXAI: ""
MISTRAL_API_KEY: ""
OPENROUTER_API_KEY: ""
shell: pwsh
run: |
$exclude = @(
'github.com/docker/docker-agent/pkg/tools/builtin/plan'
'github.com/docker/docker-agent/pkg/plans'
)
$listed = @(go list ./...)
if ($LASTEXITCODE -ne 0) { throw "go list failed with exit code $LASTEXITCODE" }
$packages = @($listed | Where-Object { $_ -notin $exclude -and -not [string]::IsNullOrWhiteSpace($_) })
if ($packages.Count -eq 0) { throw 'go list returned no packages to test' }
go test -count=1 @packages

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's run everything in one step @Sayt-0

Comment thread .github/workflows/ci.yml
# Native Windows tests. Plan storage relies on OS-specific file locking and
# path semantics, so its tests run first as a dedicated gate; the remaining
# suite runs afterwards and is blocking as well.
windows-tests:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using the same pattern than linux by installing and using gotask ?

Comment thread pkg/content/store.go
homeDir, err := os.UserHomeDir()
if err != nil {
return nil, fmt.Errorf("getting home directory: %w", err)
homeDir := paths.GetHomeDir()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was expecting fixes in tests but not in app code.

Comment thread pkg/paths/paths.go
})
}

func userHomeDir() (string, error) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, os.UserHomeDir() should be the value to use by default ..
https://cs.opensource.google/go/go/+/refs/tags/go1.26.5:src/os/file.go;l=605
With this PR we change the user home from USERPROFILE to HOME which will create a lot of issues I think for windows users because they won't look at the default settings etc in the same place. I am not confident

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ci CI/CD workflows and pipeline kind/chore Maintenance, deps, CI, tooling (maps to chore: commit prefix)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants