changes tags for tests

Start using tags CI, Feature, Scenario
This commit is contained in:
James Truher committed 2016-07-27 12:06:51 -07:00
1 parent 1349372b39
commit 9e225ccae2
145 files changed
+233 -233

No files matched your search

@@ -1,4 +1,4 @@
Describe "Configuration file locations" {
Describe "Configuration file locations" -tags "CI" {
BeforeAll {
$powershell = Join-Path -Path $PsHome -ChildPath "powershell"
+1 -1
View File
@@ -1,6 +1,6 @@
using namespace System.Diagnostics
Describe "ConsoleHost unit tests" {
Describe "ConsoleHost unit tests" -tags "Feature" {
BeforeAll {
$powershell = Join-Path -Path $PsHome -ChildPath "powershell"
@@ -1,4 +1,4 @@
Describe "PSVersionTable" {
Describe "PSVersionTable" -Tags "CI" {
It "Should have version table entries" {
$PSVersionTable.Count | Should Be 9
}
+1 -1
View File
@@ -1,4 +1,4 @@
Describe "Read-Host" {
Describe "Read-Host" -Tags "CI" {
Context "[Console]::ReadKey() implementation on non-Windows" {
BeforeAll {
$powershell = Join-Path -Path $PsHome -ChildPath "powershell"
@@ -1,4 +1,4 @@
Describe "Issue#682 - [system.manage<tab>] should work" {
Describe "Issue#682 - [system.manage<tab>] should work" -Tags "CI" {
It "[system.manage<tab>" {
$result = TabExpansion2 -inputScript "[system.manage" -cursorColumn "[system.manage".Length
@@ -1,4 +1,4 @@
Describe 'Break statements with classes' -Tags "DRT" {
Describe 'Break statements with classes' -Tags "CI" {
function Get-Errors([string]$sourceCode) {
$tokens = $null
@@ -224,7 +224,7 @@ $canaryHashtable['canary'] += 100
}
}
Describe "Exception error position" -Tags "DRT" {
Describe "Exception error position" -Tags "CI" {
class MSFT_3090412
{
static f1() { [MSFT_3090412]::bar = 42 }
@@ -1,4 +1,4 @@
Describe 'Misc Test' -Tags "innerloop", "DRT" {
Describe 'Misc Test' -Tags "CI" {
Context 'Where' {
class C1 {
@@ -1,11 +1,11 @@
Describe 'PSModuleInfo.GetExportedTypeDefinitions()' {
Describe 'PSModuleInfo.GetExportedTypeDefinitions()' -Tags "CI" {
It "doesn't throw for any module" {
$discard = Get-Module -ListAvailable | % { $_.GetExportedTypeDefinitions() }
$true | Should Be $true # we only verify that we didn't throw. This line contains a dummy Should to make pester happy.
}
}
Describe 'use of a module from two runspaces' {
Describe 'use of a module from two runspaces' -Tags "CI" {
function New-TestModule {
param(
[string]$Name,
@@ -1,4 +1,4 @@
Describe 'NestedModules' -Tags "DRT" {
Describe 'NestedModules' -Tags "CI" {
Import-Module $PSScriptRoot\..\LanguageTestSupport.psm1
@@ -4,7 +4,7 @@
Import-Module $PSScriptRoot\..\LanguageTestSupport.psm1
Describe 'Classes inheritance syntax' -Tags "DRT" {
Describe 'Classes inheritance syntax' -Tags "CI" {
It 'Base types' {
class C1 {}
@@ -2,7 +2,7 @@
# Copyright (c) Microsoft Corporation, 2015
#
Describe 'enums' -Tags "DRT" {
Describe 'enums' -Tags "CI" {
Context 'basic enums' {
enum E1
@@ -1,4 +1,4 @@
Describe "DotNetAPI" {
Describe "DotNetAPI" -Tags "CI" {
$posh_E = 2.718281828459045
$posh_pi = 3.14159265358979
@@ -1,4 +1,4 @@
Describe ".NET class interoperability" {
Describe ".NET class interoperability" -Tags "CI" {
It "Should access types in System.Console" {
[System.Console]::TreatControlCAsInput | Should Be $false
}
@@ -1,4 +1,4 @@
Describe "ComparisonOperator" {
Describe "ComparisonOperator" -tag "CI" {
It "Should be $true for 1 -lt 2" {
1 -lt 2 | Should Be $true
}
@@ -1,5 +1,5 @@
using Namespace System.Management.Automation.Language
Describe "The SafeGetValue method on AST returns safe values" -Tags "DRT" {
Describe "The SafeGetValue method on AST returns safe values" -Tags "CI" {
It "A hashtable is returned from a HashtableAst" {
$HashtableAstType = [HashtableAst]
$HtAst = {
@@ -1,5 +1,5 @@
Describe 'Automatic variable $input' {
Describe 'Automatic variable $input' -Tags "CI" {
It '$input Type should be enumerator' {
function from_begin { [cmdletbinding()]param() begin { Write-Output -NoEnumerate $input } }
function from_process { [cmdletbinding()]param() process { Write-Output -NoEnumerate $input } }
@@ -32,7 +32,7 @@ $typeDefinition += "`n}"
Write-Verbose $typeDefinition
Add-Type $typeDefinition
Describe "bnot on enums" -Tags "DRT" {
Describe "bnot on enums" -Tags "CI" {
foreach ($enumType in [type[]]$enumTypeNames)
{
Context $enumType.Name {
@@ -63,7 +63,7 @@ Describe "bnot on enums" -Tags "DRT" {
}
}
Describe "bnot on integral types" -Tags "DRT" {
Describe "bnot on integral types" -Tags "CI" {
foreach ($baseType in $baseTypes.Keys)
{
Context $baseType.Name {
@@ -1,4 +1,4 @@
Describe 'conversion syntax' -Tags "innerloop", "DRT" {
Describe 'conversion syntax' -Tags "CI" {
# these test suite covers ([<type>]<expression>).<method>() syntax.
# it mixes two purposes: casting and super-class method calls.
@@ -1,4 +1,4 @@
Describe "Redirection operator now supports encoding changes" {
Describe "Redirection operator now supports encoding changes" -Tags "CI" {
BeforeAll {
$asciiString = "abc"
@@ -1,5 +1,5 @@
Describe "Type accelerators" -Tags "DRT" {
Describe "Type accelerators" -Tags "CI" {
$TypeAcceleratorsType = [psobject].Assembly.GetType("System.Management.Automation.TypeAccelerators")
$TypeAccelerators = $TypeAcceleratorsType::Get
@@ -61,7 +61,7 @@ class C2
#[ElapsedEventHandler][CompilerGeneratedAttribute()]$EventHandler
}
Describe "Using Namespace" -Tags "DRT" {
Describe "Using Namespace" -Tags "CI" {
It "Type literals w/ using namespace" {
[Thread].FullName | Should Be System.Threading.Thread
[Int32].FullName | Should Be System.Int32
@@ -4,7 +4,7 @@
## Script debugging tests
##
Describe "Breakpoints set on custom FileSystem provider files should work" -tags 'Innerloop', 'DRT' {
Describe "Breakpoints set on custom FileSystem provider files should work" -Tags "CI" {
#
# <Test>
# <TestType>DRT</TestType>
@@ -54,7 +54,7 @@ Describe "Breakpoints set on custom FileSystem provider files should work" -tags
}
Describe "Tests line breakpoints on dot-sourced files" -tags 'Innerloop', 'DRT' {
Describe "Tests line breakpoints on dot-sourced files" -Tags "CI" {
#
# <Test>
# <TestType>DRT</TestType>
@@ -109,7 +109,7 @@ Describe "Tests line breakpoints on dot-sourced files" -tags 'Innerloop', 'DRT'
}
Describe "Function calls clear debugger cache too early" -tags 'Innerloop', 'DRT' {
Describe "Function calls clear debugger cache too early" -Tags "CI" {
#
# <Test>
# <TestType>DRT</TestType>
@@ -164,7 +164,7 @@ Describe "Function calls clear debugger cache too early" -tags 'Innerloop', 'DRT
}
Describe "Line breakpoints on commands in multi-line pipelines" -tags 'Innerloop', 'DRT' {
Describe "Line breakpoints on commands in multi-line pipelines" -Tags "CI" {
#
# <Test>
# <TestType>DRT</TestType>
@@ -249,7 +249,7 @@ Describe "Line breakpoints on commands in multi-line pipelines" -tags 'Innerloop
}
Describe "Unit tests for various script breakpoints" -tags 'Innerloop', 'DRT' {
Describe "Unit tests for various script breakpoints" -Tags "CI" {
#
# <Test>
# <TestType>DRT</TestType>
@@ -416,7 +416,7 @@ Describe "Unit tests for various script breakpoints" -tags 'Innerloop', 'DRT' {
}
Describe "Unit tests for line breakpoints on dot-sourced files" -tags 'Innerloop', 'P1' {
Describe "Unit tests for line breakpoints on dot-sourced files" -Tags "CI" {
#
# <Test>
# <TestType>PriorityOne</TestType>
@@ -504,7 +504,7 @@ Describe "Unit tests for line breakpoints on dot-sourced files" -tags 'Innerloop
}
Describe "Unit tests for line breakpoints on modules" -tags 'Innerloop', 'DRT' {
Describe "Unit tests for line breakpoints on modules" -Tags "CI" {
#
# <Test>
# <TestType>DRT</TestType>
@@ -609,7 +609,7 @@ Describe "Unit tests for line breakpoints on modules" -tags 'Innerloop', 'DRT' {
}
Describe "Sometimes line breakpoints are ignored" -tags 'Innerloop', 'DRT' {
Describe "Sometimes line breakpoints are ignored" -Tags "CI" {
#####################################################################################
#
# <Test>
@@ -4,7 +4,7 @@
## Debugging in Host tests
##
Describe "Tests Debugger GetCallStack() on runspaces when attached to a WinRM host process" -Tags 'InnerLoop','P1' {
Describe "Tests Debugger GetCallStack() on runspaces when attached to a WinRM host process" -Tags "CI" {
It -skip "Disabled test because it is fragile and does not consistently succeed on test VMs" { }
return
@@ -1,4 +1,4 @@
Describe 'Get-CimClass' {
Describe 'Get-CimClass' -tags "CI" {
# Get-CimClass works only on windows
It 'can get CIM_Error CIM class' -Skip:(-not $IsWindows) {
Get-CimClass -ClassName CIM_Error | Should Not Be $null
@@ -1,4 +1,4 @@
Describe "Import-Module" {
Describe "Import-Module" -Tags "CI" {
$moduleName = "Microsoft.PowerShell.Security"
BeforeEach {
@@ -1,4 +1,4 @@
Describe "Remove-Module" {
Describe "Remove-Module" -Tags "CI" {
$moduleName = "Microsoft.PowerShell.Security"
BeforeEach {
@@ -1,4 +1,4 @@
Describe "Set-PSDebug" {
Describe "Set-PSDebug" -Tags "CI" {
Context "Tracing can be used" {
AfterEach {
Set-PSDebug -Off
@@ -1,4 +1,4 @@
Describe 'Get-WinEvent' {
Describe 'Get-WinEvent' -Tags "CI" {
# Get-WinEvent works only on windows
It 'can query a System log' -Skip:(-not $IsWindows) {
@@ -1,4 +1,4 @@
Describe "Add-Content cmdlet tests" -Tags:DRT {
Describe "Add-Content cmdlet tests" -Tags "CI" {
$file1 = "file1.txt"
Setup -File "$file1"
@@ -1,4 +1,4 @@
Describe "Clear-Content cmdlet tests" -Tags:DRT {
Describe "Clear-Content cmdlet tests" -Tags "CI" {
$file1 = "file1.txt"
Setup -File "$file1"
@@ -5,7 +5,7 @@ if ($IsWindows -and !$IsCoreCLR) {
if ($windowsPrincipal.IsInRole("Administrators") -eq $true) {
$NonWinAdmin=$false
} else {$NonWinAdmin=$true}
Describe "Clear-EventLog cmdlet tests" -Tags:DRT {
Describe "Clear-EventLog cmdlet tests" -Tags "CI" {
#DRT - CmdLet is NYI - change to -Skip:($NonWinAdmin) when implemented
It "should be able to Clear-EventLog" -Pending:($True -Or $NonWinAdmin) {
Remove-EventLog -LogName TestLog -ea Ignore
@@ -1,4 +1,4 @@
Describe "Get-ChildItem" {
Describe "Get-ChildItem" -Tags "CI" {
It "Should list the contents of the current folder" {
(Get-ChildItem .).Name.Length | Should BeGreaterThan 0
}
@@ -1,4 +1,4 @@
Describe "Get-Content" -Tags:DRT {
Describe "Get-Content" -Tags "CI" {
$testString = "This is a test content for a file"
$nl = [Environment]::NewLine
$firstline = "Here's a first line "
@@ -5,7 +5,7 @@
if ($windowsPrincipal.IsInRole("Administrators") -eq $true) {
$NonWinAdmin=$false
} else {exit}
Describe "Get-EventLog cmdlet tests" -Tags:DRT {
Describe "Get-EventLog cmdlet tests" -Tags "CI" {
#CmdLets are not yet implemented, so these cases are -Pending:($True) for now...
It "should return an array of eventlogs objects when called with -AsString parameter" -Pending:($True) {
{$result=Get-EventLog -AsString -ea stop} | Should Not Throw
@@ -1,4 +1,4 @@
Describe "Get-Item" {
Describe "Get-Item" -Tags "CI" {
It "Should list all the items in the current working directory when asterisk is used" {
(Get-Item (Join-Path -Path $PSScriptRoot -ChildPath "*")).GetType().BaseType | Should Be 'array'
(Get-Item (Join-Path -Path $PSScriptRoot -ChildPath "*")).GetType().Name | Should Be 'Object[]'
@@ -1,4 +1,4 @@
Describe "Get-ItemProperty" {
Describe "Get-ItemProperty" -Tags "CI" {
$currentDirectory = Split-Path $PSScriptRoot -Leaf
$parentDirectory = Split-Path (Join-Path -Path $PSScriptRoot -ChildPath "..") -Leaf
$tempDirectory = $TestDrive
@@ -1,4 +1,4 @@
Describe "Get-Location" {
Describe "Get-Location" -Tags "CI" {
$currentDirectory=[System.IO.Directory]::GetCurrentDirectory()
BeforeEach {
pushd $currentDirectory
@@ -1,4 +1,4 @@
Describe "Get-PSDrive" {
Describe "Get-PSDrive" -Tags "CI" {
It "Should not throw" {
Get-PSDrive | Should Not BeNullOrEmpty
@@ -1,4 +1,4 @@
Describe "Get-PSProvider" {
Describe "Get-PSProvider" -Tags "CI" {
It "Should be able to call with no parameters without error" {
{ Get-PSProvider } | Should Not Throw
}
@@ -1,4 +1,4 @@
Describe "Get-Process" {
Describe "Get-Process" -Tags "CI" {
It "Should support -IncludeUserName" {
(Get-Process powershell -IncludeUserName | Select-Object -First 1).UserName | Should Match $env:USERNAME
}
@@ -1,4 +1,4 @@
Describe "Hierarchical paths" {
Describe "Hierarchical paths" -Tags "CI" {
BeforeAll {
$data = "Hello World"
Setup -File testFile.txt -Content $data
@@ -1,4 +1,4 @@
Describe "Join-Path cmdlet tests" -Tags DRT {
Describe "Join-Path cmdlet tests" -Tags "CI" {
$SepChar=[io.path]::DirectorySeparatorChar
BeforeAll {
$StartingLocation = Get-Location
@@ -5,7 +5,7 @@
if ($windowsPrincipal.IsInRole("Administrators") -eq $true) {
$NonWinAdmin=$false
} else {$NonWinAdmin=$true}
Describe "New-EventLog cmdlet tests" -Tags DRT {
Describe "New-EventLog cmdlet tests" -Tags "CI" {
BeforeEach {
Remove-EventLog -LogName TestLog -ea Ignore
}
@@ -16,7 +16,7 @@ function Clean-State
}
}
Describe "New-Item" {
Describe "New-Item" -Tags "CI" {
$tmpDirectory = $TestDrive
$testfile = "testfile.txt"
$testfolder = "newDirectory"
@@ -1,4 +1,4 @@
Describe "Pop-Location" {
Describe "Pop-Location" -Tags "CI" {
$startDirectory = $(Get-Location).Path
BeforeEach { Set-Location $startDirectory }
@@ -1,4 +1,4 @@
Describe "Test-Push-Location" {
Describe "Test-Push-Location" -Tags "CI" {
New-Variable -Name startDirectory -Value $(Get-Location).Path -Scope Global -Force
BeforeEach { cd $startDirectory }
@@ -5,7 +5,7 @@
if ($windowsPrincipal.IsInRole("Administrators") -eq $true) {
$NonWinAdmin=$false
} else {$NonWinAdmin=$true}
Describe "New-EventLog cmdlet tests" -Tags DRT {
Describe "New-EventLog cmdlet tests" -Tags "CI" {
BeforeEach{
Remove-EventLog -LogName TestLog -ea Ignore
{New-EventLog -LogName TestLog -Source TestSource -ea Stop} | Should Not Throw
@@ -1,4 +1,4 @@
Describe "Remove-Item" {
Describe "Remove-Item" -Tags "CI" {
$testpath = $TestDrive
$testfile = "testfile.txt"
$testfilepath = Join-Path -Path $testpath -ChildPath $testfile
@@ -1,4 +1,4 @@
Describe "Set-Content cmdlet tests" -Tags:DRT {
Describe "Set-Content cmdlet tests" -Tags "CI" {
$file1 = "file1.txt"
Setup -File "$file1" -Content $file1
Context "Set-Content should actually set content" {
@@ -1,4 +1,4 @@
Describe "Set-Location" {
Describe "Set-Location" -Tags "CI" {
$startDirectory = Get-Location
if ($IsWindows)
@@ -1,4 +1,4 @@
Describe "Split-Path" {
Describe "Split-Path" -Tags "CI" {
It "Should return a string object when invoked" {
( Split-Path . ).GetType().Name | Should Be "String"
@@ -1,4 +1,4 @@
Describe "Start-Process" {
Describe "Start-Process" -Tags @("CI","SLOW") {
$pingCommand = (Get-Command -CommandType Application ping)[0].Definition
$pingDirectory = Split-Path $pingCommand -Parent
$tempFile = Join-Path -Path $TestDrive -ChildPath PSTest
@@ -1,4 +1,4 @@
Describe "Test-Path" {
Describe "Test-Path" -Tags "CI" {
BeforeAll {
$testdirectory = $TestDrive
$testfilename = New-Item -path $testdirectory -Name testfile.txt -ItemType file -Value 1 -force
@@ -28,7 +28,7 @@ function Assert-ListsSame
}
}
Describe "Get-Timezone test case no switches" -tags 'BVT' {
Describe "Get-Timezone test case no switches" -Tags "CI" {
It "Call without ListAvailable switch returns current TimeZoneInfo" {
$observed = (Get-TimeZone).Id
$expected = ([System.TimeZoneInfo]::Local).Id
@@ -36,7 +36,7 @@ Describe "Get-Timezone test case no switches" -tags 'BVT' {
}
}
Describe "Get-Timezone test cases" -tags 'Innerloop','RI' {
Describe "Get-Timezone test cases" -Tags "CI" {
It "Call without ListAvailable switch returns an object of type TimeZoneInfo" {
$result = (Get-TimeZone).GetType().Name
@@ -118,7 +118,7 @@ Describe "Get-Timezone test cases" -tags 'Innerloop','RI' {
}
}
Describe "Set-Timezone test case: call by single Id" -tags 'BVT' {
Describe "Set-Timezone test case: call by single Id" -Tags "CI" {
$originalTimeZoneId
BeforeAll {
$originalTimeZoneId = (Get-TimeZone).Id
@@ -145,7 +145,7 @@ Describe "Set-Timezone test case: call by single Id" -tags 'BVT' {
}
}
Describe "Set-Timezone test cases" -tags 'Innerloop','RI' {
Describe "Set-Timezone test cases" -Tags "Feature" {
$originalTimeZoneId
BeforeAll {
$originalTimeZoneId = (Get-TimeZone).Id
@@ -1,4 +1,4 @@
Describe "ExecutionPolicy" {
Describe "ExecutionPolicy" -Tags "CI" {
Context "Check Get-ExecutionPolicy behavior" {
It "Should unrestricted when not on Windows" -Skip:$IsWindows {
@@ -7,7 +7,7 @@ if ($IsWindows) {
$script:catalogPath = ""
Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "Innerloop","BVT" {
Describe "Test suite for NewFileCatalogAndTestFileCatalogCmdlets" -Tags "CI" {
#compare two hashtables
function CompareHashTables
@@ -1,4 +1,4 @@
Describe "Add-Member DRT Unit Tests" -Tags DRT{
Describe "Add-Member DRT Unit Tests" -Tags "CI" {
It "Mandatory parameters should not be null nor empty" {
# when Name is null
@@ -278,7 +278,7 @@
}
}
Describe "Add-Member" {
Describe "Add-Member" -Tags "CI" {
It "should be able to see a newly added member of an object" {
$o = New-Object psobject
@@ -1,6 +1,6 @@
$guid = [Guid]::NewGuid().ToString().Replace("-","")
Describe "Add-Type" {
Describe "Add-Type" -Tags "CI" {
It "Should not throw given a simple class definition" {
{ Add-Type -TypeDefinition "public static class foo { }" } | Should Not Throw
}
@@ -1,4 +1,4 @@
Describe "Clear-Variable DRT Unit Tests" -Tags DRT{
Describe "Clear-Variable DRT Unit Tests" -Tags "CI" {
It "Clear-Variable normal variable Name should works"{
Set-Variable foo bar
Clear-Variable -Name foo
@@ -97,7 +97,7 @@ Describe "Clear-Variable DRT Unit Tests" -Tags DRT{
}
}
Describe "Clear-Variable" {
Describe "Clear-Variable" -Tags "CI" {
BeforeEach {
$var1 = 3
}
@@ -1,4 +1,4 @@
Describe "Compare-Object" {
Describe "Compare-Object" -Tags "CI" {
BeforeAll {
$nl = [Environment]::NewLine
@@ -120,7 +120,7 @@ Describe "Compare-Object" {
}
}
Describe "Compare-Object DRT basic functionality" -Tags DRT{
Describe "Compare-Object DRT basic functionality" -Tags "CI" {
if(-not ([System.Management.Automation.PSTypeName]'Employee').Type)
{
Add-Type -TypeDefinition @"
@@ -1,6 +1,6 @@
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
Describe "ConvertFrom-Csv" {
Describe "ConvertFrom-Csv" -Tags "CI" {
$testObject = "a", "1"
$testcsv = Join-Path -Path (Join-Path -Path $here -ChildPath assets) -ChildPath TestCsv2.csv
$testName = "Zaphod BeebleBrox"
@@ -51,7 +51,7 @@ a,b,c
}
}
Describe "ConvertFrom-Csv DRT Unit Tests" -Tags DRT{
Describe "ConvertFrom-Csv DRT Unit Tests" -Tags "CI" {
It "Test ConvertFrom-Csv with pipelined InputObject and Header" {
$inputObject = [pscustomobject]@{ First = 1; Second = 2 }
$res = $inputObject | ConvertTo-Csv
@@ -1,4 +1,4 @@
Describe "ConvertFrom-StringData DRT Unit Tests" -Tags DRT {
Describe "ConvertFrom-StringData DRT Unit Tests" -Tags "CI" {
It "Should able to throw error when convert invalid line" {
$str =@"
#comments here
@@ -18,7 +18,7 @@ def=content of def
}
}
Describe "ConvertFrom-StringData" {
Describe "ConvertFrom-StringData" -Tags "CI" {
$sampleData = @'
foo = 0
bar = 1
@@ -1,4 +1,4 @@
Describe "ConvertTo-Csv DRT Unit Tests" -Tags DRT{
Describe "ConvertTo-Csv DRT Unit Tests" -Tags "CI" {
$inputObject = [pscustomobject]@{ First = 1; Second = 2 }
It "Test convertto-csv with psobject pipelined" {
@@ -35,7 +35,7 @@ Describe "ConvertTo-Csv DRT Unit Tests" -Tags DRT{
}
}
Describe "ConvertTo-Csv" {
Describe "ConvertTo-Csv" -Tags "CI" {
$Name = "Hello"; $Data = "World";
$testObject = New-Object psobject -Property @{ FirstColumn = $Name; SecondColumn = $Data }
@@ -1,4 +1,4 @@
Describe "ConvertTo-SecureString" {
Describe "ConvertTo-SecureString" -Tags "CI" {
Context "Checking return types of ConvertTo-SecureString" {
@@ -1,4 +1,4 @@
Describe "ConvertTo-Xml DRT Unit Tests" -Tags DRT{
Describe "ConvertTo-Xml DRT Unit Tests" -Tags "CI" {
$customPSObject = [pscustomobject]@{ "prop1" = "val1"; "prop2" = "val2" }
$newLine = [System.Environment]::NewLine
It "Test convertto-xml with a depth parameter" {
@@ -1,6 +1,6 @@
$removeAliasList = @("ac","compare","cpp","diff","sleep","sort","start","cat","cp","ls","man","mount","mv","ps","rm","rmdir")
$keepAliasList = @{cd="Set-Location"},@{dir="Get-ChildItem"},@{echo="Write-output"},@{fc="format-custom"},@{kill="stop-process"},@{clear="clear-host"}
Describe "Windows aliases do not conflict with Linux commands" {
Describe "Windows aliases do not conflict with Linux commands" -Tags "CI" {
foreach ($alias in $removeAliasList) {
It "Should not have certain aliases on Linux" -Skip:$IsWindows {
Test-Path Alias:$alias | Should Be $false
@@ -1,4 +1,4 @@
Describe "Environment-Variables" {
Describe "Environment-Variables" -Tags "CI" {
It "Should have environment variables" {
Get-Item ENV: | Should Not BeNullOrEmpty
@@ -1,4 +1,4 @@
Describe "Export-Alias DRT Unit Tests" -Tags DRT{
Describe "Export-Alias DRT Unit Tests" -Tags "CI" {
$testAliasDirectory = Join-Path -Path $TestDrive -ChildPath ExportAliasTestDirectory
$testAliases = "TestAliases"
$fulltestpath = Join-Path -Path $testAliasDirectory -ChildPath $testAliases
@@ -124,7 +124,7 @@ Describe "Export-Alias DRT Unit Tests" -Tags DRT{
}
}
Describe "Export-Alias" {
Describe "Export-Alias" -Tags "CI" {
$testAliasDirectory = Join-Path -Path $TestDrive -ChildPath ExportAliasTestDirectory
$testAliases = "TestAliases"
$fulltestpath = Join-Path -Path $testAliasDirectory -ChildPath $testAliases
@@ -1,4 +1,4 @@
Describe "Export-Csv" {
Describe "Export-Csv" -Tags "CI" {
$testObject = @("test","object","array")
$testCsv = "output.csv"
@@ -65,7 +65,7 @@ Describe "Export-Csv" {
}
}
Describe "Export-Csv DRT Unit Tests" -Tags DRT{
Describe "Export-Csv DRT Unit Tests" -Tags "CI" {
$filePath = Join-Path $TestDrive -ChildPath "test.csv"
$newLine = [environment]::NewLine
It "Test basic function works well" {
@@ -1,4 +1,4 @@
Describe "Export-FormatData DRT Unit Tests" -Tags DRT{
Describe "Export-FormatData DRT Unit Tests" -Tags "CI" {
It "Test basic functionality" {
$fd = Get-FormatData
$tempFile = Join-Path $TestDrive -ChildPath "exportFormatTest.txt"
@@ -14,7 +14,7 @@ Describe "Export-FormatData DRT Unit Tests" -Tags DRT{
}
}
Describe "Export-FormatData" {
Describe "Export-FormatData" -Tags "CI" {
Context "Check Export-FormatData can be called validly." {
It "Should be able to be called without error" {
@@ -1,4 +1,4 @@
Describe "Format-Custom" {
Describe "Format-Custom" -Tags "CI" {
Context "Check Format-Custom aliases" {
@@ -25,7 +25,7 @@ Describe "Format-Custom" {
}
Describe "Format-Custom DRT basic functionality" -Tags DRT{
Describe "Format-Custom DRT basic functionality" -Tags "CI" {
Add-Type -TypeDefinition @"
public abstract class NamedItem
{
@@ -1,4 +1,4 @@
Describe "Format-List" {
Describe "Format-List" -Tags "CI" {
$nl = [Environment]::NewLine
BeforeEach {
$in = New-Object PSObject
@@ -67,7 +67,7 @@ Describe "Format-List" {
}
}
Describe "Format-List DRT basic functionality" -Tags DRT{
Describe "Format-List DRT basic functionality" -Tags "CI" {
It "Format-List with array should work" {
$al = (0..255)
$info = @{}
@@ -1,4 +1,4 @@
Describe "Format-Table" {
Describe "Format-Table" -Tags "CI" {
It "Should call format table on piped input without error" {
{ Get-Date | Format-Table } | Should Not Throw
@@ -28,7 +28,7 @@ Describe "Format-Table" {
}
Describe "Format-Table DRT Unit Tests" -Tags DRT{
Describe "Format-Table DRT Unit Tests" -Tags "CI" {
It "Format-Table with not existing table with force should throw PipelineStoppedException"{
$obj = New-Object -typename PSObject
try
@@ -1,4 +1,4 @@
Describe "Format-Wide" {
Describe "Format-Wide" -Tags "CI" {
It "Should have the same output between the alias and the unaliased function" {
$nonaliased = Get-ChildItem | Format-Wide
@@ -39,7 +39,7 @@ Describe "Format-Wide" {
}
}
Describe "Format-Wide DRT basic functionality" -Tags DRT{
Describe "Format-Wide DRT basic functionality" -Tags "CI" {
It "Format-Wide with array should work" {
$al = (0..255)
$info = @{}
@@ -1,5 +1,5 @@
Describe "Get-Alias DRT Unit Tests" -Tags DRT{
Describe "Get-Alias DRT Unit Tests" -Tags "CI" {
It "Get-Alias Bogus Scope Name should throw PSArgumentException"{
try {
Get-Alias -Name "ABCD" -Scope "bogus"
@@ -173,7 +173,7 @@ Describe "Get-Alias DRT Unit Tests" -Tags DRT{
}
}
Describe "Get-Alias" {
Describe "Get-Alias" -Tags "CI" {
It "Should have a return type of System.Array when gal returns more than one object" {
$val1=(Get-Alias a*)
$val2=(Get-Alias c*)
@@ -1,4 +1,4 @@
Describe "Get-Culture DRT Unit Tests" -Tags DRT{
Describe "Get-Culture DRT Unit Tests" -Tags "CI" {
It "Should works proper with get-culture" {
$results = get-Culture
$results -is "System.Globalization.CultureInfo" | Should be $true
@@ -6,7 +6,7 @@ Describe "Get-Culture DRT Unit Tests" -Tags DRT{
}
}
Describe "Get-Culture" {
Describe "Get-Culture" -Tags "CI" {
It "Should return a type of CultureInfo for Get-Culture cmdlet" {
@@ -1,4 +1,4 @@
Describe "Get-Date DRT Unit Tests" -Tags DRT {
Describe "Get-Date DRT Unit Tests" -Tags "CI" {
It "Get-Date with all parameters returns proper results" {
$date = [datetime]::Now + ([timespan]::new(0,0,30))
$result = Get-Date -Date $date -Year 1973 -Month 2 -Day 22 -Hour 15 -Minute 40 -Second 10 -Millisecond 200
@@ -80,7 +80,7 @@ Describe "Get-Date DRT Unit Tests" -Tags DRT {
}
Describe "Get-Date" {
Describe "Get-Date" -Tags "CI" {
It "Should return a DateTime object upon being called" {
(Get-Date).GetType().Name.Equals('DateTime') | Should Be $true
}
@@ -1,4 +1,4 @@
Describe "Get-Event" {
Describe "Get-Event" -Tags "CI" {
BeforeEach {
( New-Event -SourceIdentifier PesterTestEvent -sender Windows.timer -messagedata "PesterTestMessage" )
@@ -1,4 +1,4 @@
Describe "Get-EventSubscriber" {
Describe "Get-EventSubscriber" -Tags "CI" {
AfterEach {
Unregister-Event -SourceIdentifier PesterTestRegister -ErrorAction SilentlyContinue
@@ -1,4 +1,4 @@
Describe "Get-FileHash" {
Describe "Get-FileHash" -Tags "CI" {
New-Variable testDocument -Value (Join-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath assets) -ChildPath testablescript.ps1) -Scope Global -Force
# The MACTripleDES and RIPEMD160 algorithms are unsupported on Linux
$algorithms = @{"SHA1" ="01B865D143E07ECC875AB0EFC0A4429387FD0CF7";
@@ -1,4 +1,4 @@
Describe "Get-FormatData" {
Describe "Get-FormatData" -Tags "CI" {
Context "Check return type of Get-FormatData" {
@@ -1,4 +1,4 @@
Describe "Get-Host DRT Unit Tests" -Tags DRT{
Describe "Get-Host DRT Unit Tests" -Tags "CI" {
It "Should works proper with get-host" {
$results = Get-Host
$results | Should Be $Host
@@ -6,7 +6,7 @@ Describe "Get-Host DRT Unit Tests" -Tags DRT{
}
}
Describe "Get-Host" {
Describe "Get-Host" -Tags "CI" {
It "Should return a type of InternalHost for Get-Host cmdlet" {
(Get-Host).GetType().Name | Should Be InternalHost
@@ -1,4 +1,4 @@
Describe "Get-Member" {
Describe "Get-Member" -Tags "CI" {
It "Should be able to be called on string objects, ints, arrays, etc" {
$a = 1 #test numbers
$b = 1.3
@@ -40,7 +40,7 @@ Describe "Get-Member" {
}
}
Describe "Get-Member DRT Unit Tests" -Tags DRT {
Describe "Get-Member DRT Unit Tests" -Tags "CI" {
Context "Verify Get-Member with Class" {
if(-not ([System.Management.Automation.PSTypeName]'Employee').Type)
{
@@ -1,4 +1,4 @@
Describe "Get-PSBreakpoint" {
Describe "Get-PSBreakpoint" -Tags "CI" {
$scriptName = "Get-PSBreakpoint.Tests.ps1"
$fullScriptPath = Join-Path -Path $PSScriptRoot -ChildPath $scriptName
@@ -1,4 +1,4 @@
Describe "Get-PSCallStack DRT Unit Tests" -Tags DRT {
Describe "Get-PSCallStack DRT Unit Tests" -Tags "CI" {
BeforeAll {
$scriptFileName = "GetTryCatchCallStack.ps1"
$scriptFilePath = Join-Path $TestDrive -ChildPath $scriptFileName
@@ -1,4 +1,4 @@
Describe "Get-Random DRT Unit Tests" -Tags DRT{
Describe "Get-Random DRT Unit Tests" -Tags "CI" {
$testData = @(
@{ Name = 'no params'; Maximum = $null; Minimum = $null; GreaterThan = -1; LessThan = ([int32]::MaxValue); Type = 'System.Int32' }
@{ Name = 'only positive maximum number'; Maximum = 100; Minimum = $null; GreaterThan = -1; LessThan = 100; Type = 'System.Int32' }
@@ -89,7 +89,7 @@ Describe "Get-Random DRT Unit Tests" -Tags DRT{
}
}
Describe "Get-Random" {
Describe "Get-Random" -Tags "CI" {
It "Should return a random number greater than -1 " {
Get-Random | Should BeGreaterThan -1
}
@@ -1,4 +1,4 @@
Describe "Get-RunspaceDebug" {
Describe "Get-RunspaceDebug" -Tags "CI" {
Context "Check return types of RunspaceDebug" {
@@ -1,4 +1,4 @@
Describe "Get-TraceSource" -tags "P1" {
Describe "Get-TraceSource" -Tags "Feature" {
It "Should output data sorted by name" {
$expected = (Get-TraceSource | Sort-Object Name)
Get-TraceSource | Should be $expected
@@ -1,4 +1,4 @@
Describe "Get-UICulture" {
Describe "Get-UICulture" -Tags "CI" {
It "Should return a type of CultureInfo as the name of the type" {
(Get-UICulture).GetType().Name | Should Match CultureInfo
}
@@ -1,4 +1,4 @@
Describe "Get-Unique DRT Unit Tests" -Tags DRT{
Describe "Get-Unique DRT Unit Tests" -Tags "CI" {
It "Command get-unique works with AsString switch" {
$inputArray = "aa","aa","Aa","ba","BA","BA"
$results = $inputArray | Get-Unique -AsString
@@ -17,7 +17,7 @@ Describe "Get-Unique DRT Unit Tests" -Tags DRT{
}
}
Describe "Get-Unique" {
Describe "Get-Unique" -Tags "CI" {
$sortedList1 = 1,2,2,3,3,4,5
It "Should be able to use the Get-Unique cmdlet without error with inputObject switch" {
{ Get-Unique -InputObject $sortedList1 } | Should Not Throw
@@ -1,5 +1,5 @@
Describe "Get-Variable DRT Unit Tests" -Tags DRT{
Describe "Get-Variable DRT Unit Tests" -Tags "CI" {
It "Get-Variable of not existing variable Name should throw ItemNotFoundException"{
try {
Get-Variable -EA Stop -Name nonexistingVariableName
@@ -52,7 +52,7 @@ Describe "Get-Variable DRT Unit Tests" -Tags DRT{
}
}
Describe "Get-Variable" {
Describe "Get-Variable" -Tags "CI" {
It "Should be able to call with no parameters without error" {
{ Get-Variable } | Should Not Throw
}
@@ -1,4 +1,4 @@
Describe "Group-Object DRT Unit Tests" -Tags DRT{
Describe "Group-Object DRT Unit Tests" -Tags "CI" {
It "Test for CaseSensitive switch" {
$testObject = 'aA', 'aA', 'AA', 'AA'
$results = $testObject | Group-Object -CaseSensitive
@@ -11,7 +11,7 @@ Describe "Group-Object DRT Unit Tests" -Tags DRT{
}
}
Describe "Group-Object" {
Describe "Group-Object" -Tags "CI" {
$testObject = Get-ChildItem
It "Should be called using an object as piped without error with no switches" {
@@ -1,4 +1,4 @@
Describe "Import-Alias DRT Unit Tests" -Tags DRT{
Describe "Import-Alias DRT Unit Tests" -Tags "CI" {
$testAliasDirectory = Join-Path -Path $TestDrive -ChildPath ImportAliasTestDirectory
$testAliases = "TestAliases"
$fulltestpath = Join-Path -Path $testAliasDirectory -ChildPath $testAliases
@@ -61,7 +61,7 @@ Describe "Import-Alias DRT Unit Tests" -Tags DRT{
}
}
Describe "Import-Alias" {
Describe "Import-Alias" -Tags "CI" {
$newLine=[Environment]::NewLine
$testAliasDirectory = Join-Path -Path $TestDrive -ChildPath ImportAliasTestDirectory
$testAliases = "pesteralias.txt"
@@ -1,4 +1,4 @@
Describe "Import-Csv" {
Describe "Import-Csv" -Tags "CI" {
$testCsv = Join-Path -Path (Join-Path $PSScriptRoot -ChildPath assets) -ChildPath TestCsv.csv
It "Should be able to call without error" {
@@ -50,7 +50,7 @@ Describe "Import-Csv" {
}
}
Describe "Import-Csv DRT Unit Tests" -Tags DRT {
Describe "Import-Csv DRT Unit Tests" -Tags "CI" {
BeforeAll {
$fileToGenerate = Join-Path $TestDrive -ChildPath "importCSVTest.csv"
$psObject = [pscustomobject]@{ "First" = "1"; "Second" = "2" }
@@ -1,6 +1,6 @@
$assetsDir = Join-Path -Path $PSScriptRoot -ChildPath assets
Describe "Import-LocalizedData" {
Describe "Import-LocalizedData" -Tags "CI" {
BeforeAll {
$script = "localized.ps1"
@@ -1,4 +1,4 @@
Describe "Invoke-Expression" {
Describe "Invoke-Expression" -Tags "CI" {
Context "Should execute the invoked command validly" {
@@ -27,7 +27,7 @@ Describe "Invoke-Expression" {
}
}
}
Describe "Invoke-Expression DRT Unit Tests" -Tags DRT{
Describe "Invoke-Expression DRT Unit Tests" -Tags "CI" {
It "Invoke-Expression should work"{
$result=invoke-expression -Command 2+2
$result|Should Be 4
@@ -1,6 +1,6 @@
using namespace System.Diagnostics
Describe "Invoke-Item" {
Describe "Invoke-Item" -Tags "CI" {
function NewProcessStartInfo([string]$CommandLine, [switch]$RedirectStdIn)
{
@@ -1,4 +1,4 @@
Describe "Measure-Command" {
Describe "Measure-Command" -Tags "CI" {
Context "Validate return types for Measure-Command" {
@@ -1,4 +1,4 @@
Describe "Measure-Object" {
Describe "Measure-Object" -Tags "CI" {
$testObject = 1,3,4
It "Should be able to be called without error" {
@@ -158,7 +158,7 @@ Describe "Measure-Object" {
}
}
Describe "Measure-Object DRT basic functionality" -Tags DRT{
Describe "Measure-Object DRT basic functionality" -Tags "CI" {
BeforeAll {
if(-not ([System.Management.Automation.PSTypeName]'TestMeasureGeneric').Type)
Loaded 100 of 145 files, more files were not shown because too many files have changed in this diff. Show more