Skip to content

System.Text.Json.SourceGeneration.Tests have issues with BigInteger and records on netfx #63802

Closed

Description

@krwq

Following issues were found when enabling netfx tests:

Whenever:

[JsonSerializable(typeof(ClassWithUnsupportedBigInteger))]
// and couple of other BigInteger related classes 

is used the code no longer compiles - code generator seem to be generating code which tries to access private fields. Search for #if !NETFRAMEWORK in that code - this have been removed for netfx for now to unblock remainder of the tests

also JsonIgnoreAttribute_UnsupportedBigInteger is not passing - expected exception seem to differ. See test with ActiveIssue.

Another issues I'm seeing are InvalidOperationException (emit fails in CreateAssemblyImage in the test code), following tests are affected:

  • System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.RecordInExternalAssembly
  • System.Text.Json.SourceGeneration.UnitTests.GeneratorTests.Record
  • System.Text.Json.SourceGeneration.Tests.JsonSerializerContextTests.Converters_AndTypeInfoCreator_NotRooted_WhenMetadataNotPresent (I'm not able to reproduce this one locally)

(those tests were recently added)

Related to: #63463

cc: @layomia

Note: this issue is related to the PR which is not merged yet so some details reated to ActiveIssue or DefineConstants are relevant after merging it. (I need ActiveIssue number in order to finish PR)

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Jan 14, 2022
  2. changed the title [-]System.Text.Json.SourceGeneration.Tests have issues with BigInteger on netfx[/-] [+]System.Text.Json.SourceGeneration.Tests have issues with BigInteger and records on netfx[/+] on Jan 17, 2022
  3. removed
    untriagedNew issue has not been triaged by the area owner
    on Jan 20, 2022
  4. added this to the 7.0.0 milestone on Jan 20, 2022
  5. self-assigned this
    on Jan 20, 2022
  6. modified the milestones: 7.0.0, Future on Apr 18, 2022
  7. removed their assignment
    on Dec 2, 2022
  8. eiriktsarpalis commented on Jun 15, 2023

    @eiriktsarpalis
    Member

    The BigInteger failures were fixed by #87383 and the record unit tests are caused by the fact that netfx doesn't have the IsExternalInit class defined. I'll follow up with a PR enabling the tests and closing the issue.

  9. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 15, 2023
  10. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 15, 2023
  11. modified the milestones: Future, 8.0.0 on Jun 22, 2023
  12. ghost locked as resolved and limited conversation to collaborators on Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions