-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Support running tests in root privilege on Linux. #6145
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
Changes from 1 commit
13848a5
ee7227d
466c8c7
31fe5f1
07ae3f7
65b85d3
e53399e
42113a7
e43ddfa
0a7bdbb
2130477
573d91b
a2db089
08736e3
b328b62
dc404aa
554a23b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -200,12 +200,16 @@ elseif($Stage -eq 'Build') | |
| $ProgressPreference = $originalProgressPreference | ||
| } | ||
|
|
||
| $testResultsNoSudo = "$pwd\TestResultsNoSudo.xml" | ||
| $testResultsSudo = "$pwd\TestResultsSudo.xml" | ||
|
|
||
| $pesterParam = @{ | ||
| 'binDir' = $output | ||
| 'PassThru' = $true | ||
| 'Terse' = $true | ||
| 'Tag' = @() | ||
| 'ExcludeTag' = @('RequireSudoOnUnix') | ||
| 'OutputFile' = $testResultsNoSudo | ||
| } | ||
|
|
||
| if ($isFullBuild) { | ||
|
|
@@ -228,18 +232,19 @@ elseif($Stage -eq 'Build') | |
| } | ||
|
|
||
| # Running tests which do not require sudo. | ||
| $pesterPassThruNoSudoObject = Start-PSPester @pesterParam | ||
| Start-PSPester @pesterParam | ||
|
|
||
| # Running tests, which require sudo. | ||
| pesterParam['Tag'] = @('RequireSudoOnUnix') | ||
| pesterParam['ExcludeTag'] = @() | ||
| pesterParam['Sudo'] = $true | ||
| $pesterPassThruSudoObject = Start-PSPester @pesterParam | ||
| pesterParam['OutputFile'] = $testResultsSudo | ||
| Start-PSPester @pesterParam | ||
|
|
||
| # Determine whether the build passed | ||
| try { | ||
| # this throws if there was an error | ||
| @($pesterPassThruNoSudoObject, $pesterPassThruSudoObject) | ForEach-Object { Test-PSPesterResults -ResultObject $_ } | ||
| @($testResultsNoSudo, $testResultsSudo) | ForEach-Object { Test-PSPesterResults -TestResultsFile $_ } | ||
|
||
| $result = "PASS" | ||
| } | ||
| catch { | ||
|
|
||
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.
you need to specify two different values for '-OutputFile' and update https://github.com/PowerShell/PowerShell/blob/master/.travis.yml#L19 to upload both files
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.
Do we want to store the test results in output files as in ./tools/appveyor.psm1? Currently they are stored in variables ($pesterPassThruNoSudoObject, $pesterPassThruNSudoObject) and there was no -OutputFile specified for Start-PSPester cmdlet in travis.ps1
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.
OutputFile has a default. travis.yml is assuming the default