Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

@madmir
Copy link
Contributor

@madmir madmir commented Apr 12, 2019

  • Added test for expected argument exception when property name or value arguments reach MaxTokenSize

@dnfclas
Copy link

dnfclas commented Apr 12, 2019

CLA assistant check
All CLA requirements met.

@madmir madmir closed this Apr 12, 2019
@madmir madmir deleted the improve-Utf8JsonWriter-code-coverage branch April 12, 2019 09:34
@madmir madmir restored the improve-Utf8JsonWriter-code-coverage branch April 12, 2019 09:38
@madmir madmir reopened this Apr 12, 2019
@madmir madmir force-pushed the improve-Utf8JsonWriter-code-coverage branch 2 times, most recently from ae8f06a to 31f4872 Compare April 14, 2019 16:41
@ahsonkhan ahsonkhan added this to the 3.0 milestone Apr 15, 2019
@ahsonkhan
Copy link

@madmir, can you please resolve the conflicts based on recent Utf8JsonWriter API changes? Let me know and I can review the PR then: #36961

* Added test for expected argument exception when property name or value arguments reach MaxTokenSize
@madmir madmir force-pushed the improve-Utf8JsonWriter-code-coverage branch from 31f4872 to 17b4ab5 Compare April 25, 2019 16:00
@madmir
Copy link
Contributor Author

madmir commented Apr 25, 2019

API changes made my previous commit (testing buffer too small and WriteComment methods) obsolete/redundant. Therefore I got rid of it and the latest test is based on how WriteLargeKeyOrValue and WriteLargeKeyValue are already working. It should increase System.Text.Json.ThrowHelper coverage.

@ahsonkhan
Copy link

It should increase System.Text.Json.ThrowHelper coverage.

Can you share the code coverage report? Go to the test directory and run: dotnet msbuild /t:BuildAndTest /p:Coverage=true

https://github.com/dotnet/corefx/blob/master/Documentation/building/code-coverage.md

@madmir
Copy link
Contributor Author

madmir commented Apr 26, 2019

Can you share the code coverage report?

code_coverage_36811.zip

[InlineData(false, true)]
[InlineData(true, false)]
[InlineData(false, false)]
public void WriteTooLargeArguments(bool formatted, bool skipValidation)

Choose a reason for hiding this comment

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

This test should run relatively quickly, correct, given the check happens right up front?

I am fine it running in outerloop (given it allocates quite a bit), but just checking that runtime wise it wouldn't cause a significant time cost.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Memory allocation is the reason, following example of existing tests with similar setup.

Copy link

@ahsonkhan ahsonkhan left a comment

Choose a reason for hiding this comment

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

Thanks for the improved test coverage. Looks like the two missing branches in ValidatePropertyNameAndDepth get covered here (previously they were only partially covered):

image

@ahsonkhan ahsonkhan merged commit b35cd0d into dotnet:master Apr 26, 2019
@madmir
Copy link
Contributor Author

madmir commented Apr 26, 2019

Thanks for your time and giving opportunities for people to get involved.

@madmir madmir deleted the improve-Utf8JsonWriter-code-coverage branch April 26, 2019 23:51
@ahsonkhan
Copy link

ahsonkhan commented Apr 27, 2019

Thanks for your time and giving opportunities for people to get involved.

Absolutely. We definitely welcome and encourage community contributions whether in the JSON space or anything in this repo (it's open source after all). Feel free to ping me on other PRs of yours and I can help review them or help where possible.

There are quite a few up-for-grabs issues: https://github.com/dotnet/corefx/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs and a few marked as easy as well: https://github.com/dotnet/corefx/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs+label%3Aeasy

Specific to the issue you were working on, we still have some test gaps to fill :)

@madmir madmir restored the improve-Utf8JsonWriter-code-coverage branch April 27, 2019 04:41
@danmoseley
Copy link
Member

Seconded @madmir, we invite you to be a regular contributor!

picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* Added test for expected argument exception when property name or value arguments reach MaxTokenSize

Commit migrated from dotnet/corefx@b35cd0d
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants