Skip to content

Commit 531d9e2

Browse files
authored
Merge pull request #26 from TyKonKet/copilot/fix-25
Comprehensive Improvements to Unit Test Suite: Coverage, Naming, Organization, and Code Quality
2 parents b55d345 + ab92913 commit 531d9e2

27 files changed

Lines changed: 1521 additions & 237 deletions

.github/workflows/dotnet_test_runner.yml

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: .NET Test Runner
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [ "main" ]
6+
branches: [ "main" ]
7+
pull_request:
8+
branches: [ "main" ]
79

810
jobs:
911

@@ -34,10 +36,38 @@ jobs:
3436
with:
3537
dotnet-version: 10.x
3638

37-
- name: Run tests
39+
- name: Run tests with coverage
3840
run: >
3941
dotnet test
4042
--configuration Release
4143
--logger "GitHubActions;summary.includePassedTests=true;summary.includeSkippedTests=true"
44+
--collect:"XPlat Code Coverage"
45+
--results-directory ./coverage
4246
--
43-
RunConfiguration.CollectSourceInformation=true
47+
RunConfiguration.CollectSourceInformation=true
48+
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
49+
50+
- name: Upload coverage to Codecov
51+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24
52+
with:
53+
directory: ./Tests/TyKonKet.BarcodeGenerator.Tests/coverage
54+
files: '**/*.xml'
55+
fail_ci_if_error: false
56+
verbose: true
57+
58+
- name: Generate coverage report
59+
if: always()
60+
run: |
61+
dotnet tool install -g dotnet-reportgenerator-globaltool
62+
reportgenerator \
63+
-reports:"coverage/**/*.xml" \
64+
-targetdir:"coverage/report" \
65+
-reporttypes:"Html;Badges" \
66+
-verbosity:Info
67+
68+
- name: Upload coverage report artifact
69+
if: always()
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: coverage-report
73+
path: Tests/TyKonKet.BarcodeGenerator.Tests/coverage/report

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,12 @@ We welcome contributions from the community! Here's how you can help:
183183
- Improve documentation and examples
184184
- Share your use cases and feedback
185185

186+
**Testing:**
187+
- Run the comprehensive test suite: `dotnet test --configuration Release`
188+
- Generate code coverage reports: `./scripts/run-coverage.sh` (Linux/macOS) or `.\scripts\run-coverage.ps1` (Windows)
189+
- Review [test documentation](Tests/TyKonKet.BarcodeGenerator.Tests/README.md) for testing guidelines
190+
- Ensure 80%+ code coverage for new features
191+
186192
---
187193

188194
## 📄 License
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coverage/

Tests/TyKonKet.BarcodeGenerator.Tests/BarcodeOptionsTest.cs

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)