Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4937

Test roundtrip nodejs EJSON stringify against Java's EJSON parse

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: BSON, EJSON, Testing
    • Not Needed

      Summary

      When using the nodejs EJSON implementation in a browser we want to confirm that canonical EJSON can be used for data transfer to (at least) a Java backend.

      AC

      • Set up Java & Java bson library in nodejs BSON CI
      • Generate EJSON output containing all possible values in canonical format
        • Enumerate edge cases like numeric maximums and minimums
        • Reuse example inputs from BSON corpus tests
      • Assertions should follow these steps:
        • Take EJSON strings created by Node.js's EJSON library
        • parse those strings with Java's EJSON parser Document.parse(string)
        • Output BSON bytes (hex or other non lossy format) from Java
        • Check Java's BSON output against node's BSON output from the JS object that originated the EJSON string
          • Note: perfect equality is not achievable for every case, canonical EJSON has limitations for data transfer, but we should encode those exceptions in testing. (Ex. NaN with payload, objects that have the same shape as a canonical EJSON value)
          • Note: perfect BSON type information is always expected

            Assignee:
            Unassigned Unassigned
            Reporter:
            neal.beeken@mongodb.com Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: