[SERVER-31312] resmoke changed its interpretation of db_test's include_suites Created: 28/Sep/17  Updated: 30/Oct/23  Resolved: 03/Oct/17

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: 3.6.0-rc0

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Yves Duhem
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-30980 Add support for more complex tag matc... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: TIG 2017-10-23
Participants:

 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



 Comments   
Comment by Githook User [ 03/Oct/17 ]

Author:

{'email': 'yves.duhem@mongodb.com', 'name': 'Yves Duhem', 'username': 'syev'}

Message: SERVER-31312 Fix include_suites matching for db_test
Branch: master
https://github.com/mongodb/mongo/commit/f64d3147b938c9dcbd24ff127d5506a029902549

Generated at Thu Feb 08 04:26:38 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.