Skip to content

--matrix output silently suppressed when no test files are provided #180

@Malcolmnixon

Description

@Malcolmnixon

Summary

When --matrix\ is specified but no test files are provided (either because --tests\ was omitted, or because a glob pattern resolved to zero files), the trace matrix file is never written and no diagnostic is emitted. The tool exits with code 0.

Root Cause

In \Program.cs, the --matrix\ export block is nested inside the \if (context.TestFiles.Count > 0)\ guard:

\\csharp
TraceMatrix? traceMatrix = null;
if (context.TestFiles.Count > 0)
{
traceMatrix = new TraceMatrix(requirements, context.TestFiles.ToArray());

// Export trace matrix if requested
if (context.Matrix != null)   // <-- never reached when TestFiles is empty
{
    traceMatrix.Export(...);
}

}
\\

When \TestFiles\ is empty, \ raceMatrix\ stays
ull\ and the matrix export is skipped entirely. By contrast, --enforce\ correctly handles \ raceMatrix == null\ with an explicit error message.

Observed Behaviour

  • No trace matrix file is created
  • No warning or error is emitted
  • The tool exits 0, giving no indication that the requested output was not produced

Compounding Factor

This issue is directly compounded by the absolute-path glob bug (see issue #179): an absolute-path --tests\ pattern silently resolves to zero files, which then silently suppresses --matrix\ output — two silent failures with no diagnostic at either stage.

Expected Behaviour

When --matrix\ is requested but no test files are available, the tool should emit a warning or error (consistent with --enforce\ behaviour) informing the user that the trace matrix cannot be generated without test result files.

Affected Files

  • \src/DemaConsulting.ReqStream/Program.cs\ — \ProcessRequirements\ method

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions