Skip to content

[release/8.0] Pass dotnetEfVersion in Helix test runner #52103

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

Open
wants to merge 1 commit into
base: release/8.0
Choose a base branch
from
Open
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions eng/helix/content/runtests.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set $arch=%4
set $quarantined=%5
set $helixTimeout=%6
set $installPlaywright=%7
set $dotnetEfVersion=%8
REM Batch only supports up to 9 arguments using the %# syntax, need to shift to get more

set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
Expand All @@ -24,8 +25,8 @@ echo.

set exit_code=0

echo "Running tests: dotnet %HELIX_CORRELATION_PAYLOAD%/HelixTestRunner/HelixTestRunner.dll --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --helixTimeout %$helixTimeout% --playwright %$installPlaywright%"
dotnet %HELIX_CORRELATION_PAYLOAD%/HelixTestRunner/HelixTestRunner.dll --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --helixTimeout %$helixTimeout% --playwright %$installPlaywright%
echo "Running tests: dotnet %HELIX_CORRELATION_PAYLOAD%/HelixTestRunner/HelixTestRunner.dll --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --helixTimeout %$helixTimeout% --playwright %$installPlaywright% --dotnetEf %$dotnetEfVersion%"
dotnet %HELIX_CORRELATION_PAYLOAD%/HelixTestRunner/HelixTestRunner.dll --target %$target% --runtime %$aspRuntimeVersion% --queue %$queue% --arch %$arch% --quarantined %$quarantined% --helixTimeout %$helixTimeout% --playwright %$installPlaywright% --dotnetEf %$dotnetEfVersion%
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 @@ -78,8 +78,8 @@ sync

exit_code=0

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

Expand Down
4 changes: 2 additions & 2 deletions eng/targets/Helix.targets
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@
When the targeting pack builds, it has exactly the same version as the shared framework. Passing
SharedFxVersion because that's needed even when the targeting pack isn't building.
-->
<Command Condition="$(IsWindowsHelixQueue)">call runtests.cmd $(TargetFileName) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(_TestingArchitecture) $(RunQuarantinedTests) $(HelixTimeout) $(TestDependsOnPlaywright)</Command>
<Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(_TestingArchitecture) $(RunQuarantinedTests) $(HelixTimeout) $(TestDependsOnPlaywright)</Command>
<Command Condition="$(IsWindowsHelixQueue)">call runtests.cmd $(TargetFileName) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(_TestingArchitecture) $(RunQuarantinedTests) $(HelixTimeout) $(TestDependsOnPlaywright) $(DotnetEfVersion)</Command>
<Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(SharedFxVersion) $(_HelixFriendlyNameTargetQueue) $(_TestingArchitecture) $(RunQuarantinedTests) $(HelixTimeout) $(TestDependsOnPlaywright) $(DotnetEfVersion)</Command>
<Command Condition="'$(HelixCommand)' != ''">$(HelixCommand)</Command>
<Timeout>$(HelixTimeout)</Timeout>
</HelixWorkItem>
Expand Down
10 changes: 9 additions & 1 deletion eng/tools/HelixTestRunner/HelixTestRunnerOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,25 @@ public static HelixTestRunnerOptions Parse(string[] args)
new Option(
aliases: new string[] { "--source" },
description: "The restore sources to use during testing")
{ Argument = new Argument<string>() { Arity = ArgumentArity.ZeroOrMore }, Required = true }
{ Argument = new Argument<string>() { Arity = ArgumentArity.ZeroOrMore }, Required = true },

new Option(
aliases: new string[] { "--dotnetEf" },
description: "The version of the dotnet-ef tool being installed and used")
{ Argument = new Argument<string>(), Required = true }
};

var parseResult = command.Parse(args);
var sharedFxVersion = parseResult.ValueForOption<string>("--runtime");
var dotnetEfVersion = parseResult.ValueForOption<string>("--dotnetEf");
var options = new HelixTestRunnerOptions
{
Architecture = parseResult.ValueForOption<string>("--arch"),
HelixQueue = parseResult.ValueForOption<string>("--queue"),
InstallPlaywright = parseResult.ValueForOption<bool>("--playwright"),
Quarantined = parseResult.ValueForOption<bool>("--quarantined"),
RuntimeVersion = sharedFxVersion,
DotnetEfVersion = dotnetEfVersion,
Target = parseResult.ValueForOption<string>("--target"),
Timeout = TimeSpan.Parse(parseResult.ValueForOption<string>("--helixTimeout"), CultureInfo.InvariantCulture),

Expand All @@ -87,6 +94,7 @@ public static HelixTestRunnerOptions Parse(string[] args)
public bool InstallPlaywright { get; private set; }
public bool Quarantined { get; private set; }
public string RuntimeVersion { get; private set; }
public string DotnetEfVersion { get; private set; }
public string Target { get; private set; }
public TimeSpan Timeout { get; private set; }

Expand Down
2 changes: 1 addition & 1 deletion eng/tools/HelixTestRunner/TestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
cancellationToken: new CancellationTokenSource(TimeSpan.FromMinutes(2)).Token);

await ProcessUtil.RunAsync($"{Options.DotnetRoot}/dotnet",
$"tool install dotnet-ef --tool-path {Options.HELIX_WORKITEM_ROOT} --add-source {correlationPayload}",
$"tool install dotnet-ef --tool-path {Options.HELIX_WORKITEM_ROOT} --add-source {correlationPayload} --version {Options.DotnetEfVersion}",
environmentVariables: EnvironmentVariables,
outputDataReceived: ProcessUtil.PrintMessage,
errorDataReceived: ProcessUtil.PrintErrorMessage,
Expand Down