Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions openqa-trigger-bisect-jobs
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,14 @@ def main(args):
if "parent_group" in job:
full_group = "%s / %s" % (job["parent_group"], full_group)
if re.search(exclude_group_regex, full_group):
log.debug("job group '%s' matches 'exclude_group_regex', skipping" % full_group)
return

exclude_name_regex = os.environ.get("exclude_name_regex", "")
if len(exclude_name_regex) > 0 and re.search(exclude_name_regex, job["test"]):
log.debug("job name '%s' matches 'exclude_name_regex', skipping" % job["test"])
return

log.debug("Received job data: %s" % test_data)
test = job["settings"]["TEST"]
prio = int(job["priority"]) + args.priority_add
Expand Down
18 changes: 15 additions & 3 deletions tests/test_trigger_bisect_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
openqa = importlib.util.module_from_spec(spec)
loader.exec_module(openqa)

# should only affect test_exclude_group_regex() as it does not match other tests
os.environ["exclude_group_regex"] = "s.*parent?-group / some-.*"

Incident = openqa.Incident


Expand Down Expand Up @@ -301,10 +298,25 @@ def test_exclude_group_regex():
args = args_factory()
openqa.openqa_clone = MagicMock(return_value="")
openqa.fetch_url = MagicMock(side_effect=mocked_fetch_url)
# should only affect test_exclude_group_regex() as it does not match other tests
os.environ["exclude_group_regex"] = "s.*parent?-group / some-.*"

args.url = "http://openqa.opensuse.org/tests/123457"
openqa.main(args)
openqa.openqa_clone.assert_not_called()
del os.environ["exclude_group_regex"]


def test_exclude_name_regex():
args = args_factory()
openqa.openqa_clone = MagicMock(return_value="")
openqa.fetch_url = MagicMock(side_effect=mocked_fetch_url)

os.environ["exclude_name_regex"] = "with.*group"
args.url = "http://openqa.opensuse.org/tests/123457"
openqa.main(args)
openqa.openqa_clone.assert_not_called()
del os.environ["exclude_name_regex"]


def test_exclude_investigated():
Expand Down