Skip to content

Support comments in testconfig on .NET Framework - #10144

Merged
Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/support-testconfig-comments
Jul 22, 2026
Merged

Amaury Levé (Evangelink) merged 1 commit into
mainfrom
dev/amauryleve/support-testconfig-comments

Conversation

@Evangelink

Copy link
Copy Markdown
Member

Summary

  • add opt-in // and /* ... */ comment skipping to the vendored Jsonite reader
  • enable comment handling only for the .NET Framework testconfig.json parser, keeping server JSON strict by default
  • cover comments around properties and values, numeric values, URL strings, literal NUL characters, and unterminated block comments

Jsonite upstream is archived and does not provide a newer version with comment support.

Fixes #10137

Testing

  • Microsoft.Testing.Platform.UnitTests on net462: 1,443 passed
  • Microsoft.Testing.Platform.UnitTests on net8.0: 1,462 passed

Add opt-in comment handling to the vendored Jsonite reader and enable it only for testconfig parsing, matching the System.Text.Json path while keeping server JSON strict.

Co-authored-by: Copilot App <[email protected]>

Copilot-Session: b4812bf6-4b85-4c92-a153-a3b4c038b6aa
Copilot AI review requested due to automatic review settings July 22, 2026 16:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds opt-in comment parsing to the vendored Jsonite reader, enabling comments in .NET Framework testconfig.json while preserving strict defaults elsewhere.

Changes:

  • Supports // and /* ... */ comments through JsonSettings.
  • Enables comments for the legacy configuration parser.
  • Adds coverage for valid, invalid, and edge-case comments.
Show a summary per file
File Description
JsoniteTests.cs Tests opt-in behavior and unterminated comments.
ConfigurationManagerTests.cs Tests commented configuration files and edge cases.
JsonTypes.cs Adds the AllowComments setting.
JsonReader.cs Implements comment skipping during parsing.
JsonConfigurationFileParser.netstandard.cs Enables comments for the legacy parser.

Review details

  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Medium

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test quality grade — PR #10144

GradeTestNotes
A (90–100) new JsoniteTests.
Deserialize_
CommentsAreDisallowedByDefault
Expression-bodied; ThrowsExactly(JsonException) is complete on its own — no issues found.
A (90–100) new JsoniteTests.
Deserialize_
CommentsCanBeAllowed
Clear AAA; asserts both parse success and correct value via Assert.IsTrue — no issues found.
A (90–100) new JsoniteTests.
Deserialize_
UnterminatedBlockCommentThrows
Exact-type exception assertion on a specific error path; clean structure — no issues found.

Note: Changes in ConfigurationManagerTests.cs only extend the GetConfigurationValueFromJsonData data-provider method (new yield return rows); no test method bodies were modified.

This advisory comment was generated automatically. Grades are heuristic
and informational — they do not block merging. Re-run with
/grade-tests.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🤖 Automated content by GitHub Copilot. Generated by the Grade Tests on PR (on open / sync) workflow. · 38.6 AIC · ⌖ 9.48 AIC · ⊞ 8.9K · [◷]( · ◷)

@Evangelink
Amaury Levé (Evangelink) enabled auto-merge (squash) July 22, 2026 21:05
@Evangelink Amaury Levé (Evangelink) added the state/needs-review Awaiting review from the team. label Jul 22, 2026
@Evangelink
Amaury Levé (Evangelink) merged commit 1b9572b into main Jul 22, 2026
28 checks passed
@Evangelink
Amaury Levé (Evangelink) deleted the dev/amauryleve/support-testconfig-comments branch July 22, 2026 21:22
@Evangelink

Copy link
Copy Markdown
Member Author

/backport to rel/4.3

@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state/needs-review Awaiting review from the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add comment line support on testconfig.json when targeting .NET Framework

3 participants