You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `Test-ShouldRunDscResourceIntegrationTests.ps1` script analyzes git
7
+
This script dynamically determines whether DSC resource integration tests
8
+
should run in Azure Pipelines.
9
+
10
+
### What the Script Does
11
+
<!-- markdownlint-disable-next-line MD013 -->
12
+
The [`Test-ShouldRunDscResourceIntegrationTests.ps1`](./Test-ShouldRunDscResourceIntegrationTests.ps1) script analyzes git
9
13
changes between two references and determines if DSC resource integration tests
10
14
need to run. It automatically discovers which public commands are used by DSC
11
15
resources and classes, then checks if any relevant files have been modified.
12
16
13
-
## How It Works
17
+
###How It Works
14
18
15
19
The script checks for changes to:
16
20
@@ -23,26 +27,53 @@ The script checks for changes to:
23
27
1.**Integration Tests**: DSC resource integration test files under
24
28
`tests/Integration/Resources/`
25
29
26
-
## Usage
30
+
### Parameters
31
+
32
+
| Parameter | Type | Default | Purpose |
33
+
|-----------|------|---------|---------|
34
+
|`BaseBranch`| String |`'origin/main'`| Base branch to compare against |
35
+
|`CurrentBranch`| String |`'HEAD'`| Current branch or commit to compare |
36
+
|`UseMergeBase`| Switch |`$false`| Use merge-base to compute diff base |
37
+
38
+
### Outputs
39
+
40
+
<!-- markdownlint-disable MD013 - Table with long descriptions -->
41
+
| Output | Type | Description |
42
+
|--------|------|-------------|
43
+
| Return value | Boolean |`$true` when the monitored categories have relevant changes between the specified refs, `$false` when no such changes are detected |
44
+
<!-- markdownlint-enable MD013 -->
45
+
46
+
### Usage
27
47
28
-
### Azure Pipelines
48
+
####Azure Pipelines
29
49
30
50
The Azure Pipelines task sets an output variable that downstream stages can
31
51
use to conditionally run DSC resource integration tests. The script returns
32
52
a boolean value that the pipeline captures, e.g.:
33
53
54
+
<!-- markdownlint-disable MD013 -->
34
55
```yaml
35
56
- powershell: |
36
-
$shouldRun = ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD
57
+
$shouldRun = & ./.build/Test-ShouldRunDscResourceIntegrationTests.ps1 -BaseBranch $targetBranch -CurrentBranch HEAD -UseMergeBase
0 commit comments