Skip to content

Commit

Permalink
Split Windows regression tests and integration tests to save drive sp…
Browse files Browse the repository at this point in the history
…ace (#1586)

* Split the regression tests and the integration tests

These test are actually independent (currently) so we can save drive space by splitting them into two jobs, one which builds the regression tests, another which builds the samples.

That saves us ~2GB in both jobs, which should stave off drive space issues for a while

* Update build/_build/Build.cs

Co-authored-by: Zach Montoya <[email protected]>

Co-authored-by: Zach Montoya <[email protected]>
  • Loading branch information
andrewlock and zacharycmontoya authored Jul 19, 2021
1 parent c78aadb commit df84628
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 15 deletions.
31 changes: 22 additions & 9 deletions .azure-pipelines/ultimate-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ stages:
testResultsFormat: VSTest
testResultsFiles: build_data/results/**/*.trx
condition: succeededOrFailed()

- job: native
steps:
- template: steps/install-dotnet.yml
Expand Down Expand Up @@ -256,7 +256,7 @@ stages:
testResultsFormat: VSTest
testResultsFiles: build_data/results/**/*.trx
condition: succeededOrFailed()



- stage: unit_tests_linux
Expand Down Expand Up @@ -294,7 +294,7 @@ stages:
testResultsFormat: VSTest
testResultsFiles: build_data/results/**/*.trx
condition: succeededOrFailed()

- task: PublishPipelineArtifact@1
inputs:
targetPath: 'build_data/results/'
Expand Down Expand Up @@ -341,10 +341,22 @@ stages:
timeoutInMinutes: 100
strategy:
matrix:
x64:
x64_integration:
platform: x64
x86:
target: BuildAndRunWindowsIntegrationTests
requiresCosmos: true
x86_interation:
platform: x86
target: BuildAndRunWindowsIntegrationTests
requiresCosmos: true
x64_regression:
platform: x64
target: BuildAndRunWindowsRegressionTests
requiresCosmos: false
x86_regression:
platform: x86
target: BuildAndRunWindowsRegressionTests
requiresCosmos: false

steps:
- template: steps/install-dotnet-sdks.yml
Expand All @@ -357,9 +369,10 @@ stages:
Import-Module "C:/Program Files/Azure Cosmos DB Emulator/PSModules/Microsoft.Azure.CosmosDB.Emulator"
Start-CosmosDbEmulator -Timeout 300
displayName: 'Start CosmosDB Emulator'
condition: eq(variables.requiresCosmos, true)
workingDirectory: $(Pipeline.Workspace)
- script: build.cmd BuildAndRunWindowsIntegrationTests --PrintDriveSpace --code-coverage
- script: build.cmd $(target) --PrintDriveSpace --code-coverage
displayName: Run integration tests

- task: PublishTestResults@2
Expand All @@ -368,7 +381,7 @@ stages:
testResultsFormat: VSTest
testResultsFiles: build_data/results/**/*.trx
condition: succeededOrFailed()

- task: PublishPipelineArtifact@1
inputs:
targetPath: 'build_data/results/'
Expand Down Expand Up @@ -962,7 +975,7 @@ stages:

steps:
- template: steps/restore-working-directory.yml

- task: DownloadPipelineArtifact@2
inputs:
patterns: '**/coverage.cobertura.xml'
Expand All @@ -974,7 +987,7 @@ stages:
targetdir: '$(Build.SourcesDirectory)\coveragereport'
sourcedirs: '$(Build.SourcesDirectory);..'
reporttypes: 'Cobertura'

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: 'Cobertura'
Expand Down
3 changes: 2 additions & 1 deletion Datadog.Trace.proj
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<CsharpUnitTestProject Include="test\**\*.Tests.csproj"/>
<CsharpIntegrationTestProject Include="test\*.IntegrationTests\*.IntegrationTests.csproj"/>
<CsharpIntegrationTestRegressionProject Include="test\tests-applications\regression\*.IntegrationTests.csproj" />
<RazorPagesProject Include="test/test-applications/**/Samples.AspNetCoreRazorPages.csproj" />
<ExcludeExpenseItDemoProject Remove="test/test-applications/regression/**/ExpenseItDemo*.csproj" />
<ExcludeEF6DemoProject Remove="test/test-applications/regression/**/EntityFramework6x*.csproj" />
<ExcludeLegacyRedisProject Remove="test/test-applications/regression/**/StackExchange.Redis.AssemblyConflict.LegacyProject.csproj" />
Expand Down Expand Up @@ -50,7 +51,7 @@

<!-- Used by CompileIntegrationTests-->
<Target Name="BuildCsharpIntegrationTests">
<MSBuild Targets="Build" Projects="@(CsharpIntegrationTestProject);@(CsharpIntegrationTestRegressionProject);@(ExcludeExpenseItDemoProject);@(ExcludeEF6DemoProject);@(ExcludeLegacyRedisProject)">
<MSBuild Targets="Build" Projects="@(RazorPagesProject);@(CsharpIntegrationTestProject);@(CsharpIntegrationTestRegressionProject);@(ExcludeExpenseItDemoProject);@(ExcludeEF6DemoProject);@(ExcludeLegacyRedisProject)">
<Output TaskParameter="TargetOutputs" ItemName="CollectedBuildOutput"/>
</MSBuild>
</Target>
Expand Down
35 changes: 33 additions & 2 deletions build/_build/Build.Steps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,38 @@ _ when projectPath.ToString().Contains("Samples.OracleMDA") => false,
.SetTargetPlatform(Platform)
.EnableNoRestore()
.EnableNoBuild()
.SetFilter(Filter ?? "(RunOnWindows=True|Category=Smoke)&LoadFromGAC!=True&IIS!=True")
.SetFilter(Filter ?? "RunOnWindows=True&LoadFromGAC!=True&IIS!=True")
.When(CodeCoverage, ConfigureCodeCoverage)
.CombineWith(ClrProfilerIntegrationTests, (s, project) => s
.EnableTrxLogOutput(GetResultsDirectory(project))
.SetProjectFile(project)));
}
finally
{
MoveLogsToBuildData();
}
});

