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

Create test documents

    • 3
    • 2
    • Not Needed
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      Use Case

      As a... Driver Engineer
      I want... To create test cases for bson serialization and deserialization
      So that... We have more granular testing for js-bson

      User Impact

      • N/A

      Dependencies

      • N/A

      Unknowns

      • What is the naming scheme we want to use with these files?
        • See Naming Scheme section of Implementation Requirements
      • Which Node.js version should we pin to for continuous performance tracking in js-bson?
        • NODE.js 18.16.0 - this is the version we use for performance testing on the driver

      Acceptance Criteria

      Implementation Requirements

      • generate EJSON files described in New Test Cases section of document created in WRITING-15428 and commit files to js-bson repository
        • Naming scheme
          • Single folder in test/bench to house files 
            • For single type test <type>_<testCase>.json
            • E.g.: boolean_largeArray.json, int32_singleElementArray.json, long_singleFieldDocument.json
          • For more complex/mixed tests <name><size>.json, where <size> refers to one of the size categories laid out in WRITING-15428
            • E.g.: bestbuy_medium.json, tweet_medium.json
          • For nested documents nested_<depth>.json
            • E.g.: nested_6.json
      • move bson microbenchmark files from node-mongodb-native repository to js-bson repository and create test suites that run the bson microbenchmark suite and calculate results as described in the benchmarking specification
      • Set up js-bson CI to run new tests with the benchmark runner implemented in NODE-5693, running on Node 18.16.0 on the Rhel 9.0 perf distribution
      • Create the following test files
        • Test files for Int32, Long, Decimal128, Double, Null, Binary, Code, Boolean, ObjectId, MaxKey, MinKey, String and Timestamp should be programmatically generated
          • singleFieldDocument files - a bson document with a single field of the type in question
          • singleElementArray files - a bson document with a single field containing an array with a single element of the type in question
          • 10, 100, 1000 Element Array files - bson documents with a single field containing an array with 10, 100 or 1000 elements of the type in question
          • Binary small, medium, large - bson documents with a single field containing a binary blob that is small (<1Kib), medium (> 1KiB) or large (> 1MiB)
        • Mixed test files
          • Use existing tweet.json file as medium mixed document test file
          • Use bestbuy test file as medium mixed document test file
      • Tests suites should be set up with the following option configurations
        • Deserialization Test scenarios (single field, single element array, large array)
          • Long
            • useBigInt64: false, promoteValues: false, promoteLongs: false (base case)
            • useBigInt64: false, promoteValues: true, promoteLongs: true 
            • useBigInt64: true, promoteLongs: false
          • Double
            • promoteValues: true
            • promoteValues: false
          • Int32
            • promoteValues: true
            • promoteValues: false
          • Regexp
            • bsonRegExp: true
            • bsonRegExp: false
          • Boolean
            • promoteValues: true
            • promoteValues: false
          • String
            • validation.utf8: true
            • validation.utf8: false
          • Binary
            • promoteBuffers: true
            • promoteBuffers: false
          • MinKey, MaxKey, Null, ObjectId,Timestamp, Code, Code with Scope
            • Options kept as default excepting those explicitly mentioned in the option configuration section
        • Mixed document deserialization/serialization scenarios
          • Keep options default for CI,
          • Ensure that options match as well as possible in comparing js-bson and bson-ext
        • Serialization Test scenarios (single field, single element array, large array)
          • All options specified as in option configuration above, excepting the case of varying serializeFunctions to test Code and Code with Scope
            • don't need to set serializeFunctions as our test format will force us to create explicit Code objects

      Testing Requirements

      • Manually check that CI tasks run and generate performance data with correctly generated names and that different runner option configurations show up on different trend charts.
      • Manually check that perf.send is used correctly and uploads files successfully

      Documentation Requirements

      • N/A

      Follow Up Requirements

      • N/A

            Assignee:
            warren.james@mongodb.com Warren James
            Reporter:
            warren.james@mongodb.com Warren James
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: