twister: fix subset processing
Process subsets was done in the wrong step, so make it apply and generarte subsets correctly. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
79d7d0188b
commit
91b2cce64e
2 changed files with 22 additions and 11 deletions
|
@ -238,16 +238,6 @@ class TestPlan:
|
||||||
raise TwisterRuntimeError("No quarantine list given to be verified")
|
raise TwisterRuntimeError("No quarantine list given to be verified")
|
||||||
|
|
||||||
|
|
||||||
if self.options.subset:
|
|
||||||
subset, sets = self.options.subset.split("/")
|
|
||||||
subset = int(subset)
|
|
||||||
if int(subset) > 0 and int(sets) >= int(subset):
|
|
||||||
logger.info("Running only a subset: %s/%s" % (subset, sets))
|
|
||||||
else:
|
|
||||||
logger.error("You have provided a wrong subset value: %s." % self.options.subset)
|
|
||||||
return
|
|
||||||
self.generate_subset(subset, sets)
|
|
||||||
|
|
||||||
def load(self):
|
def load(self):
|
||||||
|
|
||||||
if self.options.report_suffix:
|
if self.options.report_suffix:
|
||||||
|
@ -276,6 +266,23 @@ class TestPlan:
|
||||||
else:
|
else:
|
||||||
self.apply_filters()
|
self.apply_filters()
|
||||||
|
|
||||||
|
if self.options.subset:
|
||||||
|
s = self.options.subset
|
||||||
|
try:
|
||||||
|
subset, sets = (int(x) for x in s.split("/"))
|
||||||
|
except ValueError as e:
|
||||||
|
raise TwisterRuntimeError("Bad subset value.")
|
||||||
|
|
||||||
|
if subset > sets:
|
||||||
|
raise TwisterRuntimeError("subset should not exceed the total number of sets")
|
||||||
|
|
||||||
|
if int(subset) > 0 and int(sets) >= int(subset):
|
||||||
|
logger.info("Running only a subset: %s/%s" % (subset, sets))
|
||||||
|
else:
|
||||||
|
raise TwisterRuntimeError(f"You have provided a wrong subset value: {self.options.subset}.")
|
||||||
|
|
||||||
|
self.generate_subset(subset, int(sets))
|
||||||
|
|
||||||
def generate_subset(self, subset, sets):
|
def generate_subset(self, subset, sets):
|
||||||
# Test instances are sorted depending on the context. For CI runs
|
# Test instances are sorted depending on the context. For CI runs
|
||||||
# the execution order is: "plat1-testA, plat1-testB, ...,
|
# the execution order is: "plat1-testA, plat1-testB, ...,
|
||||||
|
|
|
@ -911,7 +911,11 @@ def main():
|
||||||
if tplan.report() == 0:
|
if tplan.report() == 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
tplan.load()
|
try:
|
||||||
|
tplan.load()
|
||||||
|
except RuntimeError as e:
|
||||||
|
logger.error(f"{e}")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
if options.list_tests and options.platform:
|
if options.list_tests and options.platform:
|
||||||
tplan.report_platform_tests(options.platform)
|
tplan.report_platform_tests(options.platform)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue