Skip to content

docs(test): say -target takes only the architecture the tests run for - #716

Merged
houko merged 3 commits into
mainfrom
docs/test-target-arch
Nov 18, 2026
Merged

houko merged 3 commits into
mainfrom
docs/test-target-arch

Conversation

@houko

@houko houko commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

#593 (merged) added checkTestTargetArch (cmd/nsgo/testtarget.go): nsgo test -target now accepts an arch-qualified name only when it names the architecture the target's tests run for here (this machine's for a desktop OS, arm64 for Android) and refuses the other with the spelling to use. Four places still said any arch name simply means its OS, which was the follow-up raised in the #593 review:

  • docs/public/en/building.md and its mirror docs/public/zh/building.md
  • skills/nsgo/references/testing.md
  • the -target flag help in cmd/nsgo/main.go

It also takes the review's optional point: the architecture check ran before the host check, so on Linux -target windows_arm64 answered "the windows tests run for x64 on this machine; use -target windows", and following that only gave "the windows target runs on Windows". A desktop target whose OS is not this machine's now skips the architecture check, so the host check says where it runs, as -target macos_x64 on an x64 Linux machine already did. TestCheckTestTarget now picks this machine's desktop target and another OS's, and fails without the change.

Verification

  • go build ./..., go tool nsgo check -target all (Linux; Apple targets skipped there), GOOS=windows|darwin|linux go vet ./cmd/nsgo
  • go tool nsgo test ./cmd/nsgo on Linux x64: 309 passed, 0 failed, 14 skipped; TestCheckTestTarget also on macOS arm64
  • go tool nsgo test -run 'Layer|Skills|Doc' .: 37 passed, 0 failed
  • CLI probes in examples/appclip: on Linux x64, windows_arm64 and macos_arm64 report the host they run on, linux_arm64 and android_x64 are refused with the name to use, linux_x64 runs; on macOS arm64, windows_arm64 and linux_x64 report their host, macos_x64 and android_x64 are refused with the name to use
  • Not run on a Windows host (no Go there); the Windows branch is the same runtime.GOOS comparison

Screenshots

None.

@github-actions github-actions Bot added size/XS documentation Improvements or additions to documentation cli labels Nov 18, 2026
Since #593 added checkTestTargetArch, nsgo test -target accepts an arch-qualified name only for the architecture the target runs on here (this machine's for desktops, arm64 for Android) and refuses the other, but the building guide, its zh mirror, the skill and the -target help still said any arch name simply means its OS.
checkTestTargetArch ran before the host check, so on Linux -target windows_arm64 answered "the windows tests run for x64 on this machine; use -target windows", and following that only gave "the windows target runs on Windows". A desktop target whose OS is not this machine's now skips the architecture check, so the host check says where it runs, as -target macos_x64 on an x64 Linux machine already did.
@houko
houko force-pushed the docs/test-target-arch branch from f1df001 to 689f0c8 Compare November 18, 2026 21:57
@github-actions github-actions Bot added size/S and removed size/XS labels Nov 18, 2026
@houko

houko commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Reviewed. Head 2151ea4, on current main (3bb9aec).

  • Diff: the four doc places (en/zh building.md, skills testing.md, the -target help) match checkTestTargetArch and buildTargetRunner. desktopTargetElsewhere only skips the arch check for a desktop target whose OS is not this machine's, so buildTargetRunner reports where it runs; same-OS desktop targets and Android are still refused with the name to use. CHANGELOG.md untouched, no unrelated changes.
  • With the desktopTargetElsewhere call removed, TestCheckTestTarget fails on Linux x64 (windows_arm64 gets "use -target windows"); with it, it passes on Linux x64 and macOS arm64.
  • Linux x64: go build ./..., go vet ./cmd/nsgo for linux, windows, darwin and android/arm64, a windows build of cmd/nsgo, go tool nsgo test ./cmd/nsgo (309 passed, 0 failed, 14 skipped), go tool nsgo test -run 'Layer|Skills|Doc' . (37 passed).
  • CLI in examples/appclip on Linux x64: windows_arm64, windows_x64 and macos_arm64 report the host they run on; linux_arm64 and android_x64 are refused with the name to use; linux_x64 runs (1 passed).
  • CLI on macOS arm64: windows_arm64, linux_x64 and linux_arm64 report the host they run on; macos_x64 and android_x64 are refused with the name to use; -target macos_arm64 runs the real macOS target (1 passed).
  • Not run on a Windows host; the Windows branch is the same runtime.GOOS comparison.
  • I added one commit that puts the TestCheckTestTarget comment on one line. CI is green on the new head, including the macOS jobs.

@houko
houko merged commit 422627e into main Nov 18, 2026
20 checks passed
@houko
houko deleted the docs/test-target-arch branch November 18, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli documentation Improvements or additions to documentation size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant