Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Hilton Giesenow
authored and
Hilton Giesenow
committed
Mar 7, 2017
1 parent
ef747d8
commit 613f4ed
Showing
13 changed files
with
415 additions
and
387 deletions.
There are no files selected for viewing
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,12 @@ | ||
version: 1.0.{build} | ||
|
||
image: WMF 5 | ||
|
||
install: | ||
- cinst pester | ||
|
||
build: false | ||
|
||
test_script: | ||
# Test with native PS version | ||
- ps: . .\src\Tests\appveyorCITests.ps1 |
22 changes: 11 additions & 11 deletions
22
src/Tests/CI/Integration/PoShMon.Notifications.Email/New-EmailBody.Tests.ps1
Large diffs are not rendered by default.
Oops, something went wrong.
634 changes: 290 additions & 344 deletions
634
src/Tests/CI/Unit/PoShMon.Monitoring.OS/Test-ComputerTime.Tests.ps1
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
2 changes: 1 addition & 1 deletion
2
....Email.Monitoring/New-EmailBody.Tests.ps1 → ....Email.Monitoring/New-EmailBody.Tests.ps1
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
2 changes: 1 addition & 1 deletion
2
...O365Teams/Send-O365TeamsMessage.Tests.ps1 → ...O365Teams/Send-O365TeamsMessage.Tests.ps1
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
2 changes: 1 addition & 1 deletion
2
...shbullet/Send-PushbulletMessage.Tests.ps1 → ...shbullet/Send-PushbulletMessage.Tests.ps1
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 |
---|---|---|
@@ -1,18 +1,38 @@ | ||
Import-Module Pester | ||
|
||
$path = (Split-Path -Parent $MyInvocation.MyCommand.Path) | ||
|
||
#$scriptFiles = @( Get-ChildItem -Path "$path\Integration\*\*.ps1" -Recurse -ErrorAction SilentlyContinue ) | ||
#$scriptFiles = @( Get-ChildItem -Path "$path\Unit\*\*.ps1" -Recurse -ErrorAction SilentlyContinue ) | ||
$testsPath = "$path\CI\Unit" | ||
|
||
Invoke-Pester -Path $testsPath -CodeCoverage "$sutPath\*\*.ps1" | ||
|
||
#$scriptFiles = @( Get-ChildItem -Path "$path\*\*.ps1" -Recurse -ErrorAction SilentlyContinue ) | ||
$scriptFiles = @( Get-ChildItem -Path "$path\Integration\*\*.ps1" -Recurse -ErrorAction SilentlyContinue ) + ` | ||
@( Get-ChildItem -Path "$path\Unit\*\*.ps1" -Recurse -ErrorAction SilentlyContinue ) | ||
#$scriptFiles = @( Get-ChildItem -Path "$path\CI\*\*.ps1" -Recurse -ErrorAction SilentlyContinue ) | ||
#$scriptFiles = @( Get-ChildItem -Path "$path\CI\Integration\*\*.ps1" -Recurse -ErrorAction SilentlyContinue ) | ||
#$scriptFiles = @( Get-ChildItem -Path "$path\CI\Unit\*\*.ps1" -Recurse -ErrorAction SilentlyContinue ) | ||
|
||
#$testResultSettings = @{ } | ||
|
||
$testResultSettings = @{ } | ||
#$testsPath = "$path\CI" | ||
#$testsPath = "$path\CI\Integration" | ||
|
||
<# | ||
$filesToTest = @() | ||
$sutPath = Join-Path (Split-Path -Parent $path) -ChildPath ('\Functions') -Resolve | ||
Foreach($import in $scriptFiles) | ||
{ | ||
$sutFileName = (Split-Path -Leaf $import).Replace(".Tests", "") | ||
if (!$filesToTest.Contains($sutFileName)) | ||
{ | ||
$fileToTest = Get-ChildItem -Path "$sutPath\*\$sutFileName" -Recurse | ||
$filesToTest += $fileToTest.FullName | ||
} | ||
#Invoke-Pester -Script $import # -PassThru $testResultSettings | ||
#$import | ||
. $import | ||
#. $import | ||
} | ||
#> | ||
|
||
# $testResultSettings |
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,58 @@ | ||
#based on code from https://github.com/RamblingCookieMonster/PSDiskPart/ | ||
$ProjectRoot = $ENV:APPVEYOR_BUILD_FOLDER | ||
Set-Location $ProjectRoot | ||
|
||
#$path = (Split-Path -Parent $MyInvocation.MyCommand.Path) | ||
|
||
Import-Module Pester | ||
|
||
Invoke-Pester -Path "$ProjectRoot\src\Tests\CI" -CodeCoverage "$ProjectRoot\src\Functions\*\*.ps1" -OutputFormat NUnitXml -OutputFile "$ProjectRoot\RawTestResults.xml" -PassThru | ` | ||
Export-Clixml -Path "$ProjectRoot\PesterTestResults.xml" | ||
|
||
#Invoke-Pester -Path "$ProjectRoot\src\Tests\Integration" -OutputFormat NUnitXml -OutputFile "$ProjectRoot\RawIntegrationTestResults.xml" -PassThru | ` | ||
# Export-Clixml -Path "$ProjectRoot\PesterIntegrationTestResults.xml" | ||
|
||
#Show status... | ||
$AllFiles = Get-ChildItem -Path $ProjectRoot\*Results.xml | Select -ExpandProperty FullName | ||
"`n`tSTATUS: Finalizing results`n" | ||
"COLLATING FILES:`n$($AllFiles | Out-String)" | ||
|
||
#Upload results for test page | ||
Get-ChildItem -Path $ProjectRoot\Raw*TestResults.xml | Foreach-Object { | ||
$Address = "https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)" | ||
$Source = $_.FullName | ||
|
||
"UPLOADING FILES: $Address $Source" | ||
|
||
(New-Object 'System.Net.WebClient').UploadFile( $Address, $Source ) | ||
} | ||
|
||
#What failed? | ||
$Results = @( Get-ChildItem -Path "$ProjectRoot\Pester*TestResults.xml" | Import-Clixml ) | ||
|
||
$FailedCount = $Results | | ||
Select -ExpandProperty FailedCount | | ||
Measure-Object -Sum | | ||
Select -ExpandProperty Sum | ||
|
||
if ($FailedCount -gt 0) { | ||
|
||
$FailedItems = $Results | | ||
Select -ExpandProperty TestResult | | ||
Where {$_.Passed -notlike $True} | ||
|
||
"FAILED TESTS SUMMARY:`n" | ||
$FailedItems | ForEach-Object { | ||
$Test = $_ | ||
[pscustomobject]@{ | ||
Describe = $Test.Describe | ||
Context = $Test.Context | ||
Name = "It $($Test.Name)" | ||
Result = $Test.Result | ||
} | ||
} | | ||
Sort Describe, Context, Name, Result | | ||
Format-List | ||
|
||
throw "$FailedCount tests failed." | ||
} |