Repository navigation
test: resolve the temp dir symlink in the working-directory test - #622
Conversation
Codex PR Review
No blocking issues. Ship it. The test resolves symlinks before comparing the working directory with Tests were not run in the read-only environment. |
6c335e2 to
532f852
Compare
|
I always hate these issues with cross-platform differences. Out of interest, have you ever used the Dev Container to configure your local dev environment? |
TestRunExecCommandRespectsWorkingDirectory compared t.TempDir() with the output of pwd, which reports the resolved path. Where the temp dir sits behind a symlink, such as /var -> /private/var on macOS, the test failed unless TMPDIR was overridden. Resolve the temp dir with filepath.EvalSymlinks before using it. Signed-off-by: Yash B Joshi <68319416+YJ-928@users.noreply.github.com>
532f852 to
91a9018
Compare

TestRunExecCommandRespectsWorkingDirectorycomparedt.TempDir()with the output ofpwd, which reports the resolved path. Where the temp dir sits behind a symlink, which is the default on macOS (/var->/private/var), the test failed, sogo test ./pkg/...there neededTMPDIRoverridden. This came up while validating #615.The test now resolves the temp dir with
filepath.EvalSymlinksbefore using it. Test-only change; no runtime code is touched.Verification
TMPDIRpointing through a symlink (the macOS layout): the test fails onmainand passes with this change. It was the only test across./pkg/...and./cmd/...that failed that way.go test ./pkg/... ./cmd/...,go test -race ./pkg/zigflow/activities/,golangci-lint runand the pre-commit hooks all pass.