chore: relocate projects into src/ and wire up code coverage#31
Merged
Conversation
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`
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 ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
McpManager.Core.*andMcpManager.Web.Portal) under a newsrc/folder, matching the conventional .NET monorepo layout already used by the test projects undertests/. The solution file, Dockerfile, CI workflow, dependabot config, README, and CONTRIBUTING all get the matching path updates.dorny/test-reporter.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/--settingsflags.Code changes
McpManager.sln— five production-project paths re-aimed atsrc/McpManager.*/....src/McpManager.Core.*/...,src/McpManager.Web.Portal/...— 250+ files moved viagit mvso history is preserved; inter-projectProjectReferenceentries remain sibling-relative and need no edits.tests/McpManager.UnitTests/*.csproj,tests/McpManager.IntegrationTests/*.csproj—ProjectReferencepaths re-aimed at..\..\src\McpManager.*; addedMicrosoft.Testing.Extensions.CodeCoverage 17.13.1andMicrosoft.Testing.Extensions.TrxReport 1.8.5(pinned to versions whoseMicrosoft.Testing.Platformdependency matches the 1.8.4 thatxunit.v3 3.1.0brings in — newer versions fail with aTypeLoadException)..github/workflows/ci.yml— adds abuild-and-testjob that runs afterlint. 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. Addscodecov/codecov-action@v6(flagunit-integration, requires the newCODECOV_TOKENsecret) anddorny/test-reporter@v3.permissions:block addschecks: writefor the test-reporter.codecov.yml(new) — project targetautowith 2% drop threshold, patch target 60%, flag carryforward enabled.ignore:excludessrc/McpManager.Core.Data/Migrations/**from the coverage view.Dockerfile—WORKDIR /src/McpManager.Web.Portal→WORKDIR /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— addcoverage/so the generated TRX + Cobertura artifacts aren't picked up by git or bydotnet csharpier check.README.md,CONTRIBUTING.md— everyMcpManager.Web.Portal//McpManager.Core.Data/reference now prefixed withsrc/.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*.trxfiles produced under./coverage/dotnet csharpier check .— passes aftercoverage/is ignoredCODECOV_TOKENrepository secret to be set — coverage upload will skip without it (fail_ci_if_error: false)