Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-31312

resmoke changed its interpretation of db_test's include_suites

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0-rc0
    • Component/s: Testing Infrastructure
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      TIG 2017-10-23

      Description

      Here's a sample yaml file describing a custom dbtest suite:

      my_dbtests.yml

      test_kind: db_test
       
      selector:
        include_suites:
        - DocumentSourceCursorTest
        - PlanExecutor*
        - Query*
        - query*
        - executor_registry
        - CursorManager*
       
      executor:
        config:
          dbtest_options:
            dur: ''
      

      before SERVER-30980, this suite ran a fair number of suites, after that commit I instead get:

      python buildscripts/resmoke.py --suites=my_dbtests  
      [resmoke] 2017-09-28T16:15:23.363-0400 resmoke.py invocation: buildscripts/resmoke.py --suites=my_dbtests
      [resmoke] 2017-09-28T16:15:23.495-0400 YAML configuration of suite my_dbtests
      test_kind: db_test
       
      selector:
        include_suites:
        - DocumentSourceCursorTest
        - PlanExecutor*
        - Query*
        - query*
        - executor_registry
        - CursorManager*
       
      executor:
        config:
          dbtest_options:
            dur: ''
       
      logging:
        executor:
          format: '[%(name)s] %(asctime)s %(message)s'
          handlers:
          - class: logging.StreamHandler
        fixture:
          format: '[%(name)s] %(message)s'
          handlers:
          - class: logging.StreamHandler
        tests:
          format: '[%(name)s] %(asctime)s %(message)s'
          handlers:
          - class: logging.StreamHandler
      [executor] 2017-09-28T16:15:23.496-0400 Skipping db_tests, no tests to run
      [resmoke] 2017-09-28T16:15:23.496-0400 ================================================================================
      [resmoke] 2017-09-28T16:15:23.496-0400 Summary of my_dbtests suite: No tests ran.
      Suite did not run any tests.
      

      This patch fixed it for me locally:

      diff --git a/buildscripts/resmokelib/selector.py b/buildscripts/resmokelib/selector.py
      index 057c54f..f97b17b 100644
      --- a/buildscripts/resmokelib/selector.py
      +++ b/buildscripts/resmokelib/selector.py
      @@ -487,10 +487,14 @@ class _DbTestSelector(_Selector):
                   return dbtests
       
               test_files = _TestList(self._test_file_explorer, dbtests)
      -        for suite_pattern in selector_config.include_suites:
      -            test_files.match_pattern(suite_pattern)
      -
      -        return test_files.get_tests()
      +        filtered_tests = []
      +        for test in test_files.get_tests():
      +            for suite_pattern in selector_config.include_suites:
      +                if test == suite_pattern or fnmatch.fnmatchcase(test, suite_pattern):
      +                    filtered_tests.append(test)
      +                    break
      +
      +        return filtered_tests
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yves.duhem Yves Duhem
              Reporter:
              charlie.swanson Charlie Swanson
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: