Skip to content

Commit

Permalink
Pass dotnetEfVersion in Helix test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
wtgodbe committed Nov 15, 2023
1 parent 8d157a1 commit 4f873f6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
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 @@ -134,7 +134,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

0 comments on commit 4f873f6

Please sign in to comment.