Upload test results and fail the build if any are missing. Always zip up the logs from %TEMP%.
Upload test results and fail the build if any are missing. Always zip up the logs from %TEMP%.
Sean Hall committed
Dec 31, 2021 at 20:24 UTC
ec89ea96ae7f42b227c0fb5f61cd21a19ef2e8de
12 files changed
+72
-32
.github/workflows/build.yml
+4
@@ -44,6 +44,10 @@ jobs:
44
name: artifacts
45
path: build/artifacts/
46
47
+ - name: Create Zips
48
+ shell: cmd
49
+ run: ./src/create_zips.cmd
50
+
51
- name: Save logs
52
uses: actions/upload-artifact@v2
53
if: always()
appveyor.yml
+14
-1
@@ -15,10 +15,24 @@ environment:
15
DOTNET_CLI_TELEMETRY_OPTOUT: 1
16
NUGET_XMLDOC_MODE: skip
17
WixSkipVsDevCmd: 1
18
+ RuntimeTestsEnabled: true
19
+
20
+install:
21
+ - reg add HKLM\Software\Policies\Microsoft\Windows\Installer /t REG_SZ /v Logging /d voicewarmupx /f
22
+ - reg add HKLM\Software\WOW6432Node\Policies\Microsoft\Windows\Installer /t REG_SZ /v Logging /d voicewarmupx /f
23
24
build_script:
25
- src\build_official.cmd
26
27
+after_build:
28
+ - 7z a "build\testresults.zip" @src\testresultfilelist.txt
29
+
30
+on_finish:
31
+ - ps: 7z a ('temp_logs_' + (Get-Date).tostring("yyyyMMddHHmmss") + '.zip') $env:TEMP\*.log $env:TEMP\..\*.log
32
+ - ps: 7z a ('build_logs_' + (Get-Date).tostring("yyyyMMddHHmmss") + '.zip') build\logs\ build\logs\TestResults\
33
+ - ps: Push-AppveyorArtifact temp_logs_*.zip
34
+ - ps: Push-AppveyorArtifact build_logs_*.zip
35
+
36
test: off
37
38
pull_requests:
@@ -46,7 +60,6 @@ for:
60
- master
61
62
environment:
49
- RuntimeTestsEnabled: true
63
SigningUser:
64
secure: s+b2kuhi/AlE8ZYFsNVHFLfgJOwi0fIKMCOP+xL++8U=
65
SigningSecret:
src/api/api.cmd
+6
-5
@@ -2,6 +2,7 @@
2
@pushd %~dp0
3
4
@set _C=Debug
5
+@set _L=%~dp0..\..\build\logs
6
:parse_args
7
@if /i "%1"=="release" set _C=Release
8
@if not "%1"=="" shift & goto parse_args
@@ -12,13 +13,13 @@
13
:: build
14
:: pack
15
15
-msbuild api_t.proj -p:Configuration=%_C% -nologo -m -warnaserror -bl:..\..\build\logs\api_build.binlog || exit /b
16
+msbuild api_t.proj -p:Configuration=%_C% -nologo -m -warnaserror -bl:%_L%\api_build.binlog || exit /b
17
18
:: test
18
-dotnet test burn\test\WixToolsetTest.Mba.Core\WixToolsetTest.Mba.Core.csproj -c %_C% --nologo --no-build || exit /b
19
-msbuild burn\test\BalUtilUnitTest -t:Test -p:Configuration=%_C% -nologo || exit /b
20
-msbuild burn\test\BextUtilUnitTest -t:Test -p:Configuration=%_C% -nologo || exit /b
21
-dotnet test wix\api_wix.sln -c %_C% --nologo --no-build || exit /b
19
+dotnet test burn\test\WixToolsetTest.Mba.Core -c %_C% --nologo --no-build -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.Mba.Core.trx" || exit /b
20
+msbuild burn\test\BalUtilUnitTest -t:Test -p:Configuration=%_C% -nologo -p:CppCliTestResultsFile="%_L%\TestResults\BalUtilUnitTest.xunit2.xml" || exit /b
21
+msbuild burn\test\BextUtilUnitTest -t:Test -p:Configuration=%_C% -nologo -p:CppCliTestResultsFile="%_L%\TestResults\BextUtilUnitTest.xunit2.xml" || exit /b
22
+dotnet test wix\api_wix.sln -c %_C% --nologo --no-build -l "trx;LogFileName=%_L%\TestResults\api_wix.trx" || exit /b
23
24
@popd
25
@endlocal
src/build_init.cmd
+1
@@ -2,6 +2,7 @@
2
@pushd %~dp0
3
4
md ..\build\artifacts
5
+md ..\build\logs\TestResults
6
7
msbuild -Restore internal\SetBuildNumber\SetBuildNumber.proj -nologo
8
src/burn/burn.cmd
+3
-2
@@ -2,6 +2,7 @@
2
@pushd %~dp0
3
4
@set _C=Debug
5
+@set _L=%~dp0..\..\build\logs
6
:parse_args
7
@if /i "%1"=="release" set _C=Release
8
@if not "%1"=="" shift & goto parse_args
@@ -12,9 +13,9 @@
13
14
nuget restore || exit /b
15
15
-msbuild burn_t.proj -p:Configuration=%_C% -nologo -m -warnaserror -bl:..\..\build\logs\burn_build.binlog || exit /b
16
+msbuild burn_t.proj -p:Configuration=%_C% -nologo -m -warnaserror -bl:%_L%\burn_build.binlog || exit /b
17
17
-msbuild test\BurnUnitTest -t:Test -p:Configuration=%_C% -nologo || exit /b
18
+msbuild test\BurnUnitTest -t:Test -p:Configuration=%_C% -nologo -p:CppCliTestResultsFile="%_L%\TestResults\BurnUnitTest.xunit2.xml" || exit /b
19
20
@popd
21
@endlocal
src/create_zips.cmd
new
+2
@@ -0,0 +1,2 @@
1
+7z a "build\logs\test_burn_%GITHUB_RUN_ID%.zip" "%TEMP%\*.log" "%TEMP%\..\*.log" || exit /b
2
+7z a "build\testresults.zip" @src\testresultfilelist.txt || exit /b
\ No newline at end of file
src/internal/WixBuildTools.TestSupport.Native/build/WixBuildTools.TestSupport.Native.targets
+3
-1
@@ -44,6 +44,8 @@
44
45
<UsingTask AssemblyFile="$(RootPackagesFolder)xunit.runner.msbuild.2.4.1\build\net452\xunit.runner.msbuild.net452.dll" TaskName="Xunit.Runner.MSBuild.xunit" Architecture="x86" />
46
<Target Name="Test">
47
- <xunit Assemblies="$(TargetPath)" />
47
+ <!-- https://xunit.net/docs/running-tests-in-msbuild -->
48
+ <!-- https://github.com/xunit/xunit/issues/2188 -->
49
+ <xunit Assemblies="$(TargetPath)" Xml="$(CppCliTestResultsFile)" />
50
</Target>
51
</Project>
src/libs/libs.cmd
+3
-2
@@ -2,15 +2,16 @@
2
@pushd %~dp0
3
4
@set _C=Debug
5
+@set _L=%~dp0..\..\build\logs
6
:parse_args
7
@if /i "%1"=="release" set _C=Release
8
@if not "%1"=="" shift & goto parse_args
9
10
@echo Building libs %_C%
11
11
-msbuild -Restore libs_t.proj -p:Configuration=%_C% -nologo -m -warnaserror -bl:..\..\build\logs\libs_build.binlog || exit /b
12
+msbuild -Restore libs_t.proj -p:Configuration=%_C% -nologo -m -warnaserror -bl:%_L%\libs_build.binlog || exit /b
13
13
-msbuild dutil\test\DutilUnitTest -t:Test -p:Configuration=%_C% -nologo || exit /b
14
+msbuild dutil\test\DutilUnitTest -t:Test -p:Configuration=%_C% -nologo -p:CppCliTestResultsFile="%_L%\TestResults\DutilUnitTest.xunit2.xml" || exit /b
15
16
@popd
17
@endlocal
src/test/burn/test_burn.cmd
+4
-7
@@ -3,6 +3,7 @@
3
4
@set _RESULT=0
5
@set _C=Debug
6
+@set _L=%~dp0..\..\..\build\logs
7
:parse_args
8
@if /i "%1"=="release" set _C=Release
9
@if /i "%1"=="test" set RuntimeTestsEnabled=true
@@ -10,20 +11,16 @@
11
12
@echo Burn integration tests %_C%
13
13
-msbuild -t:Build -Restore -p:Configuration=%_C% -warnaserror -bl:..\..\..\build\logs\test_burn_build.binlog || exit /b
14
-msbuild -t:Build -Restore -p:Configuration=%_C% TestData\TestData.proj -bl:..\..\..\build\logs\test_burn_data_build.binlog || exit /b
14
+msbuild -t:Build -Restore -p:Configuration=%_C% -warnaserror -bl:%_L%\test_burn_build.binlog || exit /b
15
+msbuild -t:Build -Restore -p:Configuration=%_C% TestData\TestData.proj -bl:%_L%\test_burn_data_build.binlog || exit /b
16
17
@if not "%RuntimeTestsEnabled%"=="true" goto :LExit
18
19
reg add HKLM\Software\Policies\Microsoft\Windows\Installer /t REG_SZ /v Logging /d voicewarmupx /f
20
reg add HKLM\Software\WOW6432Node\Policies\Microsoft\Windows\Installer /t REG_SZ /v Logging /d voicewarmupx /f
21
21
-dotnet test -c %_C% --no-build WixToolsetTest.BurnE2E
22
-set _RESULT=%ERRORLEVEL%
23
-
24
-7z a "..\..\..\build\logs\test_burn_%GITHUB_RUN_ID%.zip" "%TEMP%\*.log" "%TEMP%\..\*.log"
22
+dotnet test -c %_C% --no-build WixToolsetTest.BurnE2E -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.BurnE2E.trx" || exit /b
23
24
:LExit
25
@popd
28
-exit /b %_RESULT%
26
@endlocal
src/test/test.cmd
+2
-1
@@ -2,6 +2,7 @@
2
@pushd %~dp0
3
4
@set _C=Debug
5
+@set _L=%~dp0..\..\build\logs
6
:parse_args
7
@if /i "%1"=="release" set _C=Release
8
@if /i "%1"=="test" set RuntimeTestsEnabled=true
@@ -12,7 +13,7 @@
13
14
@call burn\test_burn.cmd %_C% %_T% || exit /b
15
15
-dotnet test wix -c %_C% --nologo || exit /b
16
+dotnet test wix -c %_C% --nologo -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.WixE2ETests.trx" || exit /b
17
18
@popd
19
@endlocal
src/testresultfilelist.txt
new
+16
@@ -0,0 +1,16 @@
1
+build/logs/TestResults/api_wix.trx
2
+build/logs/TestResults/BalUtilUnitTest.xunit2.xml
3
+build/logs/TestResults/BextUtilUnitTest.xunit2.xml
4
+build/logs/TestResults/BurnUnitTest.xunit2.xml
5
+build/logs/TestResults/DutilUnitTest.xunit2.xml
6
+build/logs/TestResults/WixToolsetTest.BuildTasks.trx
7
+build/logs/TestResults/WixToolsetTest.BurnE2E.trx
8
+build/logs/TestResults/WixToolsetTest.Converters.trx
9
+build/logs/TestResults/WixToolsetTest.Converters.Symbolizer.trx
10
+build/logs/TestResults/WixToolsetTest.Core.Burn.trx
11
+build/logs/TestResults/WixToolsetTest.Core.Native.trx
12
+build/logs/TestResults/WixToolsetTest.CoreIntegration.trx
13
+build/logs/TestResults/WixToolsetTest.Heat.trx
14
+build/logs/TestResults/WixToolsetTest.Mba.Core.trx
15
+build/logs/TestResults/WixToolsetTest.Sdk.trx
16
+build/logs/TestResults/WixToolsetTest.WixE2ETests.trx
\ No newline at end of file
src/wix/wix.cmd
+14
-13
@@ -2,6 +2,7 @@
2
@pushd %~dp0
3
4
@set _C=Debug
5
+@set _L=%~dp0..\..\build\logs
6
:parse_args
7
@if /i "%1"=="release" set _C=Release
8
@if not "%1"=="" shift & goto parse_args
@@ -13,26 +14,26 @@
14
@echo Building wix %_C%
15
16
:: Restore
16
-msbuild -t:Restore wix.sln -p:Configuration=%_C% -nologo -m -warnaserror -bl:..\..\build\logs\wix_restore.binlog || exit /b
17
+msbuild -t:Restore wix.sln -p:Configuration=%_C% -nologo -m -warnaserror -bl:%_L%\wix_restore.binlog || exit /b
18
19
20
:: Build
20
-msbuild wixnative\wixnative_t.proj -p:Configuration=%_C% -nologo -m -warnaserror -bl:..\..\build\logs\wixnative_build.binlog || exit /b
21
+msbuild wixnative\wixnative_t.proj -p:Configuration=%_C% -nologo -m -warnaserror -bl:%_L%\wixnative_build.binlog || exit /b
22
22
-msbuild wix.sln -p:Configuration=%_C% -nologo -m -warnaserror -bl:..\..\build\logs\wix_build.binlog || exit /b
23
+msbuild wix.sln -p:Configuration=%_C% -nologo -m -warnaserror -bl:%_L%\wix_build.binlog || exit /b
24
25
26
:: Pre-Publish Test
26
-dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Converters || exit /b
27
-dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Converters.Symbolizer || exit /b
28
-dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Core.Burn || exit /b
29
-dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Core.Native || exit /b
30
-dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.CoreIntegration || exit /b
31
-dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Heat || exit /b
27
+dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Converters -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.Converters.trx" || exit /b
28
+dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Converters.Symbolizer -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.Converters.Symbolizer.trx" || exit /b
29
+dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Core.Burn -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.Core.Burn.trx" || exit /b
30
+dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Core.Native -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.Core.Native.trx" || exit /b
31
+dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.CoreIntegration -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.CoreIntegration.trx" || exit /b
32
+dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Heat -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.Heat.trx" || exit /b
33
34
35
:: Publish
35
-msbuild publish_t.proj -p:Configuration=%_C% -nologo -warnaserror -bl:..\..\build\logs\wix_publish.binlog || exit /b
36
+msbuild publish_t.proj -p:Configuration=%_C% -nologo -warnaserror -bl:%_L%\wix_publish.binlog || exit /b
37
38
robocopy %_P_OBJ%\WixToolset.Sdk\separate\net472\x86\buildtasks %_P%\WixToolset.Sdk\tools\net472\x86 %_RCO% /XF Microsoft.Build.*.dll
39
robocopy %_P_OBJ%\WixToolset.Sdk\separate\net472\x86\heat %_P%\WixToolset.Sdk\tools\net472\x86 %_RCO%
@@ -46,15 +47,15 @@ robocopy %_P_OBJ%\WixToolset.Sdk\separate\netcoreapp3.1\buildtasks %_P%\WixTools
47
robocopy %_P_OBJ%\WixToolset.Sdk\separate\netcoreapp3.1\heat %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO%
48
robocopy %_P_OBJ%\WixToolset.Sdk\separate\netcoreapp3.1\wix %_P%\WixToolset.Sdk\tools\netcoreapp3.1 %_RCO%
49
49
-msbuild -t:Publish -p:Configuration=%_C% -nologo -warnaserror -p:PublishDir=%_P%WixToolset.Sdk\ WixToolset.Sdk\WixToolset.Sdk.csproj || exit /b
50
+msbuild -t:Publish -p:Configuration=%_C% -nologo -warnaserror -p:PublishDir=%_P%WixToolset.Sdk\ WixToolset.Sdk\WixToolset.Sdk.csproj -bl:%_L%\wix_sdk_publish.binlog || exit /b
51
52
:: TODO - used by MsbuildFixture.ReportsInnerExceptionForUnexpectedExceptions test
53
:: msbuild -t:Publish -Restore -p:Configuration=%_C% -p:TargetFramework=net472 -p:RuntimeIdentifier=linux-x86 -p:PublishDir=%_P%WixToolset.Sdk\broken\net472\ wix\wix.csproj || exit /b
54
55
56
:: Test
56
-dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.BuildTasks || exit /b
57
-dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Sdk || exit /b
57
+dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.BuildTasks -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.BuildTasks.trx" || exit /b
58
+dotnet test -c %_C% --no-build --nologo test\WixToolsetTest.Sdk -l "trx;LogFileName=%_L%\TestResults\WixToolsetTest.Sdk.trx" || exit /b
59
60
:: Pack
61
msbuild pack_t.proj -p:Configuration=%_C% -nologo -m -warnaserror -bl:..\..\build\logs\wix_pack.binlog || exit /b