Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 91 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ build:
-e CI_PROJECT_NAME `
-e CI_JOB_NAME_SLUG `
$env:WINDOWS_BUILD_IMAGE `
Info Clean BuildTracerHome BuildProfilerHome BuildNativeLoader BuildDdDotnet PublishFleetInstaller PackageTracerHome ZipSymbols SignDlls SignMsi DownloadWinSsiTelemetryForwarder
Info Clean BuildTracerHome BuildProfilerHome BuildNativeLoader BuildDdDotnet `
--NugetPackageDirectory c:\mnt\packages
$buildExitCode = $LASTEXITCODE

Wait-Job $statsJob -Timeout 15 | Out-Null
Expand All @@ -198,15 +199,104 @@ build:
if ($buildExitCode -ne 0) {
throw "Docker build container exited with code $buildExitCode"
}
- |
# Run the native tests against the outputs from the build above, matching the
# Azure pipeline's build-then-test flow in a shared working directory.
docker run --rm -m 20480M `
-v "$(Get-Location):c:\mnt" `
-e CI_JOB_ID=${CI_JOB_ID} `
-e ENABLE_MULTIPROCESSOR_COMPILATION=true `
-e CL_MPCount=16 `
-e WINDOWS_BUILDER=true `
-e AWS_NETWORKING=true `
-e NUGET_CERT_REVOCATION_MODE=offline `
-e DD_LOGGER_DD_API_KEY `
-e CI_IDENTITIES_GITLAB_ID_TOKEN `
-e CI_PROJECT_NAME `
-e CI_JOB_NAME_SLUG `
$env:WINDOWS_BUILD_IMAGE `
CompileTracerNativeTests RunTracerNativeTests `
CompileNativeLoaderNativeTests RunNativeLoaderNativeTests `
CompileProfilerNativeTests RunProfilerNativeTests `
--NugetPackageDirectory c:\mnt\packages
if ($LASTEXITCODE -ne 0) {
throw "Native test container exited with code $LASTEXITCODE"
}
- |
# Start the managed Windows unit-test migration with one modern .NET target
# and .NET Framework. Preserve each framework's results before the next NUKE
# invocation cleans the shared results and logs directories.
$managedTestFrameworks = @("net8.0", "net48")
foreach ($framework in $managedTestFrameworks) {
Write-Output "Building and running managed unit tests for $framework"
docker run --rm -m 20480M `
-v "$(Get-Location):c:\mnt" `
-e CI_JOB_ID=${CI_JOB_ID} `
-e WINDOWS_BUILDER=true `
-e AWS_NETWORKING=true `
-e NUGET_CERT_REVOCATION_MODE=offline `
-e DD_LOGGER_DD_API_KEY `
-e CI_IDENTITIES_GITLAB_ID_TOKEN `
-e CI_PROJECT_NAME `
-e CI_JOB_NAME_SLUG `
$env:WINDOWS_BUILD_IMAGE `
BuildManagedUnitTests RunManagedUnitTests `
--framework $framework `
--NugetPackageDirectory c:\mnt\packages
$managedTestExitCode = $LASTEXITCODE

$frameworkArtifacts = Join-Path "artifacts/build_data/managed-unit-tests" $framework
New-Item -ItemType Directory -Path $frameworkArtifacts -Force | Out-Null
foreach ($directory in @("results", "logs")) {
$source = Join-Path "artifacts/build_data" $directory
if (Test-Path $source) {
Copy-Item -Path $source -Destination $frameworkArtifacts -Recurse -Force
}
}

if ($managedTestExitCode -ne 0) {
throw "Managed unit tests for $framework exited with code $managedTestExitCode"
}
}
- |
# Package and sign only after the native tests pass so the release outputs are
# produced from the successfully tested build state.
docker run --rm -m 20480M `
-v "$(Get-Location):c:\mnt" `
-e CI_JOB_ID=${CI_JOB_ID} `
-e ENABLE_MULTIPROCESSOR_COMPILATION=true `
-e CL_MPCount=16 `
-e WINDOWS_BUILDER=true `
-e AWS_NETWORKING=true `
-e SIGN_WINDOWS=true `
-e NUGET_CERT_REVOCATION_MODE=offline `
-e CI_IDENTITIES_GITLAB_ID_TOKEN `
-e CI_PROJECT_NAME `
-e CI_JOB_NAME_SLUG `
$env:WINDOWS_BUILD_IMAGE `
PublishFleetInstaller PackageTracerHome ZipSymbols SignDlls SignMsi DownloadWinSsiTelemetryForwarder `
--NugetPackageDirectory c:\mnt\packages
if ($LASTEXITCODE -ne 0) {
throw "Docker packaging container exited with code $LASTEXITCODE"
}
- mkdir artifacts-out
- xcopy /e/s build-out\${CI_JOB_ID}\*.* artifacts-out
- remove-item -recurse -force build-out\${CI_JOB_ID}
- get-childitem build-out
- get-childitem artifacts-out
artifacts:
when: always
expire_in: 2 weeks
paths:
- artifacts-out
- artifacts/build_data/tests
- artifacts/build_data/managed-unit-tests
- artifacts/build_data/dumps
- profiler/build_data/tests
reports:
junit:
- artifacts/build_data/tests/*.xml
- profiler/build_data/tests/*.xml
id_tokens:
CI_IDENTITIES_GITLAB_ID_TOKEN:
aud: ci-identities
Expand Down
2 changes: 1 addition & 1 deletion tracer/build/_build/Build.Shared.Steps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ partial class Build
foreach (var architecture in ArchitecturesForPlatformForTracer)
{
var workingDirectory = GetNativeOutputDirectory(NativeLoaderTestsProject.Name) / BuildConfiguration / architecture.ToString();
var testsResultFile = BuildDataDirectory / "tests" / $"{FileNames.NativeLoaderTests}.Results.{BuildConfiguration}.{TargetPlatform}.xml";
var testsResultFile = BuildDataDirectory / "tests" / $"{FileNames.NativeLoaderTests}.Results.{BuildConfiguration}.{architecture}.xml";
var exePath = workingDirectory / $"{FileNames.NativeLoaderTests}.exe";
var testExe = ToolResolver.GetLocalTool(exePath);
testExe($"--gtest_output=xml:{testsResultFile}", workingDirectory: workingDirectory);
Expand Down
Loading