summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlison Felizzi <alison.felizzi@mongodb.com>2021-07-22 05:38:43 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-07-22 06:05:19 +0000
commit061508639a3c1291a0607f42f42fad991e884a1a (patch)
tree4ae0bc39f766bafe501c9e3583e18d8b4627a194
parent9580b2ebd0e23c18c3d408c4060b7485fb8f6193 (diff)
downloadmongo-061508639a3c1291a0607f42f42fad991e884a1a.tar.gz
Import wiredtiger: 29a290bfb376d6a7d3da02d12b7b6236c028db07 from branch mongodb-master
ref: eefa8c5a41..29a290bfb3 for: 5.1.0 WT-7864 Add support to run.py for running lists/ranges of scenarios in a test
-rw-r--r--src/third_party/wiredtiger/import.data2
-rwxr-xr-xsrc/third_party/wiredtiger/test/suite/run.py39
2 files changed, 33 insertions, 8 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 15172f4d0f9..6fd6b2e4cb2 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-master",
- "commit": "eefa8c5a41640a1becb9dbd6cdac17fa61928253"
+ "commit": "29a290bfb376d6a7d3da02d12b7b6236c028db07"
}
diff --git a/src/third_party/wiredtiger/test/suite/run.py b/src/third_party/wiredtiger/test/suite/run.py
index 86aafdb261c..4e1971cbcbe 100755
--- a/src/third_party/wiredtiger/test/suite/run.py
+++ b/src/third_party/wiredtiger/test/suite/run.py
@@ -131,7 +131,8 @@ Options:\n\
-p | --preserve preserve output files in WT_TEST/<testname>\n\
-r N | --random-sample N randomly sort scenarios to be run, then\n\
execute every Nth (2<=N<=1000) scenario.\n\
- -s N | --scenario N use scenario N (N can be number or symbolic)\n\
+ -s N | --scenario N use scenario N (N can be symbolic, number, or\n\
+ list of numbers and ranges in the form 1,3-5,7)\n\
-t | --timestamp name WT_TEST according to timestamp\n\
-v N | --verbose N set verboseness to N (0<=N<=3, default=1)\n\
-i | --ignore-stdout dont fail on unexpected stdout or stderr\n\
@@ -178,16 +179,40 @@ def show_env(verbose, envvar):
# e.g. test_util03 -> util
reCatname = re.compile(r"test_([^0-9]+)[0-9]*")
+# Look for a list of the form 0-9,11,15-17.
+def parse_int_list(str):
+ # Use a dictionary as the result set to avoid repeated list scans.
+ # (Only the keys are used; the values are ignored.)
+ ret = {}
+ # Divide the input into ranges separated by commas.
+ for r in str.split(","):
+ # Split the range we got (if it is one).
+ bounds = r.split("-")
+ if len(bounds) == 1 and bounds[0].isdigit():
+ # It's a single number with no dash.
+ scenario = int(bounds[0])
+ ret[scenario] = True
+ continue
+ if len(bounds) == 2 and bounds[0].isdigit() and bounds[1].isdigit():
+ # It's two numbers separated by a dash.
+ for scenario in range(int(bounds[0]), int(bounds[1]) + 1):
+ ret[scenario] = True
+ continue
+ # It's not valid syntax; give up.
+ return None
+ return ret
+
def restrictScenario(testcases, restrict):
if restrict == '':
return testcases
- elif restrict.isdigit():
- s = int(restrict)
- return [t for t in testcases
- if hasattr(t, 'scenario_number') and t.scenario_number == s]
else:
- return [t for t in testcases
- if hasattr(t, 'scenario_name') and t.scenario_name == restrict]
+ scenarios = parse_int_list(restrict)
+ if scenarios is not None:
+ return [t for t in testcases
+ if hasattr(t, 'scenario_number') and t.scenario_number in scenarios]
+ else:
+ return [t for t in testcases
+ if hasattr(t, 'scenario_name') and t.scenario_name == restrict]
def addScenarioTests(tests, loader, testname, scenario):
loaded = loader.loadTestsFromName(testname)