chore(windows): build and pass the test suite natively on Windows (#1501) #1503
No reviewers
Labels
No labels
bump
major
bump
minor
bump
patch
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
loop/paused
mirror-drift
priority
critical
priority
high
priority
low
priority
medium
size
L
size
M
size
S
size
XL
status
blocked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
frankenbit/release-toolkit!1503
Loading…
Reference in a new issue
No description provided.
Delete branch "claude/1501-windows-native-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #1501
Head
7163298on base55a12b9(livemainat push time).Why
#1485 gave Windows contributors an LF checkout, but a native
go test ./...still fails there.cmd/rtandinternal/releasedo not compile (syscall.Flock).rt register-checknever matches an allow-list directory against a Windows path. Several tests assume POSIX permissions, an executable bit, glibc regex, or Unix path forms. Release binaries stay linux/amd64, and Linux behaviour does not change.What's in the PR
Cut lock (
internal/release): real fixlock.gokeeps the shared lifecycle (acquireLock/release). The OS primitive moves tolock_flock.go(//go:build !windows, flock as before) andlock_windows.go(LockFileEx,LOCKFILE_EXCLUSIVE_LOCK|LOCKFILE_FAIL_IMMEDIATELY, whole-file range).ERROR_LOCK_VIOLATIONmaps toErrConcurrentCut.!windowsrather thanunix, so the flock file builds for exactly the targets the untaggedlock.gobuilt for.LockFileExis resolved from kernel32 through stdlibsyscall, without addinggolang.org/x/sys. That is right while Windows is contributor-only.x/sys/windowsbecomes right if Windows release runners land (Phase 8) or more Win32 calls accumulate.register.ScanTree: real fixscanOneFilematches allow-list and self-exclusion entries, and reportsFileHit.File, infilepath.ToSlashform; it still reads through the native path.ToSlashis the identity on Linux, so register-check output there is byte-identical.Windows skips, in the existing
t.Skipreason style (the tests still run on Linux)TestDiscoverUnreadableIsUngradeable, andTestWritePostCutManifestCustomTagFormat/config_is_UNREADABLE_by_mode_is_could_not_grade. On Windows the latter was green for the wrong reason (see #1501).TestRunPostBumpHooks_theHookDoesNotReceiveTheGitCredential: Windows has no executable bit and cannot exec#!/bin/sh.TestRepinFile_PreservesModeAndSkipsNoMatch: only the mode half is ungraded on Windows (t.Log); the unmatched-file half still runs.TestHeaderEmDashLocaleAndByteClassMutation: the live-pattern subtests run on Windows; only the mutant half skips, because MSYS regex rejects[-—]underC.utf8too.cmd/rttest-side fixes, not skipsTestChangelogBodyCheckBadThresholdbuildsrt.exeon Windows.TestFragmentCheckSummaryWordWarnExecutesandTestFragmentCheckLengthWarnCountsRunesnow hand the gate a relative dir via a newrelFragDir, because aC:\path correctly takes the safe-char stderr fallback. The expected path uses/, as the gate builds it.TestPrepStagesTheRegeneratedTwinIntoTheIndexusespath.Joinfor git index keys.TestPushManifestAuthedRejectsSecondPush: the deadline goes from 2s to 30s. The retry has no backoff, and the"xx"attempt counter stays as the discriminating assertion. Under load, the 2s deadline cancelled attempt 2 before its hook ran, and the error text was the same.Fragment:
changelog.d/1501-windows-native-tests.internal.md(patch lane; nothing a consumer can observe).Acceptance criteria (#1501)
internal/releaseandcmd/rtbuild on Windows; the Windows backend returnsErrConcurrentCutin-process and cross-process, and frees the lock when the holder is killed.TestNewCutter_concurrentCutis green on Windows and goes red withtryLockFileneutered. A throwaway cross-process probe (not committed) showed: the second process getsErrConcurrentCut, the lock is free immediately after the holder is killed, and a doublereleaseis a no-op.ScanTreematches and reports in/form, and Linux output is unchanged.TestScanTreeis red withoutToSlashand green with it.-v: SKIP on Windows, PASS on Linux (non-root) for each.cmd/rtpath and.exeassumptions are fixed in the tests, not skipped.go test ./...passes on an LF checkout, andgolang:1.25stays green as non-root (see Test plan).Test plan
core.autocrlf=trueclone of55a12b9checked out at7163298,go test -count=1 ./...: 29/29 ok.golang:1.25, same commit, as a non-root user so the existing root skips do not fire: 29/29 ok.go vet ./...for windows, linux and darwin;gofmt -l(Go 1.25) clean;FRAGMENT_CHECK_COVERAGE=content rt fragment-check changelog.dPASS.go test ./....Review coordination
HOLDin the PR thread before requesting or starting anapproval read if more commits or a PR-body correction is still expected.
HOLDbefore approving. AREQUEST_CHANGESasks the author to fix the PR; it does not freeze theauthor from pushing.
rt review-submit-check --owner OWNER --repo REPO --pr N --reviewed-head SHAwith the full 40-character server head that was read.
rc=0means only thatthe head still matches;
rc=1requires a fresh read, andrc=2means thecheck could not grade. This does not check approval eligibility or review
rows, and it does not submit the review. Omit
commit_idwhen submitting,name the exact reviewed SHA in the review body, and read the returned row
back.
a fresh read; the head and a human rejection do not move or clear by
themselves.
What this PR does NOT do
0o000arm to assert the could-not-read message (out of scope in #1501; not measured on Linux).ScanTreefix. On Linux a backslash is a filename byte andToSlashis the identity, so only a Windows run can catch a regression there.cmd/rt/mirror_drift_check_test.go. Go 1.27's gofmt rewrites its indentation and Go 1.25's does not; this PR does not touch the file.🤖 Generated with Claude Code
go test ./...still fails on an LF checkout —cmd/rtdoes not build, and POSIX-only tests run unguarded #1501Superseded by #1505, which landed as
96d2646and covers this PR's scope and more (committed cross-process and killed-holder lock tests, graded0o000arms on Windows, a by-namepost_bump_hooksrefusal). #1501 is ticked against that landing. Shutting this unmerged and deletingclaude/1501-windows-native-tests.Pull request closed