test: resolve the temp dir symlink in the working-directory test by YJ-928 · Pull Request #622 · zigflow/zigflow · GitHub
Skip to content

test: resolve the temp dir symlink in the working-directory test - #622

Merged
mrsimonemms merged 1 commit into
zigflow:mainfrom
YJ-928:fix/test-tempdir-symlink
Oct 11, 2026
Merged

mrsimonemms merged 1 commit into
zigflow:mainfrom
YJ-928:fix/test-tempdir-symlink

Conversation

@YJ-928

@YJ-928 YJ-928 commented Oct 11, 2026

Copy link
Copy Markdown
Member

TestRunExecCommandRespectsWorkingDirectory compared t.TempDir() with the output of pwd, 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, so go test ./pkg/... there needed TMPDIR overridden. This came up while validating #615.

The test now resolves the temp dir with filepath.EvalSymlinks before using it. Test-only change; no runtime code is touched.

Verification

  • Reproduced on Linux with TMPDIR pointing through a symlink (the macOS layout): the test fails on main and 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 run and the pre-commit hooks all pass.

@YJ-928

YJ-928 commented Oct 11, 2026

Copy link
Copy Markdown
Member Author

@YJ-928 YJ-928 added the ai-review Trigger an AI code review for this PR label Oct 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Codex PR Review

Automated review note: Zigflow uses AI-assisted PR review tooling to help identify potential bugs, regressions and edge cases.
These comments are intended as supplemental review feedback only and may occasionally be incorrect or overly cautious.
Please treat them as additional input for discussion rather than authoritative project direction.

No blocking issues. Ship it.

The test resolves symlinks before comparing the working directory with pwd, fixing the macOS path mismatch while preserving the assertion. No production behaviour changes.

Tests were not run in the read-only environment.

@mrsimonemms
mrsimonemms force-pushed the fix/test-tempdir-symlink branch from 6c335e2 to 532f852 Compare October 11, 2026 12:47
@mrsimonemms

mrsimonemms commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

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>
@YJ-928
YJ-928 force-pushed the fix/test-tempdir-symlink branch from 532f852 to 91a9018 Compare October 11, 2026 13:35
@YJ-928

YJ-928 commented Oct 11, 2026

Copy link
Copy Markdown
Member Author

@mrsimonemms
mrsimonemms merged commit 756670b into zigflow:main Oct 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Trigger an AI code review for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants