@@ -19,3 +19,129 @@ For more complex tests one can also use:
1919- custom output files: redirect output to custom file (it must start with ` out ` ), e.g. ` $CLI bundle validate > out.txt 2> out.error.txt ` .
2020
2121See [ selftest] ( ./selftest ) for a toy test.
22+
23+ ## Running acceptance tests on Windows
24+
25+ To run the acceptance tests from a terminal on Windows (eg. Git Bash from VS Code),
26+ you need to install a few prerequisites and optionally make user policy changes.
27+
28+ These steps were verified to work with a Windows 11 VM running on Parallels.
29+
30+ ### Install Chocolatey
31+
32+ Run "PowerShell" as administrator and follow the [ Chocolatey installation instructions] [ choco ] .
33+
34+ [ choco ] : https://chocolatey.org/install#individual
35+
36+ Confirm it is installed correctly:
37+ ``` pwsh
38+ PS C:\WINDOWS\system32> choco --version
39+ 2.5.1
40+ ```
41+
42+ ### Tools
43+
44+ Install the following tools:
45+ ``` pwsh
46+ choco install -y vscode
47+ choco install -y git
48+ choco install -y make
49+ choco install -y jq
50+ choco install -y python3
51+ choco install -y uv
52+ choco install -y go
53+ choco install -y nodejs
54+ ```
55+
56+ ### Shim for ` python3.exe `
57+
58+ The default Python installation only installs ` python.exe ` and not ` python3.exe ` .
59+
60+ We rely on calling ` python3 ` in acceptance tests (shebangs in scripts and elsewhere).
61+
62+ To install ` python3 ` and ` pip3 ` shims for the install, run PowerShell as administrator and execute the following:
63+ ``` pwsh
64+ # Refresh first to pick up Python 3 installed in the previous step.
65+ refreshenv
66+
67+ # Optional: python3, only if python.exe exists
68+ $python3Exists = $false
69+ try {
70+ $py = (Get-Command python.exe -ErrorAction Stop).Source
71+ $python3Exists = $true
72+ & "$env:ChocolateyInstall\tools\shimgen.exe" `
73+ --output "$env:ChocolateyInstall\bin\python3.exe" `
74+ --path $py
75+ } catch {
76+ Write-Host "python.exe not found, skipping python3 shim creation."
77+ }
78+
79+ # Optional: pip3, too, but only if pip.exe exists
80+ $pipExists = $false
81+ try {
82+ $pip = (Get-Command pip.exe -ErrorAction Stop).Source
83+ $pipExists = $true
84+ & "$env:ChocolateyInstall\tools\shimgen.exe" `
85+ --output "$env:ChocolateyInstall\bin\pip3.exe" `
86+ --path $pip
87+ } catch {
88+ Write-Host "pip.exe not found, skipping pip3 shim creation."
89+ }
90+
91+ # Refresh to pick up the shims.
92+ refreshenv
93+
94+ # Check python3 version only if python3 shim was created
95+ if ($python3Exists) {
96+ try {
97+ python3 --version
98+ } catch {
99+ Write-Host "python3 not found or not working. Please check your installation."
100+ }
101+ } else {
102+ Write-Host "python3 not available."
103+ }
104+
105+ # Check pip3 version only if pip3 shim was created
106+ if ($pipExists) {
107+ try {
108+ pip3 --version
109+ } catch {
110+ Write-Host "pip3 not found or not working. Please check your installation."
111+ }
112+ } else {
113+ Write-Host "pip3 not available."
114+ }
115+ ```
116+
117+ ### Enable symlink creation
118+
119+ You need to be able to create symlinks.
120+ If you're not an administrator user, enable this by following these steps:
121+
122+ * Press Win+R, type ` secpol.msc ` , press Enter.
123+ * Go to Local Policies → User Rights Assignment.
124+ * Find "Create symbolic links".
125+ * Add your username to the list.
126+ * Reboot.
127+
128+ ### Enable long path support (up to ~ 32,767 characters)
129+
130+ Some acceptance tests fail if this is not enabled because their paths
131+ exceed the default maximum total length of 260 characters.
132+
133+ * Press Win+R, type ` gpedit.msc ` , press Enter.
134+ * Go to Computer Configuration → Administrative Templates → System → Filesystem → Enable Win32 long paths.
135+ * Enable the setting.
136+ * Reboot.
137+
138+ ### Disable Microsoft Defender
139+
140+ The tests frequently create and remove temporary directories.
141+ Sometimes, Microsoft Defender locks a file (such as an executable) during deletion,
142+ which can cause errors and test failures.
143+
144+ * Press Win+R, type ` gpedit.msc ` , press Enter.
145+ * Go to Computer Configuration → Administrative Templates → Windows Components → Microsoft Defender Antivirus → Turn off Microsoft Defender Antivirus.
146+ * Enable the setting.
147+ * Reboot.
0 commit comments