diff --git a/appveyor.yml b/appveyor.yml index 654110ee4e..11e48bf27f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,10 +25,23 @@ build_script: test_script: - ps: | + # CoreCLR $testResultsFile = ".\TestsResults.xml" .\bin\powershell.exe --noprofile -c "Invoke-Pester test/powershell -OutputFormat NUnitXml -OutputFile $testResultsFile" (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) - + # For now we don't fail the build if these tests failed + # + # FullCLR + Import-Module .\PowerShellGithubDev.psm1 + $testResultsFile = ".\TestsResults.FullCLR.xml" + Start-DevPSGithub -binDir $pwd\binFull -NoNewWindow -ArgumentList '-command', 'Import-Module .\test\Pester; Invoke-Pester test/fullCLR -OutputFormat NUnitXml -OutputFile $testResultsFile' + (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile)) + # we want to fail the build, if these tests failed + $x = [xml](cat -raw .\TestsResults.FullCLR.xml) + if ([int]$x.'test-results'.failures -gt 0) + { + throw "$($x.'test-results'.failures) tests in test/fullCLR failed" + } deploy_script: - ps: | diff --git a/test/fullclr/PowerShellGithubDev.Tests.ps1 b/test/fullclr/PowerShellGithubDev.Tests.ps1 new file mode 100644 index 0000000000..d4acbb9e84 --- /dev/null +++ b/test/fullclr/PowerShellGithubDev.Tests.ps1 @@ -0,0 +1,32 @@ +Describe 'PowerShellGithubDev.psm1 and powershell.exe' { + Context '$env:DEVPATH assemblies loading' { + It 'has $env:DEVPATH set' { + $env:DEVPATH | Should Not Be $null + } + + It 'loads System.Management.Automation.dll' { + [psobject].Assembly.Location | Should Be ( + Join-Path $env:DEVPATH System.Management.Automation.dll) + } + + It 'loads Microsoft.PowerShell.Commands.Management.dll' { + [Microsoft.PowerShell.Commands.GetChildItemCommand].Assembly.Location | Should Be ( + Join-Path $env:DEVPATH Microsoft.PowerShell.Commands.Management.dll) + } + + It 'loads Microsoft.PowerShell.Commands.Utility.dll' { + [Microsoft.PowerShell.Commands.UtilityResources].Assembly.Location | Should Be ( + Join-Path $env:DEVPATH Microsoft.PowerShell.Commands.Utility.dll) + } + + It 'loads Microsoft.PowerShell.ConsoleHost.dll' { + [Microsoft.PowerShell.ConsoleShell].Assembly.Location | Should Be ( + Join-Path $env:DEVPATH Microsoft.PowerShell.ConsoleHost.dll) + } + + It 'loads Microsoft.PowerShell.Security.dll' { + [Microsoft.PowerShell.Commands.SecurityDescriptorCommandsBase].Assembly.Location | Should Be ( + Join-Path $env:DEVPATH Microsoft.PowerShell.Security.dll) + } + } +} \ No newline at end of file