Skip to content

Commit 908be6b

Browse files
committed
[devops] Run the bgen tests on Windows.
1 parent 028c539 commit 908be6b

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Dump the environment to see what we're working with.
2+
& "$Env:SYSTEM_DEFAULTWORKINGDIRECTORY\xamarin-macios\tools\devops\automation\scripts\show_env.ps1"
3+
4+
# Set a few variables
5+
$Env:DOTNET = "$Env:BUILD_SOURCESDIRECTORY\xamarin-macios\tests\dotnet\Windows\bin\dotnet\dotnet.exe"
6+
$Env:DOTNET_DIR = "$Env:BUILD_SOURCESDIRECTORY\xamarin-macios\tests\dotnet\Windows\bin\dotnet\"
7+
$Env:TESTS_USE_SYSTEM = "1"
8+
9+
# Compute the <platform>_NUGET_VERSION_NO_METADATA variables and set them in the environment
10+
$configurationDotNetPlatforms = $Env:CONFIGURATION_DOTNET_PLATFORMS
11+
$dotnetPlatforms = $configurationDotNetPlatforms.Split(' ', [StringSplitOptions]::RemoveEmptyEntries)
12+
foreach ($platform in $dotnetPlatforms) {
13+
$manifestPath = "$Env:BUILD_SOURCESDIRECTORY\artifacts\AssetManifests\$($platform)\AssetManifest.xml"
14+
$productVersion = Select-Xml -Path "$manifestPath" -XPath "/Build/Package[@Id='Microsoft.$($platform).Sdk']/@Version" | ForEach-Object { $_.Node.Value }
15+
$variableName = "$($platform.ToUpper())_NUGET_VERSION_NO_METADATA"
16+
[Environment]::SetEnvironmentVariable($variableName, $productVersion)
17+
Write-Host "$variableName = $productVersion"
18+
}
19+
20+
# Tell the tests how they can execute the C# compiler
21+
$csc = Get-ChildItem "$Env:BUILD_SOURCESDIRECTORY\xamarin-macios\tests\dotnet\Windows\bin\dotnet" -Include csc.dll -Recurse -File | %{$_.FullName}
22+
$Env:DOTNET_CSC_COMMAND = "$Env:DOTNET exec $csc".Replace("\", "/")
23+
Write-Host "DOTNET_CSC_COMMAND: $Env:DOTNET_CSC_COMMAND"
24+
25+
# Tell the tests where the BCL is
26+
$Env:DOTNET_BCL_DIR = Get-ChildItem "$Env:BUILD_SOURCESDIRECTORY\xamarin-macios\tests\dotnet\Windows\bin\dotnet\packs\Microsoft.NETCore.App.Ref" -Include System.dll -Recurse -File | %{$_.DirectoryName}
27+
Write-Host "DOTNET_BCL_DIR: $Env:DOTNET_BCL_DIR"
28+
29+
# Finally we can run the tests
30+
& $Env:BUILD_SOURCESDIRECTORY\xamarin-macios\tests\dotnet\Windows\bin\dotnet\dotnet.exe `
31+
test `
32+
"$Env:BUILD_SOURCESDIRECTORY/xamarin-macios/tests/bgen/bgen-tests.csproj" `
33+
"--results-directory:$Env:BUILD_SOURCESDIRECTORY/xamarin-macios/jenkins-results/windows/bgen-tests/" `
34+
"--logger:console;verbosity=detailed" `
35+
"--logger:trx;LogFileName=$Env:BUILD_SOURCESDIRECTORY/xamarin-macios/jenkins-results/windows/bgen-tests/results.trx" `
36+
"--logger:html;LogFileName=$Env:BUILD_SOURCESDIRECTORY/xamarin-macios/jenkins-results/windows/bgen-tests/results.html" `
37+
"-bl:$Env:BUILD_SOURCESDIRECTORY/xamarin-macios/jenkins-results/windows/bgen-tests/results.binlog"

tools/devops/automation/templates/windows/build.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,19 @@ steps:
145145
"-bl:$(Build.SourcesDirectory)/xamarin-macios/tests/dotnet/Windows/run-dotnet-tests.binlog"
146146
displayName: 'Run .NET tests'
147147

148+
- pwsh: |
149+
Import-Module $Env:SYSTEM_DEFAULTWORKINGDIRECTORY\xamarin-macios\tools\devops\automation\scripts\MaciosCI.psd1
150+
$configFile = "$(Build.SourcesDirectory)\artifacts\build-configuration\configuration.json"
151+
$config = Import-BuildConfiguration -ConfigFile $configFile
152+
$config | Write-Host
153+
name: configuration
154+
continueOnError: true
155+
displayName: 'Parse build configuration'
156+
timeoutInMinutes: 1
157+
158+
- pwsh: $(System.DefaultWorkingDirectory)/xamarin-macios/tools/devops/automation/scripts/run-generator-tests-on-windows.ps1
159+
displayName: 'Run generator tests'
160+
148161
# Archive files for the Html Report so that the report can be easily uploaded as artifacts of the build.
149162
- task: ArchiveFiles@1
150163
displayName: 'Archive HtmlReport'

0 commit comments

Comments
 (0)