Repository navigation
Changed Find-Package test to 'SLOW' to fix master #1439
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ffe0a25
Changed Find-Package test to 'SLOW'
TravisEz13 c69104a
Made appveyor exclude 'slow' tests
TravisEz13 7f97e4b
Added CI Tag to sample
TravisEz13 441b105
Made the test run in new powershell
TravisEz13 a51618a
Removed test for appveyor.yml
TravisEz13 6fea333
made powershell invoke compatible with linux
TravisEz13 cd9ddb1
Used method from PR comments to find powershell
TravisEz13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,9 +1,93 @@ | ||
| try { | ||
| $enlistmentRoot = git rev-parse --show-toplevel | ||
|
|
||
| $docLocation = [io.path]::Combine($enlistmentRoot, "docs","cmdlet-example") | ||
| Push-Location $docLocation | ||
| ./SendGreeting.Tests.ps1 | ||
| } finally { | ||
| Pop-Location | ||
| # Looking at pester internal to get tag filter and ExcludeTagFilter | ||
| # This seems like the most stable way to do this | ||
| # other options like testing for tags seems more likely to break | ||
|
|
||
| InModuleScope Pester { | ||
| Describe 'Getting Tag Filters' -Tag CI { | ||
| $global:__PesterTags = $pester.TagFilter | ||
| $global:__PesterExcludeTags = $pester.ExcludeTagFilter | ||
| } | ||
| } | ||
| Describe 'SDK Send Greeting Sample Tests' -Tag CI { | ||
|
|
||
| try { | ||
| $enlistmentRoot = git rev-parse --show-toplevel | ||
| $docLocation = Join-Path -Path $enlistmentRoot -ChildPath '\docs\cmdlet-example' | ||
| $testResultPath = Join-Path $TestDrive 'sendgreetingresults.xml' | ||
| $sampleCopy = Join-Path $TestDrive 'sendgreeting' | ||
| $fullSampleCopyPath = Join-Path $sampleCopy 'cmdlet-example' | ||
| $powershell = (Get-Process -id $PID).MainModule.FileName | ||
| if(!(Test-Path $sampleCopy)) | ||
| { | ||
| New-Item -ItemType Directory -Path $sampleCopy | ||
| } | ||
|
|
||
| Copy-Item -Recurse -Path $docLocation -Destination $sampleCopy -Force | ||
| Get-ChildItem -Recurse $sampleCopy | %{ Write-Verbose "sc: $($_.FullName)"} | ||
|
|
||
| $pesterCommand = "Invoke-Pester $sampleCopy -PassThru" | ||
| if($global:__PesterTags) | ||
| { | ||
| $pesterCommand += " -Tag $(@($global:__PesterTags) -join ',')" | ||
| } | ||
|
|
||
| if($global:__PesterExcludeTags) | ||
| { | ||
| $pesterCommand += " -ExcludeTag $(@($global:__PesterExcludeTags) -join ',')" | ||
| } | ||
|
|
||
| $importPesterCommand = 'Import-module Pester' | ||
| if($isCore) | ||
| { | ||
| $importPesterCommand = "Import-Module $(Join-Path -path $PSHOME -child '/Modules/Pester')" | ||
| } | ||
|
|
||
| $command = @" | ||
| Push-Location -Path $fullSampleCopyPath | ||
| $importPesterCommand | ||
| $pesterCommand | Export-Clixml -Path $testResultPath | ||
| "@ | ||
|
|
||
| Write-Verbose -Message "command: '$command'" | ||
| $bytes = [System.Text.Encoding]::Unicode.GetBytes($command) | ||
| $encodedCommand = [Convert]::ToBase64String($bytes) | ||
| &$powershell -encodedCommand $encodedCommand | ||
|
|
||
| it "Should have test results file" { | ||
| $testResultPath | should exist | ||
| $script:results = Import-Clixml $testResultPath | ||
| } | ||
|
|
||
| it "Should have test results" { | ||
| $script:results | should not be BeNullOrEmpty | ||
| $script:results.TotalCount | should not BeNullOrEmpty | ||
| $script:results.TestResult.Count | should not BeNullOrEmpty | ||
| } | ||
|
|
||
| it "Should have no failures" { | ||
| $script:results.FailedCount | should be 0 | ||
| } | ||
|
|
||
| foreach($testResult in $script:results.TestResult){ | ||
| Context "Test $($testResult.Name)" { | ||
| it "should have no failure message" { | ||
| $testResult.FailureMessage | should BeNullOrEmpty | ||
| } | ||
| it "should have no stack trace" { | ||
| $testResult.StackTrace | should BeNullOrEmpty | ||
| } | ||
| it "should have no error record" { | ||
| $testResult.ErrorRecord | should BeNullOrEmpty | ||
| } | ||
| it "should have not failed" { | ||
| Write-Verbose "Result: $($testResult.Result)" | ||
| $testResult.Result | should not be Failed | ||
| } | ||
| } | ||
| } | ||
|
|
||
| } finally { | ||
| Pop-Location | ||
| } | ||
|
|
||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a test?