Skip to content

feat(5626): Python TRX/Cobertura HTML report; run-test-case.sh; unit-test w…#45

Open
OMpawar-21 wants to merge 1 commit intodevelopmentfrom
enhc/DX-5629
Open

feat(5626): Python TRX/Cobertura HTML report; run-test-case.sh; unit-test w…#45
OMpawar-21 wants to merge 1 commit intodevelopmentfrom
enhc/DX-5629

Conversation

@OMpawar-21
Copy link
Copy Markdown

Summary

Adds local and CI support for unit tests with coverage, and generates an HTML report from TRX + Cobertura using a Python script (no ReportGenerator / .NET 8+ requirement for HTML).

Changes

  • Scripts/run-unit-test-case.sh — Clears TestResults, runs dotnet test on the test project with TRX logging and Coverlet (XPlat code coverage).
  • Scripts/run-test-case.sh — Runs tests on the solution, finds coverage.cobertura.xml, invokes Scripts/generate_test_report.py to write Coverage-<date>/index.html under the test project’s TestResults folder.
  • Scripts/generate_test_report.py — Standard-library-only TRX + Cobertura parser; builds HTML (summary, pass rate, coverage tables, tests by class file). Duration removed from the report UI.
  • .github/workflows/unit-test.yml — Runs run-unit-test-case.sh on Windows for push and pull_request (no dorny/test-reporter).
  • Contentstack.Utils.Tests.csproj — Removed duplicate Reference to a built DLL; aligned test package versions (e.g. Test SDK, coverlet, Newtonsoft) with the management SDK pattern where applicable.

How to verify

  1. From repo root: bash Scripts/run-test-case.sh
  2. Open the printed path to .../TestResults/Coverage-Contentstack-DotNet-Test-Case-<date>/index.html in a browser.
  3. Confirm the Unit Test workflow passes on the PR.

Notes

  • No NuGet / library version bump — test and tooling only; Contentstack.Utils API and package version unchanged.
  • HTML reporting is optional for local use; CI uses the lighter unit-test script and still produces TRX + Cobertura for downstream tools.

…orkflow

Adds generate_test_report.py, run-test-case/run-unit-test-case.sh, unit-test workflow, and test project cleanup .
@OMpawar-21 OMpawar-21 requested a review from a team as a code owner March 26, 2026 07:02
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