Skip to content

Commit

Permalink
append all changed tests to the run set
Browse files Browse the repository at this point in the history
also, rename "failed_tests" property to "tests_to_run"
  • Loading branch information
vuvova committed Oct 22, 2023
1 parent 6c6f13f commit 718060a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions common_factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,20 @@ def run(self):
typ = 'nm'
limit = 50
overlimit = 1000
test_re = r'^(?:.+/)?mysql-test/(?:suite/)?(.+?)/(?:[rt]/)?([^/]+)\.(?:test|result|rdiff)$'

if master_branch:
query = """
select test_name from (select id, test_name from test_failure,test_run where branch='%s' and test_run_id=id order by test_run_id desc limit %d) x group by test_name order by max(id) desc limit %d
"""
tests = yield self.runQueryWithRetry(query % (master_branch, overlimit, limit))
tests = list(t[0] for t in tests)

tests += (m.expand(r'\1.\2') for m in (re.search(test_re, f) for f in self.build.allFiles()) if m)

if tests:
test_args = ' '.join(tests)
self.setProperty('failed_tests', test_args)
self.setProperty('tests_to_run', test_args)

return results.SUCCESS

Expand Down Expand Up @@ -121,9 +125,9 @@ def getLastNFailedBuildFactory(mtrDbPool):
@util.renderer
def getTests(props):
mtr_additional_args = props.getProperty('mtr_additional_args', '--suite=main')
failed_tests = props.getProperty('failed_tests', None)
if failed_tests:
mtr_additional_args = mtr_additional_args.replace('--suite=main', failed_tests)
tests_to_run = props.getProperty('tests_to_run', None)
if tests_to_run:
mtr_additional_args = mtr_additional_args.replace('--suite=main', tests_to_run)

return mtr_additional_args

Expand Down

0 comments on commit 718060a

Please sign in to comment.