Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
revert: extract pipeline TFM fix to its own PR
The TestBaseModule fix is unrelated to lazy hook registration and now
lives on its own branch so it can land independently and unblock
other open PRs.
  • Loading branch information
thomhurst committed Apr 25, 2026
commit 96c0b8abf0aec8154e809f89b95c4fa47073e47b
27 changes: 2 additions & 25 deletions TUnit.Pipeline/Modules/Abstract/TestBaseModule.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Runtime.InteropServices;
using Microsoft.Extensions.Logging;
using ModularPipelines.Context;
using ModularPipelines.DotNet.Extensions;
using ModularPipelines.DotNet.Options;
Expand Down Expand Up @@ -31,19 +30,10 @@ protected virtual IEnumerable<string> TestableFrameworks

foreach (var framework in TestableFrameworks)
{
var (testOptions, executionOptions) = await GetTestOptions(context, framework, cancellationToken);

// Test projects no longer multi-target every TFM by default (see TestProject.props).
// Skip frameworks that this project did not actually build to avoid spurious
// "process cannot find the file" errors for missing per-TFM output binaries.
if (!HasFrameworkOutput(executionOptions, framework))
{
context.Logger.LogInformation($"Skipping {framework}: no build output found for this test project.");
continue;
}

var testResult = await context.SubModule<CommandResult>(framework, async () =>
{
var (testOptions, executionOptions) = await GetTestOptions(context, framework, cancellationToken);

var finalExecutionOptions = SetDefaults(testOptions, executionOptions ?? new CommandExecutionOptions(), framework);

return await context.DotNet().Run(testOptions, finalExecutionOptions, cancellationToken);
Expand All @@ -55,19 +45,6 @@ protected virtual IEnumerable<string> TestableFrameworks
return results;
}

private static bool HasFrameworkOutput(CommandExecutionOptions? executionOptions, string framework)
{
var workingDirectory = executionOptions?.WorkingDirectory;
if (string.IsNullOrEmpty(workingDirectory))
{
// Cannot determine — fall through to attempt the run (preserves prior behaviour).
return true;
}

var binPath = Path.Combine(workingDirectory, "bin", "Release", framework);
return Directory.Exists(binPath);
}

private CommandExecutionOptions SetDefaults(DotNetRunOptions testOptions, CommandExecutionOptions executionOptions, string framework)
{
var envVars = executionOptions.EnvironmentVariables ?? new Dictionary<string, string?>();
Expand Down
Loading