Add codegen and logging test coverage with Codecov config - #260
Merged
Conversation
All changes are test and configuration only, no functional/library behavior changes. - Add codecov.yml scoped to the LanguageTags library (generated code ignored), kept informational until a default-branch upload establishes the baseline. - Cover the codegen emitters: SaveCodeAsync tests parse the emitted C# with Roslyn to assert it is syntactically valid; unit-test LanguageSchema.GetCodeGenString including quote escaping. - Cover LogExtensions LogAndPropagate/LogAndHandle. - Drop redundant LanguageTagsTests/.editorconfig overrides (IDE0058, IDE0052, CS1591); the discard operator already satisfies IDE0058. Keep CA1707 and CA1515 with rationale comments. - Add Microsoft.CodeAnalysis.CSharp as a test-only dependency. Hand-written coverage rises from ~76.6% to ~91.6%. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## develop #260 +/- ##
============================================
- Coverage 99.76% 87.43% -12.34%
============================================
Files 15 11 -4
Lines 232994 1973 -231021
Branches 243 243
============================================
- Hits 232450 1725 -230725
+ Misses 462 166 -296
Partials 82 82 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds additional test coverage and Codecov configuration for the LanguageTags repository, focused on validating codegen emitters and logging helpers, while keeping Codecov reporting scoped to hand-written library code.
Changes:
- Add Codecov configuration (
codecov.yml) to report coverage for the LanguageTags library while ignoring generated code and non-library projects. - Add Roslyn-based tests that emit code via
SaveCodeAsync(...)and assert the generated output parses without C# syntax errors. - Add targeted unit tests for
LanguageSchema.GetCodeGenString(...)and logging helpers, plus minor test.editorconfigcleanup.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| LanguageTagsTests/UnM49Tests.cs | Adds Roslyn parse-validation coverage for UnM49Data.SaveCodeAsync. |
| LanguageTagsTests/Rfc5646Tests.cs | Adds Roslyn parse-validation coverage for Rfc5646Data.SaveCodeAsync. |
| LanguageTagsTests/Iso6393Tests.cs | Adds Roslyn parse-validation coverage for Iso6393Data.SaveCodeAsync. |
| LanguageTagsTests/Iso6392Tests.cs | Adds Roslyn parse-validation coverage for Iso6392Data.SaveCodeAsync. |
| LanguageTagsTests/LogExtensionsTests.cs | Adds tests for LogExtensions.LogAndPropagate / LogAndHandle. |
| LanguageTagsTests/LanguageTagsTests.csproj | Adds test-only dependency on Microsoft.CodeAnalysis.CSharp. |
| LanguageTagsTests/LanguageSchemaTests.cs | Adds unit coverage for LanguageSchema.GetCodeGenString(...) overloads. |
| LanguageTagsTests/.editorconfig | Removes redundant analyzer suppressions, keeps test-specific CA rules. |
| Directory.Packages.props | Centralizes the Microsoft.CodeAnalysis.CSharp package version. |
| codecov.yml | Adds Codecov settings and ignore rules to scope coverage reporting. |
- LogExtensions tests now use a capturing ILogger to assert the exception is logged at Error level, not just the boolean return value. - codecov.yml: add an explicit "**/*.g.cs" ignore glob so the config literally matches the stated intent (source-generator output was already excluded via ".artifacts/**"). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 11, 2026
Merged
This was referenced Jul 12, 2026
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
Test and configuration changes only, no functional/library behavior changes.
codecov.yml): scoped to the LanguageTags library, generated code ignored so coverage reflects hand-written code. Keptinformational(report-only) until a default-branch upload establishes a baseline under these ignores; then it can be flipped to block on regressions.SaveCodeAsync_GeneratesCodetests emit the code and parse it with Roslyn (CSharpSyntaxTree.ParseText), asserting zero error-severity diagnostics, so an escaping/literal regression fails at test time.LanguageSchema.GetCodeGenStringis unit-tested including quote escaping.LogExtensions.LogAndPropagate/LogAndHandle.LanguageTagsTests/.editorconfigoverrides (IDE0058,IDE0052,CS1591); the discard operator already satisfiesIDE0058.CA1707andCA1515stay with rationale comments.Microsoft.CodeAnalysis.CSharpas a test-only package (IsPackable=false, never ships in the NuGet lib).Hand-written coverage rises from ~76.6% to ~91.6% (310 tests, all passing).
Follow-up tracked in #259 (deterministic offline codegen drift check on PRs).
🤖 Generated with Claude Code