Skip to content

[MTP] GetCurrentExecutableInfo shouldn't calculate command line arguments via Environment #5239

@Youssef1313

Description

@Youssef1313

Whatever was passed to CreateBuilderAsync should be used instead.

For example, if I write my custom Main and do the following:

if (args.Length == 0)
{
    args = ["--retry-failed-tests", "1"];
}

var builder = await TestApplication.CreateBuilderAsync(args);
SelfRegisteredExtensions.AddSelfRegisteredExtensions(builder, args);
using var app = await builder.BuildAsync();
return await app.RunAsync();

Retry extension will throw an exception, because GetCurrentExecutableInfo doesn't have the correct arguments.

One important scenario to not regress is if we are running under dotnet.exe.

Metadata

Metadata

Assignees

Labels

Area: MTPBelongs to the Microsoft.Testing.Platform core library

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions