1- # DSC Resource Integration Test Optimization
1+ # Scripts
22
3- This document describes the script used to dynamically determine whether DSC
3+ Documentation for the specific SqlServerDsc module pipeline scripts.
4+
5+ ## ` Test-ShouldRunDscResourceIntegrationTests.ps1 `
6+
7+ The script is used to dynamically determine whether DSC
48resource integration tests should run in Azure Pipelines.
59
6- ## What the Script Does
10+ ### What the Script Does
711
812The ` Test-ShouldRunDscResourceIntegrationTests.ps1 ` script analyzes git
913changes between two references and determines if DSC resource integration tests
1014need to run. It automatically discovers which public commands are used by DSC
1115resources and classes, then checks if any relevant files have been modified.
1216
13- ## How It Works
17+ ### How It Works
1418
1519The script checks for changes to:
1620
@@ -23,9 +27,9 @@ The script checks for changes to:
23271 . ** Integration Tests** : DSC resource integration test files under
2428 ` tests/Integration/Resources/ `
2529
26- ## Usage
30+ ### Usage
2731
28- ### Azure Pipelines
32+ #### Azure Pipelines
2933
3034The Azure Pipelines task sets an output variable that downstream stages can
3135use to conditionally run DSC resource integration tests. The script returns
@@ -42,7 +46,7 @@ Downstream stages reference this output variable using the pattern:
4246` dependencies.JobName.outputs['StepName.VariableName']` to gate their
4347execution based on whether DSC resource tests should run.
4448
45- # ## Command Line
49+ # ### Command Line
4650
4751` ` ` powershell
4852# Basic usage (compares current HEAD with origin/main)
@@ -52,9 +56,3 @@ execution based on whether DSC resource tests should run.
5256.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch 'origin/dev' \
5357 -CurrentBranch 'feature-branch'
5458` ` `
55-
56- # # Dynamic Discovery
57-
58- The script automatically discovers public commands used by DSC resources by
59- scanning source files, eliminating the need to maintain hardcoded lists.
60- This ensures accuracy and reduces maintenance overhead.
0 commit comments