Skip to content

Support Microsoft.Testing.Platform — mirrors upstream #1584 #19

Closed

Description

@ChrisonSimtian

Mirror of nuke-build/nuke#1584. Modernization — Microsoft is moving the dotnet test runner to a new platform; NUKE's ITest abstraction may need updates. Continues Matt's .NET-modernization direction.

Activity

  1. added
    release/Next
    on Jun 16, 2026
  2. IT-VBFK commented on Aug 17, 2026

    @IT-VBFK
    Contributor

    This has become a real problem since recently. Because xUnit.v3 v4.0 pulls in the "new" MTP v2.x package, an opt-in to MTP via global.json is unavoidable.

    But doing so, breaks DotNetTest() where SetProjectFile(Solution|Project) is bootstrapped like dotnet test /path/to/sln|csproj. But this cannot be handled by MTP which explicitly needs a --project or --solution argument now.

    Changing the general wrapper code to emit --project cannot be the solution either, because that would break calling dotnet test for VSTest.

    Ok.. a user can workaround this by omitting .SetProjectFile() and add .SetProcessArguments("--project", $"{Project.Path:d}") instead... not pretty, but working

    Same for the coverlet collector .SetDataCollector("XPlat Code Coverage"): MTP cannot handle this either, so same approach with.SetProcessArguments("--coverlet")

  3. IT-VBFK commented on Aug 18, 2026

    @IT-VBFK
    Contributor

    @ChrisonSimtian I can try to support this.

    Would this approach suffice?

    {
          "name": "MtpProjectFile",
          "type": "string",
          "format": "--project {value}",
          "position": 1,
          "help": "Specifies a path to the test project in the new MTP syntax."
    },

    which generates something like

    /// <summary>Specifies a path to the test project in the new MTP syntax.</summary>
    [Argument(Format = "--project {value}", Position = 1)] public string MtpProjectFile => Get<string>(() => MtpProjectFile);
    
    // ...
    
    /// <inheritdoc cref="DotNetTestSettings.ProjectFile"/>
    [Builder(Type = typeof(DotNetTestSettings), Property = nameof(DotNetTestSettings.MtpProjectFile))]
    public static T SetMtpProjectFile<T>(this T o, string v) where T : DotNetTestSettings => o.Modify(b => b.Set(() => o.MtpProjectFile, v));

    But this enables the use of:

    DotNetTest(s => s.SetProjectFile(Project).SetMtpProjectFile(Project))

    which fails when running, but I could live with that consumers know what they are doing.

  4. IT-VBFK commented on Aug 19, 2026

    @IT-VBFK
    Contributor

    I am a bit lost, because I have a project migrated to fully MTP and dotnet test /path/to/csproj is working fine.. and another project using MTP doesn't.

    Have to dig into this a bit.

  5. IT-VBFK commented on Aug 19, 2026

    @IT-VBFK
    Contributor

    Ok.. please scratch several above comments.

    I think I have now a whole insight what's going on.

    First of all: dotnet sdk 10.0.302+ has the positional csproj again (for MTP) so --project / --solution isn't necessary anymore and works with the current dotnet wrapper Fallout ships. ☑️ That's good

    The reason was for me: I haven't migrated everything to MTP, meaning I had references to Microsoft.NET.Test.Sdk (which is the VSTest adapter). I also left over the xunit.runner.visualstudio which is also in charge for keeping vstest capabilities. Removing did not break anything, because xunit.v3 v4 (aka xunit v4) brings in the MTP package which ships a runner already (also for Rider).

    Final thing: switching the package coverlet.collector (vstest) to coverlet.MTP (MTP, same version) + in the Fallout DotNetTest() switch .SetDataCollector("XPlat Code Coverage") to .AddAdditionalProcessArguments("--coverlet") fixes the pipeline for our biggest solution (about 26 Projects (incl. test projects)).

    Side note: To make coverlet work you have to remove several PrivateAssets handling, because the source generator is relying on those.

  6. aneilmac commented on Sep 8, 2026

    @aneilmac

    Would love to see this if possible. Really happy Fallout is taking on the Nuke mantle and this would be a great feature for the immediate term.

  7. dennisdoomen commented on Oct 10, 2026

    @dennisdoomen
    Collaborator

    Superseded by #674

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    release/Next

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions