Skip to content

Commit 446920e

Browse files
samchonclaude
andcommitted
test: normalize the cross-volume temp-base expectation like the helper
CI Windows runners hand out an 8.3 short-name TEMP (RUNNER~1), so the helper's EvalSymlinks-normalized result never compared equal to a raw Join of the fixture root even though both name the same directory. Normalize the expectation the same way. Refs #308. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 4d53a59 commit 446920e

3 files changed

Lines changed: 30 additions & 9 deletions

File tree

packages/banner/test/config_loader_temp_base_stays_on_config_volume_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@ func TestConfigLoaderTempBaseStaysOnConfigVolume(t *testing.T) {
5151
return
5252
}
5353
base := bannerLoaderTempBase(config, fake)
54-
expected := filepath.Join(root, "node_modules", ".cache")
55-
if base != expected {
56-
t.Fatalf("cross-volume base mismatch: %q != %q", base, expected)
54+
// Normalize the expectation the same way the helper normalizes its result:
55+
// EvalSymlinks also expands 8.3 short names (CI runners hand out a
56+
// RUNNER~1-style TEMP), so a raw Join of the fixture root won't compare
57+
// equal even though both name the same directory.
58+
crossWant, crossErr := filepath.EvalSymlinks(filepath.Join(root, "node_modules", ".cache"))
59+
if crossErr != nil {
60+
t.Fatal(crossErr)
61+
}
62+
if base != crossWant {
63+
t.Fatalf("cross-volume base mismatch: %q != %q", base, crossWant)
5764
}
5865
if stat, err := os.Stat(base); err != nil || !stat.IsDir() {
5966
t.Fatalf("cross-volume base was not created: %v", err)

packages/lint/test/config/loader_temp_base_stays_on_config_volume_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@ func TestLoaderTempBaseStaysOnConfigVolume(t *testing.T) {
5151
return
5252
}
5353
base := loaderTempBase(config, fake)
54-
expected := filepath.Join(root, "node_modules", ".cache")
55-
if base != expected {
56-
t.Fatalf("cross-volume base mismatch: %q != %q", base, expected)
54+
// Normalize the expectation the same way the helper normalizes its result:
55+
// EvalSymlinks also expands 8.3 short names (CI runners hand out a
56+
// RUNNER~1-style TEMP), so a raw Join of the fixture root won't compare
57+
// equal even though both name the same directory.
58+
crossWant, crossErr := filepath.EvalSymlinks(filepath.Join(root, "node_modules", ".cache"))
59+
if crossErr != nil {
60+
t.Fatal(crossErr)
61+
}
62+
if base != crossWant {
63+
t.Fatalf("cross-volume base mismatch: %q != %q", base, crossWant)
5764
}
5865
if stat, err := os.Stat(base); err != nil || !stat.IsDir() {
5966
t.Fatalf("cross-volume base was not created: %v", err)

packages/strip/test/config_loader_temp_base_stays_on_config_volume_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@ func TestConfigLoaderTempBaseStaysOnConfigVolume(t *testing.T) {
5151
return
5252
}
5353
base := stripLoaderTempBase(config, fake)
54-
expected := filepath.Join(root, "node_modules", ".cache")
55-
if base != expected {
56-
t.Fatalf("cross-volume base mismatch: %q != %q", base, expected)
54+
// Normalize the expectation the same way the helper normalizes its result:
55+
// EvalSymlinks also expands 8.3 short names (CI runners hand out a
56+
// RUNNER~1-style TEMP), so a raw Join of the fixture root won't compare
57+
// equal even though both name the same directory.
58+
crossWant, crossErr := filepath.EvalSymlinks(filepath.Join(root, "node_modules", ".cache"))
59+
if crossErr != nil {
60+
t.Fatal(crossErr)
61+
}
62+
if base != crossWant {
63+
t.Fatalf("cross-volume base mismatch: %q != %q", base, crossWant)
5764
}
5865
if stat, err := os.Stat(base); err != nil || !stat.IsDir() {
5966
t.Fatalf("cross-volume base was not created: %v", err)

0 commit comments

Comments
 (0)