Skip to content

Commit

Permalink
all tests are now marked with proper tag
Browse files Browse the repository at this point in the history
also, update build.psm1 to be more flexible
  • Loading branch information
JamesWTruher committed Jul 27, 2016
1 parent 362a807 commit a784149
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 10 deletions.
17 changes: 15 additions & 2 deletions build.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -467,11 +467,24 @@ function Get-PSOutput {

function Start-PSPester {
[CmdletBinding()]param(
[string]$Flags = "-ExcludeTag 'Slow' -Tag 'CI' -EnableExit -OutputFile pester-tests.xml -OutputFormat NUnitXml",
[string]$OutputFormat = "NUnitXml",
[string]$OutputFile = "pester-tests.xml",
[switch]$DisableExit,
[string[]]$ExcludeTag = "Slow",
[string[]]$Tag = "CI",
[string]$Path = "$PSScriptRoot/test/powershell"
)
$tagString = "-outputFormat ${OutputFormat} -outputFile ${outputFile} "
if ( ! $DisableExit ) { $tagString += " -EnableExit" }
if ( $ExcludeTag ) { $tagString += " -ExcludeTag @('" + (${ExcludeTag} -join "','") + "')" }
if ( $Tag ) { $tagString += " -Tag @('" + (${Tag} -join "','") + "')" }

& (Get-PSOutput) -noprofile -c "Import-Module '$PSHOME/Modules/Pester'; Invoke-Pester $Flags $Path"
$powershell = get-psoutput
$psdir = [io.path]::GetDirectoryName($powershell)
$moduleDir = [io.path]::Combine($psdir,"Modules","Pester")

Write-Verbose "Import-Module '$moduleDir'; Invoke-Pester $tagString $Path"
& (Get-PSOutput) -noprofile -c "Import-Module '$moduleDir'; Invoke-Pester $tagString $Path"
if ($LASTEXITCODE -ne 0) {
throw "$LASTEXITCODE Pester tests failed"
}
Expand Down
2 changes: 1 addition & 1 deletion test/powershell/Host/Base-Directory.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Describe "Configuration file locations" -tags "CI" {
Describe "Configuration file locations" -tags "CI","Slow" {

BeforeAll {
$powershell = Join-Path -Path $PsHome -ChildPath "powershell"
Expand Down
2 changes: 1 addition & 1 deletion test/powershell/Host/Read-Host.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Describe "Read-Host" -Tags "CI" {
Describe "Read-Host" -Tags "Slow","Feature" {
Context "[Console]::ReadKey() implementation on non-Windows" {
BeforeAll {
$powershell = Join-Path -Path $PsHome -ChildPath "powershell"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Describe 'Exceptions flow for classes' -Tags "DRT" {
Describe 'Exceptions flow for classes' -Tags "CI" {

$canaryHashtable = @{}

Expand Down
2 changes: 1 addition & 1 deletion test/powershell/Language/CompletionTestSupport.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function Test-Completions
{
foreach ($test in $TestCases)
{
Describe $test.Description {
Describe $test.Description -Tags "CI" {
$hash = $Test.TestInput
$results = Get-Completions @hash

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $source = "http://www.nuget.org/api/v2/"

# Actual Tests:

Describe "Get-package" -Tags @('BVT', 'DRT'){
Describe "Get-package" -Tags "Feature" {
# make sure that packagemanagement is loaded
It "EXPECTED: Get-package accepts array of strings for -providername parameter" -Skip {
$x = (get-package -providername Programs,Msi)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Describe "get-packageprovider" -Tags "CI" {
}


Describe "Get-PackageProvider with list" Tags "CI" {
Describe "Get-PackageProvider with list" -Tags "CI" {

It "lists package providers installed" {
$x = (Get-PackageProvider).Count -gt 1 | should be $true
Expand Down
4 changes: 2 additions & 2 deletions test/powershell/enginecore/Parser.Test.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Describe "ParserTests (admin\monad\tests\monad\src\engine\core\ParserTests.cs)" {
Describe "ParserTests (admin\monad\tests\monad\src\engine\core\ParserTests.cs)" -Tags "CI" {
BeforeAll {
$functionDefinitionFile = Join-Path -Path $TestDrive -ChildPath "functionDefinition.ps1"
$functionDefinition = @'
Expand Down Expand Up @@ -825,4 +825,4 @@ Describe "ParserTests (admin\monad\tests\monad\src\engine\core\ParserTests.cs)"
$_.FullyQualifiedErrorId | should be "ParseException"
}
}
}
}

0 comments on commit a784149

Please sign in to comment.