Re-balance CI tests (#11420)

This commit is contained in:
Ilya
2020-01-05 13:01:42 +05:00
committed by GitHub
parent b221c2afa2
commit 99cf9fd859
8 changed files with 16 additions and 15 deletions
@@ -51,7 +51,7 @@ Describe "Job Cmdlet Tests" -Tag "CI" {
}
Context "jobs which take time" {
BeforeEach {
$j = Start-Job -ScriptBlock { Start-Sleep -Seconds 15 }
$j = Start-Job -ScriptBlock { Start-Sleep -Seconds 8 }
}
AfterEach {
Get-Job | Remove-Job -Force
@@ -19,7 +19,7 @@ Describe 'Get-WinEvent' -Tags "CI" {
$result | Should -Not -BeNullOrEmpty
}
It 'Get-WinEvent can get a provider by name' {
$providers = Get-WinEvent -listprovider * -erroraction ignore
$providers = Get-WinEvent -listprovider MSI* -erroraction ignore
$result = Get-WinEvent -listprovider ($providers[0].name)
$result | Should -Not -BeNullOrEmpty
}
@@ -282,14 +282,13 @@ Describe "Basic FileSystem Provider Tests" -Tags "CI" {
Context "Appx path" {
BeforeAll {
$skipTest = $true
if ($IsWindows -and (Get-Command -Name Get-AppxPackage) -and (Get-AppxPackage Microsoft.WindowsCalculator)) {
$skipTest = $false
if ($IsWindows -and (Get-Command -Name Get-AppxPackage) ) {
$pkgDir = (Get-AppxPackage Microsoft.WindowsCalculator -ErrorAction SilentlyContinue).InstallLocation
$skipTest = $pkgDir -eq $null
}
}
It "Can get an appx package item" -Skip:$skipTest {
$pkgDir = (Get-AppxPackage)[0].InstallLocation
Get-Item $pkgDir\Calculator.exe -ErrorAction Stop | Should -BeOfType [System.IO.FileInfo]
Get-Item -Path $pkgDir -ErrorAction Stop | Should -BeOfType [System.IO.DirectoryInfo]
Get-ChildItem -Path $pkgDir -ErrorAction Stop | Should -Not -BeNullOrEmpty
@@ -58,10 +58,10 @@ Describe "Serialization Tests" -tags "CI" {
$objs1 = [byte]0, [byte]1, [byte]2, [byte]3, [byte]255
$objs2 = @()
$objs3 = [byte]128
$objs4 = @()
for($i=0;$i -lt 256;$i++)
$objs4 = [System.Byte[]]::new(256)
for($i=0; $i -lt 256; $i++)
{
$objs4 += [byte]$i
$objs4[$i] = [byte]$i
}
$objsArray = New-Object System.Collections.ArrayList
$objsArray.Add($objs1)
@@ -1,6 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe 'Task-based PowerShell async APIs' -Tags 'CI' {
Describe 'Task-based PowerShell async APIs' -Tags 'Feature' {
BeforeAll {
$sbStub = @'
.foreach{
@@ -10,7 +11,7 @@ Describe 'Task-based PowerShell async APIs' -Tags 'CI' {
ThreadId = [System.Threading.Thread]::CurrentThread.ManagedThreadId
RunspaceId = [runspace]::DefaultRunspace.Id
}
Start-Sleep -Milliseconds 500
Start-Sleep -Milliseconds 250
}
'@
}
@@ -124,7 +124,7 @@ Describe "Verify approved aliases list" -Tags "CI" {
"Alias", "npssc", "New-PSSessionConfigurationFile", $($FullCLR ), "ReadOnly", "", ""
"Alias", "nsn", "New-PSSession", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "", ""
"Alias", "nv", "New-Variable", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", ""
"Alias", "nwsn", "New-PSWorkflowSession", $($FullCLR -or $CoreWindows ), "", "", ""
"Alias", "nwsn", "New-PSWorkflowSession", $($FullCLR ), "", "", ""
"Alias", "ogv", "Out-GridView", $($FullCLR -or $CoreWindows ), "ReadOnly", "", ""
"Alias", "oh", "Out-Host", $($FullCLR -or $CoreWindows -or $CoreUnix), "ReadOnly", "", ""
"Alias", "popd", "Pop-Location", $($FullCLR -or $CoreWindows -or $CoreUnix), "", "AllScope", ""
@@ -496,7 +496,7 @@ Describe "Verify approved aliases list" -Tags "CI" {
# We control only default engine aliases (Source -eq "") and aliases from following default loaded modules
# We control only default engine Cmdlets (Source -eq "") and Cmdlets from following default loaded modules
$moduleList = @("Microsoft.PowerShell.Utility", "Microsoft.PowerShell.Management", "Microsoft.PowerShell.Security", "Microsoft.PowerShell.Host", "Microsoft.PowerShell.Diagnostics", "PSWorkflow", "Microsoft.WSMan.Management", "Microsoft.PowerShell.Core")
$moduleList = @("Microsoft.PowerShell.Utility", "Microsoft.PowerShell.Management", "Microsoft.PowerShell.Security", "Microsoft.PowerShell.Host", "Microsoft.PowerShell.Diagnostics", "Microsoft.WSMan.Management", "Microsoft.PowerShell.Core")
$getAliases = {
param($moduleList)
@@ -1,6 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe 'Online help tests for PowerShell Cmdlets' -Tags "CI" {
Describe 'Online help tests for PowerShell Cmdlets' -Tags "Feature" {
# The csv files (V2Cmdlets.csv and V3Cmdlets.csv) contain a list of cmdlets and expected HelpURIs.
# The HelpURI is part of the cmdlet metadata, and when the user runs 'get-help <cmdletName> -online'
+1 -1
View File
@@ -1,7 +1,7 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Describe 'Basic Job Tests' -Tags 'CI' {
Describe 'Basic Job Tests' -Tags 'Feature' {
BeforeAll {
# Make sure we do not have any jobs running
Get-Job | Remove-Job -Force