Improvements to hybrid search scoreDetails tests

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None

      There are 2 identifiable improvements to the 3 existing hybrid search scoreDetails tests (ranked_fusion_score_details_test.js, score_fusion_score_deatils_test.js, score_score_details_test.js) :

       

      Consolidate tests into more generalized / parametrized functions:

      Similar to what was introduced in SERVER-104742 here, see if the successive tests that check different combinations of input pipelines, normalization, weights, etc. can be consolidated into functions that take in the different testing dimensions as arguments; then test the different combinations as function calls like here.

       

      Merge (some or all) scoreDetails expectations into one (or more JSON blobs)

      Instead of asserting the values of the scoreDetails field by field like in this long for loop, see if we can instead define (or compute) the some or all of the scoreDetails as a single JSON blob, and assert the blobs are equal, to reduce the verbosity of the test. Note that the final state might be a combination of asserting blob(s) and some singular field expectations, depending on what were asserting.

       

      Both of these improvements are just general guidelines; there is no exact defined state the tests should end with.

       

      Any other improvements identified when implementing this ticket are also welcome, in the PR or as follow up tickets.

            Assignee:
            Unassigned
            Reporter:
            Joe Shalabi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: