Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 1 addition & 51 deletions tools/ci.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ function Invoke-CIInstall
)
# Make sure we have all the tags
Sync-PSTags -AddRemoteIfMissing
$releaseTag = Get-ReleaseTag

if(Test-DailyBuild)
{
Expand Down Expand Up @@ -588,8 +587,6 @@ function Invoke-LinuxTestsCore
'ExcludeTag' = $testExcludeTag
'OutputFile' = $testResultsNoSudo
}
# create packages if it is a full build
$isFullBuild = Test-DailyBuild

# Get the experimental feature names and the tests associated with them
$ExperimentalFeatureTests = Get-ExperimentalFeatureTests
Expand Down Expand Up @@ -662,7 +659,7 @@ function Invoke-LinuxTestsCore
# Determine whether the build passed
try {
$allTestResultsWithNoExpFeature = @($pesterPassThruNoSudoObject, $pesterPassThruSudoObject)
$allTestResultsWithExpFeatures = $noSudoResultsWithExpFeatures + $sudoResultsWithExpFeatures
$allTestResultsWithExpFeatures = @($noSudoResultsWithExpFeatures, $sudoResultsWithExpFeatures)
# This throws if there was an error:
$allTestResultsWithNoExpFeature | ForEach-Object { Test-PSPesterResults -ResultObject $_ }
$allTestResultsWithExpFeatures | ForEach-Object { Test-PSPesterResults -ResultObject $_ -CanHaveNoResult }
Expand All @@ -672,53 +669,6 @@ function Invoke-LinuxTestsCore
$resultError = $_
$result = "FAIL"
}
}

# Build and test script for Linux and macOS:
function Invoke-LinuxTests
{
param(
[switch]
$SkipBuild
)

if(!$SkipBuild.IsPresent)
{
$releaseTag = Get-ReleaseTag
Write-Log -Message "Executing ci.psm1 build and test on a Linux based operating system."
$originalProgressPreference = $ProgressPreference
$ProgressPreference = 'SilentlyContinue'
try {
# We use CrossGen build to run tests only if it's the daily build.
Start-PSBuild -CrossGen -PSModuleRestore -CI -ReleaseTag $releaseTag -Configuration 'Release'
}
finally
{
$ProgressPreference = $originalProgressPreference
}
}

Invoke-LinuxTestsCore

try {
$xUnitTestResultsFile = "$pwd/xUnitTestResults.xml"
Start-PSxUnit -xUnitTestResultsFile $xUnitTestResultsFile
# If there are failures, Test-XUnitTestResults throws
Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile
} catch {
$result = "FAIL"
if (!$resultError)
{
$resultError = $_
}
}

$createPackages = $isFullBuild

if ($createPackages)
{
New-LinuxPackage -NugetKey $env:NugetKey
}

# If the tests did not pass, throw the reason why
if ( $result -eq "FAIL" )
Expand Down