Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-8093

Improve the CPP testing framework for better flexibility

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • WT10.0.1, 5.0.4, 4.4.10, 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • 5
    • Storage - Ra 2021-09-20

      While defining the tests as part of WT-7924, we realized that the CPP testing framework is missing flexibility. As of now, we cannot implement the tests without changing the testing framework.

      Here is the list of what needs to be implemented in this ticket:

      • As we are creating more tests, we need to be able to generate them and the script made for that purpose contains issues.
        • File impacted: test/cppsuite/create_test.sh 
        • If a test starts with the letter "t", it will not be generated correctly as the script will read "\t".
        • When the list of tests becomes too long, the script will not be able to add the new test to the list because the tests are not written on the expected line. This issue might occur with another line in the script and we should take the opportunity to change it as well.
      • When a new test is created, the template used is example_test.cxx. However, it is outdated and needs to be updated to generate a new test up-to-date.
        • File impacted: test/cppsuite/tests/example_test.cxx
        • Add the missing insert_operation function and update the argument names so they reflect what is defined in database_operation.h
      • To simplify some tests, we want to be able to generate random strings made of alphabet characters only. We currently have a generator that is able to generate a random string made of pseudo alphanumeric characters.
        • Files impacted: test/cppsuite/test_harness/workload/random_generator.[cxx,h]
      • To improve the randomness of our generated strings, we need to improve the function generate_string. The use of std::shuffle should be helpful.
        • Files impacted: test/cppsuite/test_harness/workload/random_generator.[cxx,h]
      • We need to be able to set arbitrary timestamps when we insert values. Currently, the framework is managing all the timestamps through a timestamp manager.
        • Files impacted: test/cppsuite/test_harness/workload/thread_context.[cxx,h]
        • Add an argument to the function insert so it can take a wt_timestamp_t. We need to be careful not to break existing tests. We could have a default value of 0 and when the ts has a value of 0, we should let the timestamp manager handle the generation of a valid timestamp.
      • We need to be able to pass in a key of type std::string to the insert function as we will use prefixes of type S.
        • Files impacted: test/cppsuite/test_harness/workload/thread_context.[cxx,h]
        • Overload the function

      Definition of done:

      All of the above items are implemented

            Assignee:
            etienne.petrel@mongodb.com Etienne Petrel
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: