Skip to content

Commit

Permalink
[automated] Merge branch 'release/6.0.1xx' => 'release/6.0.3xx' (#14726)
Browse files Browse the repository at this point in the history
* [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 <msimons@microsoft.com>
Co-authored-by: NET Source-Build Bot <102560831+dotnet-sb-bot@users.noreply.github.com>
Co-authored-by: Logan Bussell <loganbussell@microsoft.com>
Co-authored-by: Jason Zhai <v-wuzhai@microsoft.com>
  • Loading branch information
5 people authored Oct 12, 2022
1 parent 2d21c66 commit 0263b7b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 30 deletions.
9 changes: 5 additions & 4 deletions .vsts-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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:

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private static void InitNugetConfig()
}
}

public void ExecuteCmd(string args, string? workingDirectory = null, Action<Process>? additionalProcessConfigCallback = null, int expectedExitCode = 0, int millisecondTimeout = -1)
public void ExecuteCmd(string args, string? workingDirectory = null, Action<Process>? additionalProcessConfigCallback = null, int? expectedExitCode = 0, int millisecondTimeout = -1)
{
(Process Process, string StdOut, string StdErr) executeResult = ExecuteHelper.ExecuteProcess(
DotNetPath,
Expand All @@ -105,7 +105,9 @@ public void ExecuteCmd(string args, string? workingDirectory = null, Action<Proc
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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ public void WatchTests()
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);
Expand Down Expand Up @@ -52,7 +51,7 @@ void processConfigCallback(Process process)
{
outputChanged = true;
OutputHelper.WriteLine("Successfully re-ran program after code change.");
ExecuteHelper.ExecuteProcessValidateExitCode("kill", $"-s TERM {process.Id}", OutputHelper);
process.Kill(true);
}
});
}
Expand Down

0 comments on commit 0263b7b

Please sign in to comment.