@@ -35,21 +35,13 @@ const (
3535
3636 // spacedVfoxHome is the default vfox home of a Windows account whose
3737 // name contains a space, the layout reported in
38- // https://github.com/version-fox/vfox-flutter/issues/33 .
38+ // https://github.com/version-fox/vfox-flutter/issues/33 . Every combo
39+ // runs against it: vfox handles such paths since 1.0.13
40+ // (https://github.com/version-fox/vfox/pull/712), so the latest release
41+ // and main both carry the fix.
3942 spacedVfoxHome = `C:\Users\John Doe\.vfox`
4043)
4144
42- // vfoxHome returns the $VFOX_HOME for a combo. The fix for Windows homes
43- // containing a space (https://github.com/version-fox/vfox/pull/712) is on
44- // vfox main only: released builds still fail on such paths, so only main
45- // runs against spacedVfoxHome while the others keep an unspaced slot home.
46- func vfoxHome (userProfile , slot , vfoxVersion string ) string {
47- if vfoxVersion == "main" {
48- return spacedVfoxHome
49- }
50- return userProfile + `\vfox-e2e-runs\` + slot + `\.vfox`
51- }
52-
5345// pwshQuote renders a single-quoted PowerShell string literal.
5446func pwshQuote (s string ) string {
5547 return "'" + strings .ReplaceAll (s , "'" , "''" ) + "'"
@@ -96,15 +88,14 @@ type slotBox struct {
9688}
9789
9890// setupSlotEnv isolates the combo: USERPROFILE/TEMP/TMP point under
99- // vfox-e2e-runs\<slot>, while VFOX_HOME is a sibling .vfox (spacedVfoxHome
100- // for main) , so parallel combos on one daemon never share vfox state.
101- func setupSlotEnv (ctx context.Context , t * testing.T , ctr tc.Container , slot , vfoxVersion string ) slotBox {
91+ // vfox-e2e-runs\<slot>, while VFOX_HOME is spacedVfoxHome. Every combo runs
92+ // in its own container , so that shared home never mixes vfox state.
93+ func setupSlotEnv (ctx context.Context , t * testing.T , ctr tc.Container , slot string ) slotBox {
10294 t .Helper ()
10395 userProfile := strings .TrimSpace (execOK (ctx , t , ctr , "$env:USERPROFILE" ))
10496 containerPath := strings .TrimSpace (execOK (ctx , t , ctr , "$env:PATH" ))
10597 procArch := strings .TrimSpace (execOK (ctx , t , ctr , "$env:PROCESSOR_ARCHITECTURE" ))
10698
107- home := vfoxHome (userProfile , slot , vfoxVersion )
10899 box := slotBox {slot : slot }
109100 box .slotRoot = userProfile + `\vfox-e2e-runs\` + slot
110101 box .tmp = box .slotRoot + `\tmp`
@@ -113,7 +104,7 @@ func setupSlotEnv(ctx context.Context, t *testing.T, ctr tc.Container, slot, vfo
113104 box .pluginZw = box .workDir + `\nodejs.zip`
114105 box .vars = []string {
115106 "USERPROFILE=" + box .slotRoot ,
116- "VFOX_HOME=" + home ,
107+ "VFOX_HOME=" + spacedVfoxHome ,
117108 "TEMP=" + box .tmp ,
118109 "TMP=" + box .tmp ,
119110 "PATH=" + box .workDir + ";" + containerPath ,
@@ -123,8 +114,8 @@ func setupSlotEnv(ctx context.Context, t *testing.T, ctr tc.Container, slot, vfo
123114 "New-Item -ItemType Directory -Force -Path %s | Out-Null; " +
124115 "New-Item -ItemType Directory -Force -Path %s | Out-Null; " +
125116 "New-Item -ItemType Directory -Force -Path %s | Out-Null" ,
126- pwshQuote (box .tmp ), pwshQuote (box .workDir ), pwshQuote (home )))
127- t .Logf ("PASS slot %s isolated at %s (vfox home %s, arch %s)" , slot , box .slotRoot , home , procArch )
117+ pwshQuote (box .tmp ), pwshQuote (box .workDir ), pwshQuote (spacedVfoxHome )))
118+ t .Logf ("PASS slot %s isolated at %s (vfox home %s, arch %s)" , slot , box .slotRoot , spacedVfoxHome , procArch )
128119 return box
129120}
130121
0 commit comments