-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1374 from ykuijs/master
Fix issue in SPTrustedRootAuthority and simplified running Pester tests
- Loading branch information
Showing
6 changed files
with
132 additions
and
20 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# These owners will be the default owners for everything in | ||
# the repo. Unless a later match takes precedence, | ||
# @global-owner1 and @global-owner2 will be requested for | ||
# review when someone opens a pull request. | ||
* @ykuijs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#Requires -RunAsAdministrator | ||
|
||
[CmdletBinding()] | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[ValidateSet("2013", "2016", "2019", "Subscription")] | ||
[System.String] | ||
$SharePointVersion, | ||
|
||
[Parameter()] | ||
[Switch] | ||
$DoNotBuildModule | ||
) | ||
|
||
$modulePath = Split-Path -Path $PSScriptRoot | ||
|
||
if ($DoNotBuildModule -eq $false) | ||
{ | ||
& $modulePath\build.ps1 -Tasks Build | ||
} | ||
|
||
$testPath = Join-Path -Path $modulePath -ChildPath "\Tests\Unit\SharePointDsc" | ||
|
||
$params = @{ | ||
Tasks = 'Test' | ||
} | ||
|
||
switch ($SharePointVersion) | ||
{ | ||
"2013" | ||
{ | ||
$stubPath = Join-Path -Path $modulePath -ChildPath '\Tests\Unit\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1' | ||
} | ||
"2016" | ||
{ | ||
$stubPath = Join-Path -Path $modulePath -ChildPath '\Tests\Unit\Stubs\SharePoint\16.0.4456.1000\Microsoft.SharePoint.PowerShell.psm1' | ||
} | ||
"2019" | ||
{ | ||
$stubPath = Join-Path -Path $modulePath -ChildPath '\Tests\Unit\Stubs\SharePoint\16.0.10337.12109\Microsoft.SharePoint.PowerShell.psm1' | ||
} | ||
"Subscription" | ||
{ | ||
$stubPath = Join-Path -Path $modulePath -ChildPath '\Tests\Unit\Stubs\SharePoint\16.0.14326.20450/SharePointServer.psm1' | ||
} | ||
} | ||
|
||
$params.PesterScript = @( | ||
@{ | ||
Path = $testPath | ||
Parameters = @{ | ||
SharePointCmdletModule = $stubPath | ||
} | ||
} | ||
) | ||
|
||
& $modulePath\build.ps1 @params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#Requires -RunAsAdministrator | ||
|
||
[CmdletBinding()] | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[System.String] | ||
$Resource, | ||
|
||
[Parameter()] | ||
[Switch] | ||
$DoNotBuildModule | ||
) | ||
|
||
$modulePath = Split-Path -Path $PSScriptRoot | ||
|
||
if ($DoNotBuildModule -eq $false) | ||
{ | ||
& $modulePath\build.ps1 -Tasks Build | ||
} | ||
|
||
$path15 = Join-Path -Path $modulePath -ChildPath '\Tests\Unit\Stubs\SharePoint\15.0.4805.1000\Microsoft.SharePoint.PowerShell.psm1' | ||
$path16 = Join-Path -Path $modulePath -ChildPath '\Tests\Unit\Stubs\SharePoint\16.0.4456.1000\Microsoft.SharePoint.PowerShell.psm1' | ||
$path19 = Join-Path -Path $modulePath -ChildPath '\Tests\Unit\Stubs\SharePoint\16.0.10337.12109\Microsoft.SharePoint.PowerShell.psm1' | ||
$pathSE = Join-Path -Path $modulePath -ChildPath '\Tests\Unit\Stubs\SharePoint\16.0.14326.20450\SharePointServer.psm1' | ||
|
||
$testPath = Join-Path -Path $modulePath -ChildPath ".\Tests\Unit\SharePointDsc\SharePointDsc.$resource.Tests.ps1" | ||
$compiledModulePath = Split-Path -Path (Get-Module SharePointDsc -ListAvailable).Path | ||
$resourcePath = Join-Path -Path $compiledModulePath -ChildPath "\DSCResources\MSFT_$resource\MSFT_$resource.psm1" | ||
Invoke-Pester -Script @( | ||
@{ Path = $testPath; Parameters = @{SharePointCmdletModule = $path15 } }, | ||
@{ Path = $testPath; Parameters = @{SharePointCmdletModule = $path16 } }, | ||
@{ Path = $testPath; Parameters = @{SharePointCmdletModule = $path19 } }, | ||
@{ Path = $testPath; Parameters = @{SharePointCmdletModule = $pathSE } } | ||
) -CodeCoverage $resourcePath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters