Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Update dependencies and gitignore #314

Merged
merged 58 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 56 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a0ab264
chore: Update dependencies and gitignore
vicperdana Aug 20, 2024
f9c235e
Updated CHANGELOG.md with engineering updates
vicperdana Aug 20, 2024
52a83b7
chore: Update Pester to v5.6.1 and other dependencies
vicperdana Aug 20, 2024
b119341
chore: Update Pester to v5.6.1 and other dependencies
vicperdana Aug 20, 2024
d3c814b
Update compatibility with Pester 5
vicperdana Aug 20, 2024
23cf219
chore: Update Pester to v5.6.1 and other dependencies
vicperdana Aug 20, 2024
4e0777f
chore: Update Pester configuration for Pester 5 compatibility
vicperdana Aug 20, 2024
f362bb8
chore: Remove Pester VSCode marker and enable NUnitXml output
vicperdana Aug 20, 2024
11579bc
chore: Enable NUnitXml output in Pester configuration
vicperdana Aug 21, 2024
d7f7bcc
chore: Enable NUnitXml output in Pester configuration
vicperdana Aug 21, 2024
ec4148d
chore: Refactor PSDocs.BlockQuote.Tests.ps1 to add `BeforeAll` for Pe…
vicperdana Aug 21, 2024
59c69cd
chore: Refactor PSDocs.*.Tests.ps1 to add `BeforeAll` for Pester 5
vicperdana Aug 21, 2024
4688f48
chore: Refactor PSDocs.*.Tests.ps1 to add `BeforeAll` for Pester 5 - …
vicperdana Aug 21, 2024
308e7e6
Test rootPath.path
vicperdana Aug 21, 2024
34afba2
chore: Import PSDocs module in PSDocs.Common.Tests.ps1
vicperdana Aug 21, 2024
1dc7d52
Moved $result under BeforeAll block
vicperdana Aug 21, 2024
144c98b
Remove dash command for Should
vicperdana Aug 21, 2024
899b748
chore: Refactor PSDocs.Common.Tests.ps1 for better test output
vicperdana Aug 21, 2024
9515805
Add dash to Should
vicperdana Aug 21, 2024
d568cc5
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
5766571
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
06b90de
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
525fb0b
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
2f84991
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
a679be7
added `$currentLoadingPreference`
vicperdana Aug 21, 2024
16a0de0
Remove try and finally block
vicperdana Aug 21, 2024
455abf0
moved Mock -CommandName 'LoadModule' -ModuleName 'PSDocs'; under `Bef…
vicperdana Aug 21, 2024
ebb8479
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
790b50a
Testing only
vicperdana Aug 21, 2024
4d0eebb
Testing removed strictMode
vicperdana Aug 21, 2024
f0fe5c2
added `-Scope 'It'`
vicperdana Aug 21, 2024
a052040
Removed moduleName for testing
vicperdana Aug 21, 2024
91c729e
Should -Invoke
vicperdana Aug 21, 2024
de1b8ad
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
2a642d2
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
a2b86db
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
cbcc516
added debug
vicperdana Aug 21, 2024
cedd9c4
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
10cb4b0
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
a51ee1b
added debug statement
vicperdana Aug 21, 2024
00f8ebb
Refactor Get-PSDocument test to use current encoding variable in test…
vicperdana Aug 21, 2024
1297123
Refactor PSDocs.Common.Tests.ps1 to use current encoding variable in …
vicperdana Aug 21, 2024
929a339
Use non mocks
vicperdana Aug 21, 2024
581229f
Added `InModuleScope`
vicperdana Aug 21, 2024
9797439
Refactor PSDocs.Common.Tests.ps1 to import PSDocs module and use curr…
vicperdana Aug 21, 2024
21920a7
Refactor PSDocs.Common.Tests.ps1 to import PSDocs module and use curr…
vicperdana Aug 21, 2024
92bfb0a
Refactor PSDocs.Common.Tests.ps1 to import PSDocs module and use curr…
vicperdana Aug 21, 2024
c581fca
Refactor PSDocs.Common.Tests.ps1 to remove unnecessary module removal…
vicperdana Aug 21, 2024
cf530d3
Refactor PSDocs.Common.Tests.ps1 to use TestModule instead of PSDocs …
vicperdana Aug 21, 2024
f6b1d1e
Refactor PSDocs.Common.Tests.ps1 to use TestModule instead of PSDocs …
vicperdana Aug 21, 2024
03797ad
Refactor PSDocs.Common.Tests.ps1 to remove unnecessary module removal…
vicperdana Aug 21, 2024
89fc744
Refactor PSDocs.Common.Tests.ps1 to remove unnecessary module removal…
vicperdana Aug 21, 2024
d750a5b
Refactor PSDocs.Common.Tests.ps1 to remove unnecessary module removal…
vicperdana Aug 21, 2024
0f63b2f
Refactor PSDocs.Common.Tests.ps1 to remove unnecessary module removal…
vicperdana Aug 21, 2024
dd3ac0a
Refactor PSDocs.Common.Tests.ps1 to remove unnecessary module removal…
vicperdana Aug 21, 2024
92b5390
Update PSDocs.Common.Tests.ps1
vicperdana Aug 22, 2024
d94970b
Fix to CVE-2024-42471 by updating actions/download-artifact to v4
vicperdana Sep 4, 2024
a85626a
chore: Update actions/upload-artifact to v4 in build workflow
vicperdana Sep 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ src/**/*-help.xml
src/**/*.help.txt
BenchmarkDotNet.Artifacts/
PSDocs.Benchmark*.log
.idea/.idea.PSDocs/.idea/.gitignore
.idea/.idea.PSDocs/.idea/indexLayout.xml
.idea/.idea.PSDocs/.idea/vcs.xml
14 changes: 10 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
What's changed since v0.9.0:

- Engineering:
- Bump YamlDotNet to v13.7.1.
[#284](https://github.com/microsoft/PSDocs/pull/284)
- Bump Newtonsoft.Json to v13.0.3.
[#284](https://github.com/microsoft/PSDocs/pull/284)
- CI update Pester to v5.6.1
- Bump BenchmarkDotNet to v0.14.0.
- Bump Microsoft.CodeCoverage to v17.10.0.
- Bump Microsoft.NET.Test.Sdk to v17.10.0.
- Bump xunit to v2.9.0.
- Bump xunit.runner.visualstudio to v2.5.7.
- Bump YamlDotNet to v13.7.1.
[#284](https://github.com/microsoft/PSDocs/pull/284)
- Bump Newtonsoft.Json to v13.0.3.
[#284](https://github.com/microsoft/PSDocs/pull/284)

## v0.9.0

Expand Down
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dependencies": {},
"devDependencies": {
"Pester": {
"version": "4.10.1"
"version": "5.6.1"
},
"platyPS": {
"version": "0.14.2"
Expand Down
30 changes: 19 additions & 11 deletions pipeline.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -191,35 +191,43 @@ task Dependencies NuGet, {

# Synopsis: Test the module
task TestModule Dependencies, {
Import-Module Pester -RequiredVersion 4.10.1 -Force;
Import-Module Pester -RequiredVersion 5.6.1 -Force;

# Run Pester tests
$pesterParams = @{ Path = $PWD; OutputFile = 'reports/pester-unit.xml'; OutputFormat = 'NUnitXml'; PesterOption = @{ IncludeVSCodeMarker = $True }; PassThru = $True; };
# Define Pester configuration
$pesterConfig = [PesterConfiguration]::Default
$pesterConfig.Run.PassThru = $True
# Enable NUnitXml output
$pesterConfig.TestResult.OutputFormat = "NUnitXml"
$pesterConfig.TestResult.OutputPath = 'reports/pester-unit.xml'
$pesterConfig.TestResult.Enabled = $True

if ($CodeCoverage) {
$pesterParams.Add('CodeCoverage', (Join-Path -Path $PWD -ChildPath 'out/modules/**/*.psm1'));
$pesterParams.Add('CodeCoverageOutputFile', (Join-Path -Path $PWD -ChildPath reports/pester-coverage.xml));
$pesterConfig.CodeCoverage.OutputFormat = 'JaCoCo'
$pesterConfig.CodeCoverage.OutputPath = 'reports/pester-coverage.xml'
$pesterConfig.CodeCoverage.Path = (Join-Path -Path $PWD -ChildPath 'out/modules/**/*.psm1')
}

if (!(Test-Path -Path reports)) {
$Null = New-Item -Path reports -ItemType Directory -Force;
}

if ($Null -ne $TestGroup) {
$pesterParams['Tags'] = $TestGroup;
$pesterConfig.Filter.Tag = $TestGroup
}

$results = Invoke-Pester @pesterParams;
# Run Pester tests
$results = Invoke-Pester -Configuration $pesterConfig

# Throw an error if pester tests failed
# Throw an error if Pester tests failed
if ($Null -eq $results) {
throw 'Failed to get Pester test results.';
throw 'Failed to get Pester test results.'
}
elseif ($results.FailedCount -gt 0) {
throw "$($results.FailedCount) tests failed.";
elseif ($results.Result.FailedCount -gt 0) {
throw "$($results.Result.FailedCount) tests failed."
}
}


task Benchmark {
if ($Benchmark -or $BuildTask -eq 'Benchmark') {
dotnet run --project src/PSDocs.Benchmark -f net7.0 -c Release -- benchmark --output $PWD;
Expand Down
2 changes: 1 addition & 1 deletion src/PSDocs.Benchmark/PSDocs.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</ItemGroup>

<ItemGroup Condition="'$(OS)' != 'Windows_NT'">
<PackageReference Include="BenchmarkDotNet" Version="0.13.9" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>

<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
Expand Down
39 changes: 21 additions & 18 deletions tests/PSDocs.Tests/PSDocs.BlockQuote.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,30 @@
[CmdletBinding()]
param ()

# Setup error handling
$ErrorActionPreference = 'Stop';
Set-StrictMode -Version latest;

# Setup tests paths
$rootPath = $PWD;
Import-Module (Join-Path -Path $rootPath -ChildPath out/modules/PSDocs) -Force;
$here = (Resolve-Path $PSScriptRoot).Path;
$nl = [System.Environment]::NewLine;
BeforeAll{
# Setup error handling
$ErrorActionPreference = 'Stop';
Set-StrictMode -Version latest;

# Setup tests paths
$rootPath = $PWD;
Import-Module (Join-Path -Path $rootPath -ChildPath out/modules/PSDocs) -Force;
$here = (Resolve-Path $PSScriptRoot).Path;
$nl = [System.Environment]::NewLine;
}
Describe 'PSDocs -- BlockQuote keyword' -Tag BlockQuote {
$docFilePath = Join-Path -Path $here -ChildPath 'FromFile.Keyword.Doc.ps1';
$testObject = [PSCustomObject]@{
Name = 'TestObject'
}


Context 'Markdown' {
$invokeParams = @{
Path = $docFilePath
InputObject = $testObject
PassThru = $True
BeforeAll{
$docFilePath = Join-Path -Path $here -ChildPath 'FromFile.Keyword.Doc.ps1';
$testObject = [PSCustomObject]@{
Name = 'TestObject'
}
$invokeParams = @{
Path = $docFilePath
InputObject = $testObject
PassThru = $True
}
}
It 'Should handle single line input' {
$result = Invoke-PSDocument @invokeParams -Name 'BlockQuoteSingleMarkdown';
Expand Down
37 changes: 20 additions & 17 deletions tests/PSDocs.Tests/PSDocs.Code.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,30 @@
[CmdletBinding()]
param ()

# Setup error handling
$ErrorActionPreference = 'Stop';
Set-StrictMode -Version latest;
BeforeAll {
# Setup error handling
$ErrorActionPreference = 'Stop';
Set-StrictMode -Version latest;

# Setup tests paths
$rootPath = $PWD;
Import-Module (Join-Path -Path $rootPath -ChildPath out/modules/PSDocs) -Force;
$here = (Resolve-Path $PSScriptRoot).Path;
$nl = [System.Environment]::NewLine;
# Setup tests paths
$rootPath = $PWD;
Import-Module (Join-Path -Path $rootPath -ChildPath out/modules/PSDocs) -Force;
$here = (Resolve-Path $PSScriptRoot).Path;
$nl = [System.Environment]::NewLine;
}

Describe 'PSDocs -- Code keyword' -Tag Code {
$docFilePath = Join-Path -Path $here -ChildPath 'FromFile.Keyword.Doc.ps1';
$testObject = [PSCustomObject]@{
Name = 'TestObject'
}

Context 'Markdown' {
$invokeParams = @{
Path = $docFilePath
InputObject = $testObject
PassThru = $True
BeforeAll {
$docFilePath = Join-Path -Path $here -ChildPath 'FromFile.Keyword.Doc.ps1';
$testObject = [PSCustomObject]@{
Name = 'TestObject'
}
$invokeParams = @{
Path = $docFilePath
InputObject = $testObject
PassThru = $True
}
}
It 'Should have generated output' {
$result = Invoke-PSDocument @invokeParams -Name 'CodeMarkdown';
Expand Down
Loading
Loading