@@ -4,7 +4,9 @@ Documentation for the SqlServerDsc module build/pipeline scripts.
44
55## ` Test-ShouldRunDscResourceIntegrationTests.ps1 `
66
7- This script dynamically determines whether DSC resource integration tests should run in Azure Pipelines.
7+ This script dynamically determines whether DSC resource integration tests
8+ should run in Azure Pipelines.
9+
810### What the Script Does
911
1012The ` Test-ShouldRunDscResourceIntegrationTests.ps1 ` script analyzes git
@@ -33,16 +35,27 @@ The Azure Pipelines task sets an output variable that downstream stages can
3335use to conditionally run DSC resource integration tests. The script returns
3436a boolean value that the pipeline captures, e.g.:
3537
38+ <!-- markdownlint-disable MD013 -->
3639``` yaml
3740- powershell : |
3841 $shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD
3942 Write-Host "##vso[task.setvariable variable=ShouldRunDscResourceIntegrationTests;isOutput=true]$shouldRun"
4043 displayName : ' Determine if DSC resource tests should run'
4144` ` `
45+ <!-- markdownlint-enable MD013 -->
46+
47+ Downstream stages reference this output variable in a stage ` condition:`
48+ using the pattern :
49+ <!-- markdownlint-disable MD013 -->
50+ ` ` ` yaml
51+ condition: |
52+ and(
53+ succeeded(),
54+ eq(lower(dependencies.stageName.outputs['jobName.taskName.ShouldRunDscResourceIntegrationTests']), 'true')`
4255
43- Downstream stages reference this output variable using the pattern:
44- ` dependencies.JobName.outputs['StepName.VariableName']` to gate their
45- execution based on whether DSC resource tests should run.
56+ )
57+ ```
58+ <!-- markdownlint-enable MD013 -->
4659
4760#### Command Line
4861
0 commit comments