Skip to content

Commit 7182842

Browse files
committed
Update README.md for improved formatting and clarity in DSC resource integration test script documentation
1 parent 924c240 commit 7182842

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

.build/README.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

1012
The `Test-ShouldRunDscResourceIntegrationTests.ps1` script analyzes git
@@ -33,16 +35,27 @@ The Azure Pipelines task sets an output variable that downstream stages can
3335
use to conditionally run DSC resource integration tests. The script returns
3436
a 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

Comments
 (0)