Merged PR 8529: Add cleanup before building test package

Add cleanup before building test package
This commit is contained in:
Aditya Patwardhan 2019-05-29 00:31:14 +00:00
parent ed1b991b6f
commit 8ea15c9f13
3 changed files with 22 additions and 5 deletions

View file

@ -818,14 +818,23 @@ function Publish-PSTestTools {
{
Push-Location $tool.Path
try {
$toolPath = Join-Path -Path $tool.Path -ChildPath "bin"
$objPath = Join-Path -Path $tool.Path -ChildPath "obj"
if (Test-Path $toolPath) {
Remove-Item -Path $toolPath -Recurse -Force
}
if (Test-Path $objPath) {
Remove-Item -Path $objPath -Recurse -Force
}
if (-not $runtime) {
dotnet publish --output bin --configuration $Options.Configuration --framework $Options.Framework --runtime $Options.Runtime
} else {
dotnet publish --output bin --configuration $Options.Configuration --framework $Options.Framework --runtime $runtime
}
$toolPath = Join-Path -Path $tool.Path -ChildPath "bin"
if ( -not $env:PATH.Contains($toolPath) ) {
$env:PATH = $toolPath+$TestModulePathSeparator+$($env:PATH)
}

View file

@ -305,7 +305,15 @@ Describe "Hash expression with if statement as value" -Tags "CI" {
}
Describe "Hashtable is case insensitive" -Tag CI {
It "When LANG is C.UTF-8" -Skip:($IsWindows) {
sh -c 'LANG=C.UTF-8 pwsh -NoProfile -Command ''$h=@{p=1};$h.P''' | Should -Be 1
It "When current culture is en-US-POSIX" -Skip:($IsWindows) {
try {
$oldCulture = [System.Globalization.CultureInfo]::CurrentCulture
[System.Globalization.CultureInfo]::CurrentCulture = [System.Globalization.CultureInfo]::new('en-US-POSIX')
@{h=1}.H | Should -Be 1 -Because 'hashtables should be case insensitive in en-US-POSIX culture'
}
finally {
[System.Globalization.CultureInfo]::CurrentCulture = $oldCulture
}
}
}

View file

@ -6,7 +6,7 @@ if(-not ("netDumbster.smtp.SimpleSmtpServer" -as [type]))
Register-PackageSource -Name nuget.org -Location https://api.nuget.org/v3/index.json -ProviderName NuGet -ErrorAction SilentlyContinue
$nugetPackage = "netDumbster"
Install-Package -Name $nugetPackage -ProviderName NuGet -Scope CurrentUser -Force -Source 'nuget.org'
Install-Package -Name $nugetPackage -ProviderName NuGet -Scope CurrentUser -Force -Source 'nuget.org' -RequiredVersion 2.0.0.4
$dll = "$(Split-Path (Get-Package $nugetPackage).Source)\lib\netstandard2.0\netDumbster.dll"
Add-Type -Path $dll