Skip to content

Commit c8fa872

Browse files
authored
FileSystemDsc: Converted tests to Pester 5 (#13)
- FileSystemDsc - Converted tests to Pester 5. - Added wiki generation and publish to GitHub repository wiki. - Minor changes to pipeline files.
1 parent cc78d43 commit c8fa872

10 files changed

Lines changed: 1295 additions & 1007 deletions

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"powershell.codeFormatting.whitespaceAroundOperator": true,
88
"powershell.codeFormatting.whitespaceAfterSeparator": true,
99
"powershell.codeFormatting.ignoreOneLineBlock": false,
10-
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline",
10+
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
1111
"powershell.codeFormatting.preset": "Custom",
1212
"powershell.codeFormatting.alignPropertyValuePairs": true,
1313
"files.trimTrailingWhitespace": true,

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
- FileSystemDsc
1111
- Added issue and pull request templates to help contributors.
12+
- Added wiki generation and publish to GitHub repository wiki.
1213

1314
### Changed
1415

@@ -21,6 +22,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2122
commit message contain the word `add`, `adds`, `minor`, `feature`,
2223
or `features`.
2324
- Added missing MIT LICENSE file.
25+
- Converted tests to Pester 5.
26+
- Minor changes to pipeline files.
2427

2528
### Fixed
2629

RequiredModules.psd1

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
PSDependOptions = @{
33
AddToPath = $true
44
Target = 'output\RequiredModules'
5-
Parameters = @{
6-
Repository = ''
7-
}
5+
Parameters = @{}
86
}
97

108
InvokeBuild = 'latest'
119
PSScriptAnalyzer = 'latest'
12-
Pester = '4.10.1'
10+
Pester = 'latest'
1311
Plaster = 'latest'
14-
ModuleBuilder = '1.0.0'
12+
ModuleBuilder = 'latest'
1513
ChangelogManagement = 'latest'
1614
Sampler = 'latest'
1715
MarkdownLinkCheck = 'latest'

Resolve-Dependency.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@{
22
Gallery = 'PSGallery'
33
AllowPrerelease = $false
4-
WithYAML = $true # Will also bootstrap PowerShell-Yaml to read other config files
4+
WithYAML = $true
55
}
66

azure-pipelines.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ stages:
9595
displayName: 'Run Unit Test'
9696
inputs:
9797
filePath: './build.ps1'
98-
arguments: "-Tasks test -PesterScript 'tests/Unit'"
99-
pwsh: false
98+
arguments: "-Tasks test -PesterPath 'tests/Unit'"
99+
pwsh: true
100100
- task: PublishTestResults@2
101101
displayName: 'Publish Test Results'
102102
condition: succeededOrFailed()
@@ -123,8 +123,8 @@ stages:
123123
displayName: 'Run Unit Test'
124124
inputs:
125125
filePath: './build.ps1'
126-
arguments: "-Tasks test -PesterScript 'tests/Unit'"
127-
pwsh: false
126+
arguments: "-Tasks test -PesterPath 'tests/Unit'"
127+
pwsh: true
128128
- task: PublishTestResults@2
129129
displayName: 'Publish Test Results'
130130
condition: succeededOrFailed()
@@ -164,7 +164,7 @@ stages:
164164
displayName: 'Run Integration Test'
165165
inputs:
166166
filePath: './build.ps1'
167-
arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0"
167+
arguments: "-Tasks test -PesterPath 'tests/Integration' -CodeCoverageThreshold 0"
168168
pwsh: false
169169
- task: PublishTestResults@2
170170
displayName: 'Publish Test Results'
@@ -199,7 +199,7 @@ stages:
199199
displayName: 'Run Integration Test'
200200
inputs:
201201
filePath: './build.ps1'
202-
arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0"
202+
arguments: "-Tasks test -PesterPath 'tests/Integration' -CodeCoverageThreshold 0"
203203
pwsh: false
204204
- task: PublishTestResults@2
205205
displayName: 'Publish Test Results'

build.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ param
3535
$RequiredModulesDirectory = $(Join-Path 'output' 'RequiredModules'),
3636

3737
[Parameter()]
38+
# This alias is to prepare for the rename of this parameter to PesterPath when Pester 4 support is removed
39+
[Alias('PesterPath')]
3840
[object[]]
3941
$PesterScript,
4042

build.yaml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
####################################################
33
# ModuleBuilder Configuration #
44
####################################################
5-
CopyDirectories:
5+
CopyPaths:
66
- en-US
77
- DSCResources
88
Encoding: UTF8
@@ -33,21 +33,23 @@ BuildWorkflow:
3333
- Build_NestedModules_ModuleBuilder
3434
- Create_changelog_release_output
3535
- Generate_Conceptual_Help
36+
- Generate_Wiki_Content
3637

3738
pack:
3839
- build
3940
- package_module_nupkg
4041

4142
hqrmtest:
42-
- DscResource_Tests_Stop_On_Fail
43+
- Invoke_HQRM_Tests_Stop_On_Fail
4344

4445
test:
4546
- Pester_Tests_Stop_On_Fail
4647
- Pester_if_Code_Coverage_Under_Threshold
4748

4849
publish:
49-
- Publish_release_to_GitHub
50+
- Publish_Release_To_GitHub
5051
- publish_module_to_gallery
52+
- Publish_GitHub_Wiki_Content
5153

5254

5355
####################################################
@@ -58,7 +60,7 @@ Pester:
5860
OutputFormat: NUnitXML
5961
ExcludeFromCodeCoverage:
6062
- Modules/DscResource.Common
61-
Script:
63+
Path:
6264
- tests/Unit
6365
ExcludeTag:
6466
Tag:
@@ -67,26 +69,28 @@ Pester:
6769
CodeCoverageOutputFileEncoding: ascii
6870

6971
DscTest:
70-
ExcludeTag:
71-
- "Common Tests - New Error-Level Script Analyzer Rules"
72-
Tag:
73-
ExcludeSourceFile:
74-
- output
75-
ExcludeModuleFile:
76-
- Modules/DscResource.Common
77-
MainGitBranch: main
78-
79-
80-
Resolve-Dependency:
81-
Gallery: ''
82-
AllowPrerelease: false
83-
Verbose: false
72+
Pester:
73+
Configuration:
74+
Filter:
75+
Tag:
76+
ExcludeTag:
77+
- Common Tests - New Error-Level Script Analyzer Rules
78+
Output:
79+
Verbosity: Detailed
80+
Script:
81+
ExcludeSourceFile:
82+
- output
83+
ExcludeModuleFile:
84+
- Modules/DscResource.Common
85+
MainGitBranch: main
8486

8587
ModuleBuildTasks:
8688
Sampler:
8789
- '*.build.Sampler.ib.tasks'
8890
DscResource.DocGenerator:
8991
- 'Task.*'
92+
DscResource.Test:
93+
- 'Task.*'
9094

9195
TaskHeader: |
9296
param($Path)

source/WikiSource/Home.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Welcome to the FileSystemDsc wiki
2+
3+
<sup>*FileSystemDsc v#.#.#*</sup>
4+
5+
Here you will find all the information you need to make use of the FileSystemDsc
6+
DSC resources in the latest release. This includes details of the resources
7+
that are available, current capabilities, known issues, and information to
8+
help plan a DSC based implementation of FileSystemDsc.
9+
10+
Please leave comments, feature requests, and bug reports for this module in
11+
the [issues section](https://github.com/dsccommunity/FileSystemDsc/issues)
12+
for this repository.
13+
14+
## Getting started
15+
16+
To get started either:
17+
18+
- Install from the PowerShell Gallery using PowerShellGet by running the
19+
following command:
20+
21+
```powershell
22+
Install-Module -Name FileSystemDsc -Repository PSGallery
23+
```
24+
25+
- Download FileSystemDsc from the [PowerShell Gallery](https://www.powershellgallery.com/packages/FileSystemDsc)
26+
and then unzip it to one of your PowerShell modules folders (such as
27+
`$env:ProgramFiles\WindowsPowerShell\Modules`).
28+
29+
To confirm installation, run the below command and ensure you see the FileSystemDsc
30+
DSC resources available:
31+
32+
```powershell
33+
Get-DscResource -Module FileSystemDsc
34+
```
35+
36+
## Prerequisites
37+
38+
The minimum Windows Management Framework (PowerShell) version required is 5.0
39+
or higher, which ships with Windows 10 or Windows Server 2016,
40+
but can also be installed on Windows 7 SP1, Windows 8.1, Windows Server 2012,
41+
and Windows Server 2012 R2.
42+
43+
## Change log
44+
45+
A full list of changes in each version can be found in the [change log](https://github.com/dsccommunity/FileSystemDsc/blob/main/CHANGELOG.md).

0 commit comments

Comments
 (0)