@joebigelow / wix-1 / commits / a4f09c89

Add Sandbox configuration to more easily perform Integration tests. Will automatically 'install' dotnet/dotnet sdk into sandbox at startup based on versions in 'src/test/sandbox/{AMD64,ARM64}' (dotnet-runtime.zip & dotnet-sdk.zip). Running ./src/test/sandbox/setup_sandbox.bat will download the required files (when run on the host). If the files aren't available, and the guest has network, it will attempt to download the files itself at startup.

Add Sandbox configuration to more easily perform Integration tests. Will automatically 'install' dotnet/dotnet sdk into sandbox at startup based on versions in 'src/test/sandbox/{AMD64,ARM64}' (dotnet-runtime.zip & dotnet-sdk.zip). Running ./src/test/sandbox/setup_sandbox.bat will download the required files (when run on the host). If the files aren't available, and the guest has network, it will attempt to download the files itself at startup. Still to be done: * menu at startup to allow easy one button selection of which particular test set to run * investigation into whether vstest.console.exe can be used to capture test execution, and possibly have the sandbox available as a test runner, so MSI tests could be run in the sandbox directly from the dev environment. Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>

Bevan Weiss committed Jun 20, 2024 at 23:40 UTC a4f09c89c7c044f606ddf6bcff587ccb693560bf
3 files changed +81
src/test/sandbox/TestSandbox.wsb new
+17
@@ -0,0 +1,17 @@
1 +<Configuration>
2 + <MappedFolders>
3 + <MappedFolder>
4 + <HostFolder>..\..\..\build</HostFolder>
5 + <SandboxFolder>C:\build</SandboxFolder>
6 + <ReadOnly>true</ReadOnly>
7 + </MappedFolder>
8 + <MappedFolder>
9 + <HostFolder>.\</HostFolder>
10 + <SandboxFolder>C:\sandbox</SandboxFolder>
11 + <ReadOnly>true</ReadOnly>
12 + </MappedFolder>
13 + </MappedFolders>
14 + <LogonCommand>
15 + <Command>C:\sandbox\startup.bat</Command>
16 + </LogonCommand>
17 +</Configuration>
src/test/sandbox/setup_sandbox.bat new
+16
@@ -0,0 +1,16 @@
1 +@setlocal
2 +@SET DOTNET_VERSION=8.0
3 +
4 +@if not exist AMD64 (mkdir AMD64)
5 +@if not exist ARM64 (mkdir ARM64)
6 +@REM if not exist VSTest (mkdir VSTest)
7 +
8 +curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-x64.zip --output ".\AMD64\dotnet-runtime.zip"
9 +curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output ".\AMD64\dotnet-sdk.zip"
10 +curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-arm64.zip --output ".\ARM64\dotnet-runtime.zip"
11 +curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output ".\ARM64\dotnet-sdk.zip"
12 +
13 +REM "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease
14 +
15 +
16 +@endlocal
src/test/sandbox/startup.bat new
+48
@@ -0,0 +1,48 @@
1 +@setlocal
2 +SET DOTNET_VERSION=8.0
3 +SET SANDBOX_FILES=C:\sandbox
4 +
5 +pushd "%TEMP%"
6 +
7 +mkdir "%ProgramFiles%\dotnet"
8 +@if exist %SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-runtime.zip (
9 + tar -oxzf "%SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-runtime.zip" -C "%ProgramFiles%\dotnet"
10 +) else (
11 + if %PROCESSOR_ARCHITECTURE%=="ARM64" (
12 + curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-arm64.zip --output dotnet-runtime.zip
13 + ) else (
14 + curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-x64.zip --output dotnet-runtime.zip
15 + )
16 + if %errorlevel$ NEQ 0 (
17 + echo No pre-provided dotnet runtime, and failed to download. Confirm networking is available.
18 + goto :ERROR
19 + )
20 + tar -oxzf dotnet-runtime.zip -C "%ProgramFiles%\dotnet"
21 + del dotnet-runtime.zip
22 +)
23 +
24 +@if exist %SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-sdk.zip (
25 + tar -oxzf "%SANDBOX_FILES%\%PROCESSOR_ARCHITECTURE%\dotnet-sdk.zip" -C "%ProgramFiles%\dotnet"
26 +) else (
27 + if %PROCESSOR_ARCHITECTURE%=="ARM64" (
28 + curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output dotnet-sdk.zip
29 + ) else (
30 + curl -L https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output dotnet-runtime.zip
31 + )
32 + if %errorlevel$ NEQ 0 echo "No pre-provided dotnet sdk, and failed to download. Confirm networking is available." goto exit
33 + tar -oxzf dotnet-sdk.zip -C "%ProgramFiles%\dotnet"
34 + del dotnet-sdk.zip
35 +)
36 +
37 +@endlocal
38 +SETX PATH "%PATH%;%ProgramFiles%\dotnet" /M
39 +SET PATH=%PATH%;%ProgramFiles%\dotnet
40 +dotnet nuget locals all --clear
41 +dotnet help
42 +
43 +
44 +:ERROR
45 +
46 +@popd
47 +cd c:\build
48 +start cmd