Skip to content

fix(ci): forward coverlet.MTP coverage args after -- so coverage is actually collected - #80

Closed
philippemnoel wants to merge 1 commit into
mainfrom
fix/ci-coverage-collection
Closed

fix(ci): forward coverlet.MTP coverage args after -- so coverage is actually collected#80
philippemnoel wants to merge 1 commit into
mainfrom
fix/ci-coverage-collection

Conversation

@philippemnoel

Copy link
Copy Markdown
Member

Problem

.github/workflows/ci.yml (Test step) and .github/workflows/schema-compat.yml (Test step) passed coverage flags as top-level dotnet test arguments:

dotnet test \
  --no-build --configuration Release \
  --framework ... --results-directory TestResults/... \
  --coverlet \
  --coverlet-output-format cobertura

This project's test suite uses TUnit + coverlet.MTP, i.e. it runs on Microsoft.Testing.Platform (MTP). --coverlet / --coverlet-output-format are options provided by the coverlet.MTP extension, not by dotnet test itself. When placed at the top level they are handled by dotnet test's own argument parser (not forwarded reliably to the test application), so coverage was never collected and the Codecov upload step was a no-op — no cobertura report was ever produced in --results-directory.

Root cause / how I verified it

  • Coverage package: coverlet.MTP v10.0.1 — declared in Directory.Packages.props and referenced in tests/ParadeDB.EntityFrameworkCore.Tests.csproj. (Not coverlet.collector and not coverlet.msbuild, so --collect:"XPlat Code Coverage" and msbuild /p:CollectCoverage would both be wrong here.)
  • Runner: TUnit + <OutputType>Exe</OutputType> → Microsoft.Testing.Platform. global.json sets "test": { "runner": "Microsoft.Testing.Platform" }, so dotnet test runs in MTP mode on the .NET 10 SDK.
  • Per the official dotnet test MTP docs, arguments meant for the test application / MTP extensions are forwarded after a -- separator (dotnet test -- <app args>). Using the separator also avoids the documented parser quirk where unrecognized tokens interleaved with options dotnet test understands (--results-directory, --framework) change meaning.
  • Per the coverlet.MTP integration docs, the flag names --coverlet and --coverlet-output-format cobertura are correct, and coverage reports are written into the --results-directory folder with a timestamped filename (e.g. coverage.cobertura.<timestamp>.xml). There is no separate output-path flag.

Fix

Forward the coverlet flags after -- in both workflows (no other changes):

dotnet test \
  --no-build --configuration Release \
  --framework ... --results-directory TestResults/... \
  -- \
  --coverlet \
  --coverlet-output-format cobertura

The Codecov upload step already points directory: at the same --results-directory, and since coverlet emits a timestamped filename there, scanning the directory (rather than a hardcoded filename) remains the correct approach — no change needed to the upload step.

Validation

  • Both workflow files parse as valid YAML (python3 -c "import yaml; ...").
  • The .NET SDK is not available in my environment, so I could not run the full build + test + coverage locally. Please watch this PR's first CI run to confirm a coverage.cobertura.*.xml is produced under TestResults/<framework>/ and that the Codecov upload picks it up (the verbose: true Codecov step output will show the discovered file).

Filed from a CI audit of bogus dotnet test flags.

The Test step passed --coverlet and --coverlet-output-format as top-level
dotnet test arguments. coverlet.MTP is a Microsoft.Testing.Platform (MTP)
extension (this project uses TUnit + coverlet.MTP, with dotnet test running
in MTP mode via global.json), so its options must be forwarded to the test
application after a -- separator. Passed at the top level they are subject
to dotnet test's own parser and effectively ignored, so no coverage was
ever produced and the Codecov upload was a no-op.

Move the coverlet flags after -- in both ci.yml and schema-compat.yml.
Reports continue to be written into --results-directory, which the Codecov
step already scans.
@isaacvando

Copy link
Copy Markdown
Collaborator

This looks unnecessary to me. We already have up-to date coverage information: https://app.codecov.io/gh/paradedb/efcore-paradedb

@isaacvando isaacvando closed this Jun 15, 2026
@philippemnoel
philippemnoel deleted the fix/ci-coverage-collection branch June 15, 2026 14:34
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.

2 participants