From 0263b7b7dacffa82e41b4e3e63cb83e371cd7f5d Mon Sep 17 00:00:00 2001 From: dotnet-maestro-bot Date: Wed, 12 Oct 2022 14:14:53 -0700 Subject: [PATCH] [automated] Merge branch 'release/6.0.1xx' => 'release/6.0.3xx' (#14726) * [release/6.0.1xx] Enable online and offline source-build tarball build in all PRs (#14711) * Enable online and offline source-build tarball build in all PRs (#14620) * Fix source-build CI to not run tarball build when tarball creation fails (#14678) * Fix source-build CI to not run tarball build when tarball creation failed * Bad fix * Revert test patch * update global.json and Versions.props for .NET SDK 6.0.110 (#14717) * [release/6.0.1xx] Re-write dotnet-watch smoke test (#14367) * Re-write dotnet-watch smoke test * Revert async changes * Disable source-build tarball validation for non 6.0.1xx legs Co-authored-by: Michael Simons Co-authored-by: NET Source-Build Bot <102560831+dotnet-sb-bot@users.noreply.github.com> Co-authored-by: Logan Bussell Co-authored-by: Jason Zhai --- .vsts-ci.yml | 9 +++++---- .../templates/job/source-build-create-tarball.yml | 15 --------------- .../job/source-build-run-tarball-build.yml | 7 +------ .../DotNetHelper.cs | 6 ++++-- .../DotNetWatchTests.cs | 5 ++--- 5 files changed, 12 insertions(+), 30 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index ab1e20400..86a77511e 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -375,10 +375,11 @@ stages: - template: /src/SourceBuild/Arcade/eng/common/templates/job/source-build-create-tarball.yml - - template: /src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml - parameters: - dependsOn: Source_Build_Create_Tarball - condition: eq(dependencies.Source_Build_Create_Tarball.outputs['Tarball_Build_Check._includeTarballBuild'], 'true') + # For .NET 6.0, source-build only supports 6.0.1xx. Disable tarball build validation in all other branches. + # - ${{ if in(variables['Build.Reason'], 'PullRequest') }}: + # - template: /src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml + # parameters: + # dependsOn: Source_Build_Create_Tarball # https://github.com/dotnet/core-sdk/issues/248 # - template: /eng/build.yml diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-create-tarball.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-create-tarball.yml index 8efb389d3..cffdf6bdb 100644 --- a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-create-tarball.yml +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-create-tarball.yml @@ -74,18 +74,3 @@ jobs: displayName: Publish BuildLogs continueOnError: true condition: succeededOrFailed() - - - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: - # Check if the tarball should be built now so the result can be used in the build tarball job condition. - # This prevents allocation of additional agents if the tarball build legs should be skipped. - # Only build the tarball if the PR touches source-build source. - - script: | - # Temporarily disable tarball PR validation until source-build is supported in this channel. - echo "##vso[task.setvariable variable=_includeTarballBuild;isoutput=true]false" - - # if curl "https://api.github.com/repos/dotnet/installer/pulls/$(System.PullRequest.PullRequestNumber)/files" | grep '"filename": "src/SourceBuild/*' - # then - # echo "##vso[task.setvariable variable=_includeTarballBuild;isoutput=true]true" - # fi - displayName: Tarball Build Check - name: Tarball_Build_Check diff --git a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml index e5e4f7e9a..13bcd2497 100644 --- a/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml +++ b/src/SourceBuild/Arcade/eng/common/templates/job/source-build-run-tarball-build.yml @@ -1,9 +1,6 @@ # Builds a source-build tarball parameters: - # Custom condition to apply to the job - condition: true - # Dependent jobs that must be completed before this job will run dependsOn: @@ -32,7 +29,6 @@ jobs: - template: /src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml parameters: architecture: x64 - condition: ${{ parameters.condition }} dependsOn: ${{ parameters.dependsOn }} ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: excludeSdkContentTests: true @@ -86,7 +82,6 @@ jobs: - template: /src/SourceBuild/Arcade/eng/common/templates/job/source-build-build-tarball.yml parameters: architecture: arm64 - condition: ${{ parameters.condition }} dependsOn: ${{ parameters.dependsOn }} ${{ if in(variables['Build.Reason'], 'PullRequest') }}: excludeSdkContentTests: true @@ -108,7 +103,7 @@ jobs: architecture: x64 # Always attempt to run the bootstrap leg (e.g. even when stage 1 tests fail) in order to get a complete accessment of the build status. # The bootstrap build will shortcut if the stage 1 build failed. - condition: and(${{ parameters.condition }}, succeededOrFailed()) + condition: succeededOrFailed() dependsOn: Build_Tarball_x64 excludeSdkContentTests: true installerBuildResourceId: ${{ parameters.installerBuildResourceId }} diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs index ae5508aa4..921ab1f97 100644 --- a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetHelper.cs @@ -96,7 +96,7 @@ internal class DotNetHelper } } - public void ExecuteCmd(string args, string? workingDirectory = null, Action? additionalProcessConfigCallback = null, int expectedExitCode = 0, int millisecondTimeout = -1) + public void ExecuteCmd(string args, string? workingDirectory = null, Action? additionalProcessConfigCallback = null, int? expectedExitCode = 0, int millisecondTimeout = -1) { (Process Process, string StdOut, string StdErr) executeResult = ExecuteHelper.ExecuteProcess( DotNetPath, @@ -105,7 +105,9 @@ internal class DotNetHelper configure: (process) => configureProcess(process, workingDirectory), millisecondTimeout: millisecondTimeout); - ExecuteHelper.ValidateExitCode(executeResult, expectedExitCode); + if (expectedExitCode != null) { + ExecuteHelper.ValidateExitCode(executeResult, (int) expectedExitCode); + } void configureProcess(Process process, string? workingDirectory) { diff --git a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetWatchTests.cs b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetWatchTests.cs index 183311037..46013bbc7 100644 --- a/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetWatchTests.cs +++ b/src/SourceBuild/tarball/content/test/Microsoft.DotNet.SourceBuild.SmokeTests/DotNetWatchTests.cs @@ -19,12 +19,11 @@ public class DotNetWatchTests : SmokeTests string projectDirectory = DotNetHelper.ExecuteNew(DotNetTemplate.Console.GetName(), nameof(DotNetWatchTests)); bool outputChanged = false; - // We expect an exit code of 143 (128 + 15, i.e. SIGTERM) because we are killing the process manually DotNetHelper.ExecuteCmd( "watch run", workingDirectory: projectDirectory, additionalProcessConfigCallback: processConfigCallback, - expectedExitCode: 143, + expectedExitCode: null, // The exit code does not reflect whether or not dotnet watch is working properly millisecondTimeout: 30000); Assert.True(outputChanged); @@ -52,7 +51,7 @@ public class DotNetWatchTests : SmokeTests { outputChanged = true; OutputHelper.WriteLine("Successfully re-ran program after code change."); - ExecuteHelper.ExecuteProcessValidateExitCode("kill", $"-s TERM {process.Id}", OutputHelper); + process.Kill(true); } }); }