Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helix Restore Issue Mitigation #41311

Merged
merged 27 commits into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
021516b
RunTests dotnet run --no-build
TanayParikh Apr 21, 2022
ee6202c
Remove duplicate run
TanayParikh Apr 21, 2022
674d5b9
Add to Build.props
TanayParikh Apr 21, 2022
85c3d69
Treat CA2007 as a warning in RunTests
TanayParikh Apr 21, 2022
133ce0b
NoWarn CA2007
TanayParikh Apr 21, 2022
4a6ba96
Ignore NU5104 for System.CommandLine prerelease package
TanayParikh Apr 21, 2022
69e1468
PR Feedback
TanayParikh Apr 21, 2022
3f97899
PR Feedback
TanayParikh Apr 22, 2022
f5d847e
Generate .config/dotnet-tools.json
dougbu Apr 27, 2022
56bacbe
Add tool packages to Helix correlation payloads
dougbu Apr 27, 2022
95a90e5
Do not restore tools from network
dougbu Apr 27, 2022
0f97390
Do not pass `dotnet-ef` version to `RunTests`
dougbu Apr 27, 2022
9a2900d
Remove DotNetToolsInstaller.csproj
dougbu Apr 27, 2022
787b743
Add `--playwright` option in `Runtests`
dougbu Apr 28, 2022
3664794
Use Arcade SDK in `RunTests` and `Publish` project
dougbu Apr 28, 2022
f550234
Correct minor problems in `RunTests` source
dougbu Apr 28, 2022
ac9b2f8
Use file-scoped namespaces in `RunTests` source
dougbu Apr 28, 2022
d9ef4d8
Use VS code fixes in `RunTests`
dougbu Apr 28, 2022
c12501c
Use published `RunTests` output on Helix agents
dougbu Apr 28, 2022
ddc91e0
Move `RunTests` under eng/tools/
dougbu Apr 28, 2022
9961ccb
Add `RunTests` to tools.slnf
dougbu Apr 28, 2022
5b14ca6
Rename `RunTests` project to `HelixTestRunner`
dougbu Apr 29, 2022
b3e15e0
!fixup! Define `$(ArtifactsBinDir)` in helix.proj
dougbu Apr 29, 2022
a788fd6
!fixup! Use `$(Configuration)` in helix.proj
dougbu Apr 29, 2022
9e45752
!fixup! Fix typo in property function
dougbu Apr 29, 2022
a22be2b
!fixup! Fix `dotnet` syntax in runtests.sh
dougbu Apr 29, 2022
9ffdffb
!fixup! Correct `%(HelixCorrelationPayload.Destination)`
dougbu Apr 30, 2022
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
Prev Previous commit
Next Next commit
Rename RunTests project to HelixTestRunner
- less confusing given `RunTests` target and runtests.sh et cetera
  • Loading branch information
dougbu committed Apr 29, 2022
commit 5b14ca685958b71f6fb4c10b1744d6bebb893e9f
2 changes: 1 addition & 1 deletion AspNetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RateLi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.RateLimiting.Tests", "src\Middleware\RateLimiting\test\Microsoft.AspNetCore.RateLimiting.Tests.csproj", "{41FF4F96-98D2-4482-A2A7-4B179E80D285}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RunTests", "eng\tools\RunTests\RunTests.csproj", "{51D07AA9-6297-4F66-A7BD-71CE7E3F4A3F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HelixTestRunner", "eng\tools\HelixTestRunner\HelixTestRunner.csproj", "{51D07AA9-6297-4F66-A7BD-71CE7E3F4A3F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
4 changes: 2 additions & 2 deletions docs/UpdatingMajorVersionAndTFM.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Once dotnet/runtime has updated their TFM, we update ours in the dependency upda

* In [eng/Versions.props](/eng/Versions.props), increment `DefaultNetCoreTargetFramework` by 1.
* Do a global repo search for the current version string, and update almost everything by 1 (e.g. find `net7`, replace with `net8`). See the PR linked above for examples - this shouldn't be done blindly, but on a case-by-case basis. Most things should be updated, and most choices should be obvious.
* Exceptions to this are [eng/tools/RepoTasks/RepoTasks.csproj](/eng/tools/RepoTasks/RepoTasks.csproj), [eng/tools/RepoTasks/RepoTasks.tasks](/eng/tools/RepoTasks/RepoTasks.tasks), and [eng/tools/RunTests/RunTests.csproj](/eng/tools/RunTests/RunTests.csproj). These build without the workarounds from [eng/tools/GenerateFiles/Directory.Build.targets.in](/eng/tools/GenerateFiles/Directory.Build.targets.in), and need to be kept at the previous TFM until we get an SDK containing a runtime with the new TFM. Generally this means we have to hard-code the previous TFM for these files, rather than using `DefaultNetCoreTargetFramework`.
* Exceptions to this are [eng/tools/RepoTasks/RepoTasks.csproj](/eng/tools/RepoTasks/RepoTasks.csproj), [eng/tools/RepoTasks/RepoTasks.tasks](/eng/tools/RepoTasks/RepoTasks.tasks), and [eng/tools/HelixTestRunner/HelixTestRunner.csproj](/eng/tools/HelixTestRunner/HelixTestRunner.csproj). These build without the workarounds from [eng/tools/GenerateFiles/Directory.Build.targets.in](/eng/tools/GenerateFiles/Directory.Build.targets.in), and need to be kept at the previous TFM until we get an SDK containing a runtime with the new TFM. Generally this means we have to hard-code the previous TFM for these files, rather than using `DefaultNetCoreTargetFramework`.
* Add a reference to the new `SiteExtensions` package for the previous Major Version.
1. Add references to [src/SiteExtensions/LoggingAggregate/src/Microsoft.AspNetCore.AzureAppServices.SiteExtension/Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj](/src/SiteExtensions/LoggingAggregate/src/Microsoft.AspNetCore.AzureAppServices.SiteExtension/Microsoft.AspNetCore.AzureAppServices.SiteExtension.csproj) to `Microsoft.AspNetCore.AzureAppServices.SiteExtension.{PreviousMajorVersion}.0.x64` and `Microsoft.AspNetCore.AzureAppServices.SiteExtension.{PreviousMajorVersion}.0.x86`.
2. Add entries in [eng/Versions.props](/eng/Versions.props) similar to [these](https://github.com/dotnet/aspnetcore/blob/216c92b78bce31d5e81a70b589707ec2ae5ab21a/eng/Versions.props#L224-L226) - the version should be from the latest released build of .Net.
Expand All @@ -56,4 +56,4 @@ Once dotnet/runtime has updated their TFM, we update ours in the dependency upda

## Ingesting an SDK with the new TFM

Typically we update the SDK we use in `main` every Monday. Once we have one that contains `Microsoft.Netcore.App` entries with the new TFM, we can update [eng/tools/RepoTasks/RepoTasks.csproj](/eng/tools/RepoTasks/RepoTasks.csproj), [eng/tools/RepoTasks/RepoTasks.tasks](/eng/tools/RepoTasks/RepoTasks.tasks), and [eng/tools/RunTests/RunTests.csproj](/eng/helix/tools/RunTests.csproj) to use `DefaultNetCoreTargetFramework` again rather than hard-coding the previous TFM.
Typically we update the SDK we use in `main` every Monday. Once we have one that contains `Microsoft.Netcore.App` entries with the new TFM, we can update [eng/tools/RepoTasks/RepoTasks.csproj](/eng/tools/RepoTasks/RepoTasks.csproj), [eng/tools/RepoTasks/RepoTasks.tasks](/eng/tools/RepoTasks/RepoTasks.tasks), and [eng/tools/HelixTestRunner/HelixTestRunner.csproj](/eng/helix/tools/HelixTestRunner.csproj) to use `DefaultNetCoreTargetFramework` again rather than hard-coding the previous TFM.
2 changes: 1 addition & 1 deletion eng/Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
$(RepoRoot)src\Extensions\**\*.csproj;
$(RepoRoot)src\BuildAfterTargetingPack\*.csproj;
$(RepoRoot)src\OpenApi\**\*.csproj;
$(RepoRoot)eng\tools\RunTests\RunTests.csproj;
$(RepoRoot)eng\tools\HelixTestRunner\HelixTestRunner.csproj;
"
Exclude="
@(ProjectToBuild);
Expand Down
4 changes: 2 additions & 2 deletions eng/helix/content/runtests.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ echo.

set exit_code=0

echo "Running tests: $HELIX_CORRELATION_PAYLOAD/RunTests/RunTests.exe --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --helixTimeout %$helixTimeout% --playwright $installPlaywright"
$HELIX_CORRELATION_PAYLOAD/RunTests/RunTests.exe --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --helixTimeout %$helixTimeout% --playwright $installPlaywright
echo "Running tests: $HELIX_CORRELATION_PAYLOAD/HelixTestRunner/HelixTestRunner.exe --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --helixTimeout %$helixTimeout% --playwright $installPlaywright"
$HELIX_CORRELATION_PAYLOAD/HelixTestRunner/HelixTestRunner.exe --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --helixTimeout %$helixTimeout% --playwright $installPlaywright
if not errorlevel 0 (
set exit_code=%errorlevel%
)
Expand Down
4 changes: 2 additions & 2 deletions eng/helix/content/runtests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ sync

exit_code=0

echo "Running tests: dotnet run $HELIX_CORRELATION_PAYLOAD/RunTests/RunTests.dll -- --target $1 --runtime $2 --queue $helixQueue --arch $4 --quarantined $5 --helixTimeout $6 --playwright $installPlaywright"
dotnet run $HELIX_CORRELATION_PAYLOAD/RunTests/RunTests.dll -- --target $1 --runtime $2 --queue $helixQueue --arch $4 --quarantined $5 --helixTimeout $6 --playwright $installPlaywright
echo "Running tests: dotnet run $HELIX_CORRELATION_PAYLOAD/HelixTestRunner/HelixTestRunner.dll -- --target $1 --runtime $2 --queue $helixQueue --arch $4 --quarantined $5 --helixTimeout $6 --playwright $installPlaywright"
dotnet run $HELIX_CORRELATION_PAYLOAD/HelixTestRunner/HelixTestRunner.dll -- --target $1 --runtime $2 --queue $helixQueue --arch $4 --quarantined $5 --helixTimeout $6 --playwright $installPlaywright
exit_code=$?
echo "Finished tests...exit_code=$exit_code"

Expand Down
8 changes: 4 additions & 4 deletions eng/helix/helix.proj
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@
<PackageType>runtime</PackageType>
</AdditionalDotNetPackage>

<!-- Grab the tool packages for what RunTests installs. -->
<!-- Grab the tool packages for what HelixTestRunner installs. -->
<HelixCorrelationPayload Include="$(NUGET_PACKAGES)\dotnet-dump\$(DotnetDumpVersion)\dotnet-dump.$(DotnetDumpVersion).nupkg" />
<HelixCorrelationPayload Include="$(NUGET_PACKAGES)\dotnet-ef\$(dotnetefVersion)\dotnet-ef.$(dotnetefVersion).nupkg" />
<HelixCorrelationPayload Include="$(NUGET_PACKAGES)\dotnet-serve\$(DotnetServeVersion)\dotnet-serve.$(DotnetServeVersion).nupkg" />

<!-- Grab published `RunTests` project output. -->
<HelixCorrelationPayload Include="$(ArtifactsBinDir)RunTests\Debug\net7.0\publish\"
Destination="$([MSBuild]::EnsureTrailingSlash('RunTests')" />
<!-- Grab published `HelixTestRunner` project output. -->
<HelixCorrelationPayload Include="$(ArtifactsBinDir)HelixTestRunner\Debug\net7.0\publish\"
Destination="$([MSBuild]::EnsureTrailingSlash('HelixTestRunner')" />
</ItemGroup>

<Choose>
Expand Down
6 changes: 3 additions & 3 deletions eng/targets/Helix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@
SkipUnchangedFiles="$(SkipCopyUnchangedFiles)" />

<!--
Use the shared framework and ref/ assemblies copied to the Helix agents and expanded by RunTests. Unfortunately,
tests of Microsoft.NET.Sdk.Web templates will not reference the just-built Microsoft.NET.Sdk.Razor. Adding a
package reference for that would confuse tests of Microsoft.NET.Sdk templates.
Use the shared framework and ref/ assemblies copied to the Helix agents and expanded by HelixTestRunner.
Unfortunately, tests of Microsoft.NET.Sdk.Web templates will not reference the just-built
Microsoft.NET.Sdk.Razor. Adding a package reference for that would confuse tests of Microsoft.NET.Sdk templates.
-->
<Copy SourceFiles="$(ArtifactsBinDir)GenerateFiles\Directory.Build.props"
DestinationFiles="$(PublishDir)Directory.Build.props"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
using System.Runtime.InteropServices;
using System.Threading.Tasks;

namespace RunTests;
namespace HelixTestRunner;

public class RunTestsOptions
public class HelixTestRunnerOptions
{
public static RunTestsOptions Parse(string[] args)
public static HelixTestRunnerOptions Parse(string[] args)
{
var command = new RootCommand()
{
Expand Down Expand Up @@ -60,7 +60,7 @@ public static RunTestsOptions Parse(string[] args)

var parseResult = command.Parse(args);
var sharedFxVersion = parseResult.ValueForOption<string>("--runtime");
var options = new RunTestsOptions
var options = new HelixTestRunnerOptions
{
Architecture = parseResult.ValueForOption<string>("--arch"),
HelixQueue = parseResult.ValueForOption<string>("--queue"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace RunTests;
namespace HelixTestRunner;

public class ProcessResult
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#nullable enable

namespace RunTests;
namespace HelixTestRunner;

public static class ProcessUtil
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
using System;
using System.Threading.Tasks;

namespace RunTests;
namespace HelixTestRunner;

class Program
{
static async Task Main(string[] args)
{
try
{
var runner = new TestRunner(RunTestsOptions.Parse(args));
var runner = new TestRunner(HelixTestRunnerOptions.Parse(args));

var keepGoing = runner.SetupEnvironment();
if (keepGoing)
Expand Down Expand Up @@ -54,7 +54,7 @@ static async Task Main(string[] args)
}
catch (Exception e)
{
Console.WriteLine($"RunTests uncaught exception: {e.ToString()}");
Console.WriteLine($"HelixTestRunner uncaught exception: {e.ToString()}");
Environment.Exit(1);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

namespace RunTests;
namespace HelixTestRunner;

public class TestRunner
{
public TestRunner(RunTestsOptions options)
public TestRunner(HelixTestRunnerOptions options)
{
Options = options;
EnvironmentVariables = new Dictionary<string, string>();
}

public RunTestsOptions Options { get; set; }
public HelixTestRunnerOptions Options { get; set; }
public Dictionary<string, string> EnvironmentVariables { get; set; }

public bool SetupEnvironment()
Expand Down Expand Up @@ -262,7 +262,7 @@ public async Task<int> RunTestsAsync()
}
catch (Exception e)
{
Console.WriteLine($"Exception in RunTests: {e}");
Console.WriteLine($"Exception in HelixTestRunner: {e}");
exitCode = 1;
}
return exitCode;
Expand Down
4 changes: 2 additions & 2 deletions eng/tools/tools.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"projects": [
"eng\\tools\\BaselineGenerator\\BaselineGenerator.csproj",
"eng\\tools\\RepoTasks\\RepoTasks.csproj",
"eng\\tools\\RunTests\\RunTests.csproj"
"eng\\tools\\HelixTestRunner\\HelixTestRunner.csproj"
]
}
}
}