Skip to content

Commit

Permalink
FileSystemDsc: Converted tests to Pester 5 (#13)
Browse files Browse the repository at this point in the history
- FileSystemDsc
  - Converted tests to Pester 5.
  - Added wiki generation and publish to GitHub repository wiki.
  - Minor changes to pipeline files.
  • Loading branch information
johlju authored Feb 16, 2021
1 parent cc78d43 commit c8fa872
Show file tree
Hide file tree
Showing 10 changed files with 1,295 additions and 1,007 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"powershell.codeFormatting.whitespaceAroundOperator": true,
"powershell.codeFormatting.whitespaceAfterSeparator": true,
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline",
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
"powershell.codeFormatting.preset": "Custom",
"powershell.codeFormatting.alignPropertyValuePairs": true,
"files.trimTrailingWhitespace": true,
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- FileSystemDsc
- Added issue and pull request templates to help contributors.
- Added wiki generation and publish to GitHub repository wiki.

### Changed

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

### Fixed

Expand Down
8 changes: 3 additions & 5 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
PSDependOptions = @{
AddToPath = $true
Target = 'output\RequiredModules'
Parameters = @{
Repository = ''
}
Parameters = @{}
}

InvokeBuild = 'latest'
PSScriptAnalyzer = 'latest'
Pester = '4.10.1'
Pester = 'latest'
Plaster = 'latest'
ModuleBuilder = '1.0.0'
ModuleBuilder = 'latest'
ChangelogManagement = 'latest'
Sampler = 'latest'
MarkdownLinkCheck = 'latest'
Expand Down
2 changes: 1 addition & 1 deletion Resolve-Dependency.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@{
Gallery = 'PSGallery'
AllowPrerelease = $false
WithYAML = $true # Will also bootstrap PowerShell-Yaml to read other config files
WithYAML = $true
}

12 changes: 6 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ stages:
displayName: 'Run Unit Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Unit'"
pwsh: false
arguments: "-Tasks test -PesterPath 'tests/Unit'"
pwsh: true
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
Expand All @@ -123,8 +123,8 @@ stages:
displayName: 'Run Unit Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Unit'"
pwsh: false
arguments: "-Tasks test -PesterPath 'tests/Unit'"
pwsh: true
- task: PublishTestResults@2
displayName: 'Publish Test Results'
condition: succeededOrFailed()
Expand Down Expand Up @@ -164,7 +164,7 @@ stages:
displayName: 'Run Integration Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0"
arguments: "-Tasks test -PesterPath 'tests/Integration' -CodeCoverageThreshold 0"
pwsh: false
- task: PublishTestResults@2
displayName: 'Publish Test Results'
Expand Down Expand Up @@ -199,7 +199,7 @@ stages:
displayName: 'Run Integration Test'
inputs:
filePath: './build.ps1'
arguments: "-Tasks test -PesterScript 'tests/Integration' -CodeCoverageThreshold 0"
arguments: "-Tasks test -PesterPath 'tests/Integration' -CodeCoverageThreshold 0"
pwsh: false
- task: PublishTestResults@2
displayName: 'Publish Test Results'
Expand Down
2 changes: 2 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ param
$RequiredModulesDirectory = $(Join-Path 'output' 'RequiredModules'),

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

Expand Down
40 changes: 22 additions & 18 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
####################################################
# ModuleBuilder Configuration #
####################################################
CopyDirectories:
CopyPaths:
- en-US
- DSCResources
Encoding: UTF8
Expand Down Expand Up @@ -33,21 +33,23 @@ BuildWorkflow:
- Build_NestedModules_ModuleBuilder
- Create_changelog_release_output
- Generate_Conceptual_Help
- Generate_Wiki_Content

pack:
- build
- package_module_nupkg

hqrmtest:
- DscResource_Tests_Stop_On_Fail
- Invoke_HQRM_Tests_Stop_On_Fail

test:
- Pester_Tests_Stop_On_Fail
- Pester_if_Code_Coverage_Under_Threshold

publish:
- Publish_release_to_GitHub
- Publish_Release_To_GitHub
- publish_module_to_gallery
- Publish_GitHub_Wiki_Content


####################################################
Expand All @@ -58,7 +60,7 @@ Pester:
OutputFormat: NUnitXML
ExcludeFromCodeCoverage:
- Modules/DscResource.Common
Script:
Path:
- tests/Unit
ExcludeTag:
Tag:
Expand All @@ -67,26 +69,28 @@ Pester:
CodeCoverageOutputFileEncoding: ascii

DscTest:
ExcludeTag:
- "Common Tests - New Error-Level Script Analyzer Rules"
Tag:
ExcludeSourceFile:
- output
ExcludeModuleFile:
- Modules/DscResource.Common
MainGitBranch: main


Resolve-Dependency:
Gallery: ''
AllowPrerelease: false
Verbose: false
Pester:
Configuration:
Filter:
Tag:
ExcludeTag:
- Common Tests - New Error-Level Script Analyzer Rules
Output:
Verbosity: Detailed
Script:
ExcludeSourceFile:
- output
ExcludeModuleFile:
- Modules/DscResource.Common
MainGitBranch: main

ModuleBuildTasks:
Sampler:
- '*.build.Sampler.ib.tasks'
DscResource.DocGenerator:
- 'Task.*'
DscResource.Test:
- 'Task.*'

TaskHeader: |
param($Path)
Expand Down
45 changes: 45 additions & 0 deletions source/WikiSource/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Welcome to the FileSystemDsc wiki

<sup>*FileSystemDsc v#.#.#*</sup>

Here you will find all the information you need to make use of the FileSystemDsc
DSC resources in the latest release. This includes details of the resources
that are available, current capabilities, known issues, and information to
help plan a DSC based implementation of FileSystemDsc.

Please leave comments, feature requests, and bug reports for this module in
the [issues section](https://github.com/dsccommunity/FileSystemDsc/issues)
for this repository.

## Getting started

To get started either:

- Install from the PowerShell Gallery using PowerShellGet by running the
following command:

```powershell
Install-Module -Name FileSystemDsc -Repository PSGallery
```

- Download FileSystemDsc from the [PowerShell Gallery](https://www.powershellgallery.com/packages/FileSystemDsc)
and then unzip it to one of your PowerShell modules folders (such as
`$env:ProgramFiles\WindowsPowerShell\Modules`).

To confirm installation, run the below command and ensure you see the FileSystemDsc
DSC resources available:

```powershell
Get-DscResource -Module FileSystemDsc
```

## Prerequisites

The minimum Windows Management Framework (PowerShell) version required is 5.0
or higher, which ships with Windows 10 or Windows Server 2016,
but can also be installed on Windows 7 SP1, Windows 8.1, Windows Server 2012,
and Windows Server 2012 R2.

## Change log

A full list of changes in each version can be found in the [change log](https://github.com/dsccommunity/FileSystemDsc/blob/main/CHANGELOG.md).
Loading

0 comments on commit c8fa872

Please sign in to comment.