diff --git a/build.psm1 b/build.psm1 index 33230e60f26..e88319a54b1 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1331,7 +1331,11 @@ function Publish-TestResults { $resolvedPath = (Resolve-Path -Path $Path).ProviderPath Write-Host "##vso[results.publish type=$Type;mergeResults=true;runTitle=$Title;publishRunAttachments=true;resultFiles=$resolvedPath;]" - Write-Host "##vso[artifact.upload containerfolder=testResults;artifactname=testResults]$resolvedPath" + + if($env:BUILD_REASON -ne 'PullRequest') + { + Write-Host "##vso[artifact.upload containerfolder=testResults;artifactname=testResults]$resolvedPath" + } } } diff --git a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 index 79fde738f26..828fc215583 100644 --- a/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 +++ b/test/tools/Modules/HelpersCommon/HelpersCommon.psm1 @@ -233,8 +233,11 @@ function Send-VstsLogFile { Copy-Item -Path $Path -Destination $logFile } - Write-Host "##vso[artifact.upload containerfolder=$name;artifactname=$name]$logFile" - Write-Verbose "Log file captured as $name" -Verbose + if($env:BUILD_REASON -ne 'PullRequest') + { + Write-Host "##vso[artifact.upload containerfolder=$name;artifactname=$name]$logFile" + Write-Verbose "Log file captured as $name" -Verbose + } } # Tests if the Linux or macOS user is root