Target RunWindowsRegressionTests => _ => _
.Unlisted()
.After(BuildTracerHome)
.After(CompileIntegrationTests)
.After(CompileRegressionSamples)
.After(CompileFrameworkReproductions)
.Requires(() => IsWin)
.Executes(() =>
{
ClrProfilerIntegrationTests.ForEach(EnsureResultsDirectory);

try
{
DotNetTest(config => config
.SetDotnetPath(Platform)
.SetConfiguration(BuildConfiguration)
.SetTargetPlatform(Platform)
.EnableNoRestore()
.EnableNoBuild()
.SetFilter(Filter ?? "Category=Smoke&LoadFromGAC!=True")
.When(CodeCoverage, ConfigureCodeCoverage)
.CombineWith(ClrProfilerIntegrationTests, (s, project) => s
.EnableTrxLogOutput(GetResultsDirectory(project))
Expand Down Expand Up @@ -809,7 +840,7 @@ _ when projectPath.ToString().Contains("Samples.OracleMDA") => false,
.When(Framework != null, o => o.SetFramework(Framework))
.EnableNoRestore()
.EnableNoBuild()
.SetFilter(Filter ?? "(RunOnWindows=True|Category=Smoke)&LoadFromGAC=True")
.SetFilter(Filter ?? "(RunOnWindows=True)&LoadFromGAC=True")
.When(CodeCoverage, ConfigureCodeCoverage)
.CombineWith(ClrProfilerIntegrationTests, (s, project) => s
.EnableTrxLogOutput(GetResultsDirectory(project))
Expand Down
18 changes: 16 additions & 2 deletions build/_build/Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,19 @@ void DeleteReparsePoints(string path)
.DependsOn(CompileDependencyLibs)
.DependsOn(CompileManagedTestHelpers)
.DependsOn(CreatePlatformlessSymlinks)
.DependsOn(CompileSamples)
.DependsOn(PublishIisSamples)
.DependsOn(CompileIntegrationTests);

Target BuildWindowsRegressionIntegrationTests => _ => _
.Unlisted()
.Requires(() => IsWin)
.Description("Builds the integration tests for Windows")
.DependsOn(CompileManagedTestHelpers)
.DependsOn(CreatePlatformlessSymlinks)
.DependsOn(CompileRegressionDependencyLibs)
.DependsOn(CompileRegressionSamples)
.DependsOn(CompileFrameworkReproductions)
.DependsOn(CompileSamples)
.DependsOn(PublishIisSamples)
.DependsOn(CompileIntegrationTests);

Target BuildAndRunWindowsIntegrationTests => _ => _
Expand All @@ -172,6 +180,12 @@ void DeleteReparsePoints(string path)
.DependsOn(BuildWindowsIntegrationTests)
.DependsOn(RunWindowsIntegrationTests);

Target BuildAndRunWindowsRegressionTests => _ => _
.Requires(() => IsWin)
.Description("Builds and runs the Windows regression tests")
.DependsOn(BuildWindowsRegressionIntegrationTests)
.DependsOn(RunWindowsRegressionTests);

Target BuildAndRunWindowsIisIntegrationTests => _ => _
.Requires(() => IsWin)
.Description("Builds and runs the Windows IIS integration tests")
Expand Down
2 changes: 1 addition & 1 deletion build/_build/Projects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public const string ApplicationWithLog4Net = "ApplicationWithLog4Net";
public const string EntityFramework6xMdTokenLookupFailure = "EntityFramework6x.MdTokenLookupFailure";

public const string RunnerTool = "Datadog.Trace.Tools.Runner.Tool";
public const string StandaloneTool = "Datadog.Trace.Tools.Runner.Standalone";
}

0 comments on commit df84628

Please sign in to comment.