aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorBevan Weiss <bevan.weiss@gmail.com>2024-06-20 23:40:03 +1000
committerBob Arnson <github@bobs.org>2024-07-04 19:25:49 -0400
commita4f09c89c7c044f606ddf6bcff587ccb693560bf (patch)
tree6ecc0745723b390e45cc53968088dcd1dadb2d5c /src/test
parentc5c226be1d271aee816b20f5ca0777ed1242a6d8 (diff)
downloadwix-a4f09c89c7c044f606ddf6bcff587ccb693560bf.tar.gz
wix-a4f09c89c7c044f606ddf6bcff587ccb693560bf.tar.bz2
wix-a4f09c89c7c044f606ddf6bcff587ccb693560bf.zip
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>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/sandbox/TestSandbox.wsb17
-rw-r--r--src/test/sandbox/setup_sandbox.bat16
-rw-r--r--src/test/sandbox/startup.bat48
3 files changed, 81 insertions, 0 deletions
diff --git a/src/test/sandbox/TestSandbox.wsb b/src/test/sandbox/TestSandbox.wsb
new file mode 100644
index 00000000..01e11e6b
--- /dev/null
+++ b/src/test/sandbox/TestSandbox.wsb
@@ -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>
diff --git a/src/test/sandbox/setup_sandbox.bat b/src/test/sandbox/setup_sandbox.bat
new file mode 100644
index 00000000..f74e7535
--- /dev/null
+++ b/src/test/sandbox/setup_sandbox.bat
@@ -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
8curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-x64.zip --output ".\AMD64\dotnet-runtime.zip"
9curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-x64.zip --output ".\AMD64\dotnet-sdk.zip"
10curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-runtime-win-arm64.zip --output ".\ARM64\dotnet-runtime.zip"
11curl -L0 https://aka.ms/dotnet/%DOTNET_VERSION%/dotnet-sdk-win-arm64.zip --output ".\ARM64\dotnet-sdk.zip"
12
13REM "%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -prerelease
14
15
16@endlocal
diff --git a/src/test/sandbox/startup.bat b/src/test/sandbox/startup.bat
new file mode 100644
index 00000000..0f1b33d8
--- /dev/null
+++ b/src/test/sandbox/startup.bat
@@ -0,0 +1,48 @@
1@setlocal
2SET DOTNET_VERSION=8.0
3SET SANDBOX_FILES=C:\sandbox
4
5pushd "%TEMP%"
6
7mkdir "%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
38SETX PATH "%PATH%;%ProgramFiles%\dotnet" /M
39SET PATH=%PATH%;%ProgramFiles%\dotnet
40dotnet nuget locals all --clear
41dotnet help
42
43
44:ERROR
45
46@popd
47cd c:\build
48start cmd