Skip to content

chore: relocate projects into src/ and wire up code coverage#31

Merged
daniel3303 merged 2 commits into
mainfrom
worktree-src-folder-restructure
May 14, 2026
Merged

chore: relocate projects into src/ and wire up code coverage#31
daniel3303 merged 2 commits into
mainfrom
worktree-src-folder-restructure

Conversation

@daniel3303

Copy link
Copy Markdown
Owner

Summary

  • Moves the five production projects (McpManager.Core.* and McpManager.Web.Portal) under a new src/ folder, matching the conventional .NET monorepo layout already used by the test projects under tests/. The solution file, Dockerfile, CI workflow, dependabot config, README, and CONTRIBUTING all get the matching path updates.
  • Adds code-coverage and TRX test-result reporting to the CI workflow, mirroring the Equibles repo's setup. Each test project now produces a Cobertura XML that the workflow uploads to Codecov; test results render inline on the PR via dorny/test-reporter.
  • Coverage runs through MTP-native packages (Microsoft.Testing.Extensions.CodeCoverage, Microsoft.Testing.Extensions.TrxReport), not coverlet/VSTest — xUnit v3 runs under the Microsoft Testing Platform, which doesn't honour VSTest-style --collect/--logger/--settings flags.

Code changes

  • McpManager.sln — five production-project paths re-aimed at src/McpManager.*/....
  • src/McpManager.Core.*/..., src/McpManager.Web.Portal/... — 250+ files moved via git mv so history is preserved; inter-project ProjectReference entries remain sibling-relative and need no edits.
  • tests/McpManager.UnitTests/*.csproj, tests/McpManager.IntegrationTests/*.csprojProjectReference paths re-aimed at ..\..\src\McpManager.*; added Microsoft.Testing.Extensions.CodeCoverage 17.13.1 and Microsoft.Testing.Extensions.TrxReport 1.8.5 (pinned to versions whose Microsoft.Testing.Platform dependency matches the 1.8.4 that xunit.v3 3.1.0 brings in — newer versions fail with a TypeLoadException).
  • .github/workflows/ci.yml — adds a build-and-test job that runs after lint. Test command uses MTP-native flags after --: dotnet test --solution McpManager.sln --no-build -c Release -- --coverage --coverage-output-format cobertura --report-trx --results-directory $GITHUB_WORKSPACE/coverage. Adds codecov/codecov-action@v6 (flag unit-integration, requires the new CODECOV_TOKEN secret) and dorny/test-reporter@v3. permissions: block adds checks: write for the test-reporter.
  • codecov.yml (new) — project target auto with 2% drop threshold, patch target 60%, flag carryforward enabled. ignore: excludes src/McpManager.Core.Data/Migrations/** from the coverage view.
  • DockerfileWORKDIR /src/McpManager.Web.PortalWORKDIR /src/src/McpManager.Web.Portal (the build context is the repo root, so the project now lives at <context>/src/McpManager.Web.Portal/).
  • .github/dependabot.yml — npm ecosystem directory updated to /src/McpManager.Web.Portal.
  • .gitignore / .csharpierignore — add coverage/ so the generated TRX + Cobertura artifacts aren't picked up by git or by dotnet csharpier check.
  • README.md, CONTRIBUTING.md — every McpManager.Web.Portal/ / McpManager.Core.Data/ reference now prefixed with src/.

Test plan

  • dotnet build McpManager.sln -c Release — clean build (0 warnings, 0 errors)
  • dotnet test --solution McpManager.sln --no-build -c Release -- --coverage --coverage-output-format cobertura --report-trx --results-directory ./coverage — 9/9 tests pass, two *.cobertura.xml + two *.trx files produced under ./coverage/
  • dotnet csharpier check . — passes after coverage/ is ignored
  • CI lint job passes
  • CI build-and-test job passes, coverage uploads to Codecov, test-reporter renders results
  • Requires CODECOV_TOKEN repository secret to be set — coverage upload will skip without it (fail_ci_if_error: false)

Move the five production projects (McpManager.Core.* and
McpManager.Web.Portal) under src/, keeping the sln, tests/, and config
files at the repo root. Test ProjectReferences re-aim at ..\..\src\;
Dockerfile, dependabot, ci.yml, README, and CONTRIBUTING get the
matching path updates.

Adds code-coverage + TRX reporting to CI via MTP-native
Microsoft.Testing.Extensions.CodeCoverage and TrxReport packages on
each test project. The workflow runs dotnet test against the sln,
collects Cobertura coverage and TRX results into ./coverage, uploads
to Codecov (with a new codecov.yml configuring auto/2%/60% gates and
ignoring EF Core migrations), and renders inline test results with
dorny/test-reporter.

Validated locally: 9/9 tests pass and both *.cobertura.xml and *.trx
artifacts land in ./coverage.
Public repo on GitHub Actions can use Codecov's tokenless OIDC flow,
which removes the need for the CODECOV_TOKEN repository secret. The
codecov-action mints a short-lived OIDC token from GitHub's identity
provider on every run; Codecov verifies it server-side.

- adds `id-token: write` permission to the workflow
- swaps `token: ${{ secrets.CODECOV_TOKEN }}` for `use_oidc: true`
@codecov

codecov Bot commented May 14, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@daniel3303
daniel3303 merged commit bd90221 into main May 14, 2026
8 checks passed
@daniel3303
daniel3303 deleted the worktree-src-folder-restructure branch May 14, 2026 16:54
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.

1 participant