Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/validate-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,18 @@ jobs:
- name: Check EditorConfig step
run: docker run --rm -v "$PWD":/check --workdir /check mstruebing/editorconfig-checker:latest

# --collect drives coverlet.collector to emit Cobertura XML into ./coverage/<guid>/.
# global.json opts into the native Microsoft.Testing.Platform runner, so the VSTest bridge
# (and its --collect data collector) is gone.
# --coverage-output stays unset because pinning one filename gives every test project in the solution the same path, and the last to finish overwrites the rest.
# The default <guid>.cobertura.xml written instead is a name codecov-cli's finder does not match, so each report is prefixed rather than renamed, keeping the guid that makes it unique.
- name: Run unit tests step
run: dotnet test --collect:"XPlat Code Coverage" --results-directory ./coverage
run: |
set -Eeuo pipefail
dotnet test --coverage --coverage-output-format cobertura --results-directory ./coverage
for report in ./coverage/*.cobertura.xml; do
[ -e "$report" ] || continue
mv "$report" "./coverage/coverage-$(basename "$report")"
done

# Report-only: fail_ci_if_error is false so a Codecov hiccup or an absent token never fails the gate.
- name: Upload coverage to Codecov step
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@
.artifacts
.DS_Store
*.user

# Coverage output (dotnet Microsoft.Testing.Extensions.CodeCoverage)
coverage/
[Tt]est[Rr]esults/
*.cobertura.xml
*.coverage
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ For comprehensive coding and formatting standards, follow:
- `version --versionpath=./Make/Version.json`.
- `matrix --versionpath=./Make/Version.json --matrixpath=./Make/Matrix.json --updateversion`.
- `make --versionpath=./Make/Version.json --makedirectory=./Make --dockerdirectory=./Docker --versionlabel=Beta`.
- Tests run on the native Microsoft.Testing.Platform runner, opted into by `global.json`. Locally that is
plain `dotnet test`; CI adds coverage with
`dotnet test --coverage --coverage-output-format cobertura --results-directory ./coverage`, then prefixes
each report to `coverage-<guid>.cobertura.xml` so codecov-cli's file finder matches it. Running an
MTP-based test project through the VSTest target is what fails, so the old
`--collect:"XPlat Code Coverage"` form is an error here specifically because this project opted in.
- Formatting and style checks are enforced by Husky.Net and VS Code tasks.
- Required tasks are documented in `CODESTYLE.md` and `.husky/task-runner.json`.
- C# code should be formatted with CSharpier, then verified with `dotnet format` (style).
Expand Down
12 changes: 4 additions & 8 deletions CreateMatrixTests/CreateMatrixTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,14 @@
<TargetFramework>net10.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AwesomeAssertions" Version="9.5.0" />
<PackageReference Include="AwesomeAssertions" Version="9.6.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.9.0" />
<PackageReference Include="xunit.v3" Version="3.2.2" />
<PackageReference Include="xunit.analyzers" Version="1.27.0">
<PackageReference Include="xunit.v3" Version="4.0.0" />
<PackageReference Include="xunit.analyzers" Version="2.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5" PrivateAssets="All" />
<PackageReference Include="coverlet.collector" Version="10.0.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" Version="18.9.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CreateMatrix\CreateMatrix.csproj" />
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}