Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C#] Conformance test: don't skip JsonIgnoreUnknownParsingTest in runner #15369

Closed

Conversation

antongrbin
Copy link
Contributor

Motivation

#7392 (comment)

This is for completeness - I am not blocked by this change in any way, so feel free to close the PR or treat is a low priority.

Changes

Implement JsonIgnoreUnknownParsingTest in C# conformance test runner.

Tested

Locally with:

bazel test //csharp:conformance_test \
    --action_env=DOTNET_CLI_TELEMETRY_OPTOUT=1 --test_env=DOTNET_CLI_HOME=~ \
    --action_env=DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1

@antongrbin antongrbin requested review from a team as code owners January 10, 2024 12:43
@antongrbin antongrbin requested review from haberman and jskeet and removed request for a team January 10, 2024 12:43
@@ -72,24 +72,21 @@ private static ConformanceResponse PerformRequest(ConformanceRequest request, Ty
switch (request.PayloadCase)
{
case ConformanceRequest.PayloadOneofCase.JsonPayload:
JsonParser parser;
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be unconditional:

bool ignoreUnknownFields = request.TestCategory == global::Conformance.TestCategory.JsonIgnoreUnknownParsingTest;
JsonParser parser = new JsonParser(new JsonParser.Settings(20, typeRegistry).WithIgnoreUnknownFields(ignoreUnknownFields));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied -- thank you!

Copy link
Contributor

@jskeet jskeet left a comment

Choose a reason for hiding this comment

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

One suggested refactoring, but basically fine, and thanks for doing it.

@antongrbin
Copy link
Contributor Author

How do we move forward with this? Is there an action item on me?

@jskeet jskeet added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jan 24, 2024
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Jan 24, 2024
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.

None yet

3 participants