Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 17, 2025

Documentation showed dotnet test --coverage --report-trx which fails with MSB1001. TUnit extension flags must be passed after -- separator as program arguments.

Changes

docs/docs/examples/tunit-ci-pipeline.md

  • Updated explanatory note to clarify -- separator requirement for extension flags (--coverage, --report-trx, --results-directory)
  • Fixed all CI/CD examples: GitHub Actions, Azure DevOps, GitLab CI, CircleCI, Docker
  • Removed incorrect claim about .NET 10 SDK not requiring separator

docs/docs/execution/ci-cd-reporting.md

  • Fixed Azure DevOps, Jenkins, and GitLab CI examples

Pattern

# Before (fails with MSB1001)
dotnet test --configuration Release --no-build --coverage --report-trx

# After (correct)
dotnet test --configuration Release --no-build -- --coverage --report-trx

Native dotnet test flags (--configuration, --no-build) stay before --.
TUnit extension flags (--coverage, --report-trx, --results-directory) go after --.

Original prompt

This section details on the original issue you should resolve

<issue_title>[Bug]: Documented workflow does not work in GitHub Actions</issue_title>
<issue_description>### Description

According to the documentation, the following code should execute the tests in the build pipeline:

dotnet test --configuration Release --no-build --coverage --report-trx --results-directory ./TestResults

However the pipeline fails with MSB1001.

I also tried to run the command locally on the template project and get the same error:
Image

Expected Behavior

A clear command to run TUnit with coverage information in a GitHub action build pipeline

Actual Behavior

The documented command fails

Steps to Reproduce

  • Create a TUnit template project (dotnet new TUnit -n "MyTest")
  • Run dotnet build --configuration Release --no-restore
  • Run dotnet test --configuration Release --no-build --coverage --report-trx --results-directory ./TestResults

TUnit Version

1.5.53

.NET Version

.NET 8.0

Operating System

Windows

IDE / Test Runner

dotnet CLI (dotnet test / dotnet run)

Error Output / Stack Trace

Additional Context

No response

IDE-Specific Issue?

  • I've confirmed this issue occurs when running via dotnet test or dotnet run, not just in my IDE</issue_description>

<agent_instructions>Update documentation to adjust dotnet test snippet examples, and state that when using CLI flags/args for extensions from packages, such as code coverage, they must go after a separate -- so they are parsed as program args and not dotnet test args. E.g. dotnet test -- --coverage instead of dotnet test --coverage</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@thomhurst Are you using the .NET 10 SDK? @thomhurst Looks like they still need a `--` before them, even using the .NET 10 SDK

e.g. dotnet test -- --coverage instead of dotnet test --coverage</comment_new>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix documented workflow for GitHub Actions Fix dotnet test documentation to require -- separator for TUnit extension flags Dec 17, 2025
Copilot AI requested a review from thomhurst December 17, 2025 20:32
@thomhurst thomhurst marked this pull request as ready for review December 28, 2025 12:11
@thomhurst thomhurst merged commit 622c444 into main Dec 28, 2025
5 checks passed
@thomhurst thomhurst deleted the copilot/fix-github-actions-workflow-again branch December 28, 2025 12:12
This was referenced Dec 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Documented workflow does not work in GitHub Actions

2 participants