fix(test): align TestAcceptableZipFile path check with friendlyPath output
Description
Fix TestAcceptableZipFile failing when the repository is cloned into /tmp (or any directory that shares a common ancestor with os.TempDir()).
Root cause: The test asserted that stdout contained the absolute path of each extracted file. However, readZip calls friendlyPath() which converts the absolute path to a relative path via filepath.Rel(cwd, path). When the repo lives under /tmp, t.TempDir() also lives under /tmp, so filepath.Rel succeeds and returns a relative path like ../../../../../../TestAcceptableZipFile.../file-0.txt — which does not match the absolute path the test expected.
Fix: Compute the same relative path that friendlyPath would produce and use that as the expected value in the assertion, falling back to the absolute path when filepath.Rel fails (i.e. when the paths are on different volumes).
Related Issues
Resolves #8311 (closed)
How has this been tested?
- Ran
go test ./internal/commands/job/artifact/... -v— all three tests pass. - Ran with
TMPDIR=/tmp go test ./internal/commands/job/artifact/... -run TestAcceptableZipFileto simulate the reported scenario — passes.