Skip to content

Commit

Permalink
Fetch the data from last run earlier
Browse files Browse the repository at this point in the history
The run command, before bisect is used, tries to get rid of tests
that always fail - to do so it generates new runs, which loses
the reference to the last one before bisect was requested.

To fix this, fetch the last run earlier in the run code.
On bisect side, run all candidate tests, not only failing ones.
And drop an extra comma which broke things.

This version of bisect only find conflicting tests within a
worker since the bisect code relies on the ordering of tests in
the database for a worker.
  • Loading branch information
afrittoli authored and mtreinish committed Oct 6, 2017
1 parent daa01b9 commit 76dc4aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions stestr/bisect_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def __init__(self, latest_run, conf, run_func, repo, test_path=None,
self.repo_type = repo_type
self.repo_url = repo_url
self.serial = serial
self.concurrency = concurrency,
self.concurrency = concurrency
self.test_path = test_path
self.top_dir = top_dir
self.run_func = run_func
Expand All @@ -57,7 +57,7 @@ def bisect_tests(self, spurious_failures):
repo_type=self.repo_type, repo_url=self.repo_url,
serial=self.serial, concurrency=self.concurrency,
test_path=self.test_path, top_dir=self.top_dir)
self.run_func(cmd, True, True, False, False,
self.run_func(cmd, False, True, False, False,
pretty_out=False,
repo_type=self.repo_type,
repo_url=self.repo_url)
Expand Down
10 changes: 5 additions & 5 deletions stestr/commands/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ def run_tests():
stdout=stdout,
abbreviate=abbreviate)
else:
# Where do we source data about the cause of conflicts.
# XXX: Should instead capture the run id in with the failing test
# data so that we can deal with failures split across many partial
# runs.
latest_run = repo.get_latest_run()
# Stage one: reduce the list of failing tests (possibly further
# reduced by testfilters) to eliminate fails-on-own tests.
spurious_failures = set()
Expand Down Expand Up @@ -348,11 +353,6 @@ def run_tests():
if not spurious_failures:
# All done.
return 0
# Where do we source data about the cause of conflicts.
# XXX: Should instead capture the run id in with the failing test
# data so that we can deal with failures split across many partial
# runs.
latest_run = repo.get_latest_run()
bisect_runner = bisect_tests.IsolationAnalyzer(
latest_run, conf, _run_tests, repo, test_path=test_path,
top_dir=top_dir, group_regex=group_regex, repo_type=repo_type,
Expand Down

0 comments on commit 76dc4aa

Please sign in to comment.