zuul/tests/unit
James E. Blair 04ac8287b6 Match tag items against containing branches
To try to approach a more intuitive behavior for jobs which apply
to tags but are defined in-repo (or even for centrally defined
jobs which should behave differently on tags from different branches),
look up which branches contain the commit referenced by a tag and
use that list in branch matchers.

If a tag item is enqueued, we look up the branches which contain
the commit referenced by the tag.  If any of those branches match a
branch matcher, the matcher is considered to have matched.

This means that if a release job is defined on multiple branches,
the branch variant from each branch the tagged commit is on will be
used.

A typical case is for a tagged commit to appear in exactly one branch.
In that case, the most intuitive behavior (the version of the job
defined on that branch) occurs.

A less typical but perfectly reasonable case is that there are two
identical branches (ie, stable has just branched from master but not
diverged).  In this case, if an identical commit is merged to both
branches, then both variants of a release job will run.  However, it's
likely that these variants are identical anyway, so the result is
apparently the same as the previous case.  However if the variants
are defined centrally, then they may differ while the branch contents
are the same, causing unexpected behavior when both variants are
applied.

If two branches have diverged, it will not be possible for the same
commit to be added to both branches, so in that case, only one of
the variants will apply.  However, tags can be created retroactively,
so that even if a branch has diverged, if a commit in the history of
both branches is tagged, then both variants will apply, possibly
producing unexpected behavior.

Considering that the current behavior is to apply all variants of
jobs on tags all the time, the partial reduction of scope in the most
typical circumstances is probably a useful change.

Change-Id: I5734ed8aeab90c1754e27dc792d39690f16ac70c
Co-Authored-By: Tobias Henkel <tobias.henkel@bmw.de>
2020-03-06 13:29:18 -08:00
..
__init__.py Move tests into test/unit 2017-01-24 10:18:38 -08:00
test_auth.py JWT drivers: Deprecate RS256withJWKS, introduce OpenIDConnect 2020-02-11 09:30:15 +00:00
test_bubblewrap.py Make most test cases work on MacOS 2020-02-20 12:59:38 +01:00
test_change_matcher.py Make files matcher match changes with no files 2019-08-23 18:59:29 +02:00
test_client.py test: prevent ResourceWarning in test_client 2020-01-22 12:56:07 +01:00
test_cmd.py Revert "Revert "Add the process environment to zuul.conf parser"" 2019-11-02 09:10:18 +09:00
test_configloader.py Merge "Authorization rules: add templating" 2020-03-06 18:12:45 +00:00
test_connection.py Report buildset result in MQTT reporter 2020-01-16 13:25:47 +01:00
test_cross_crd.py Return dependency cycle failure to user 2019-07-25 11:11:53 +02:00
test_daemon.py Remove unecessary shebang and exec bit 2018-07-26 07:12:24 +00:00
test_default_config.py Add type check for zuul conf 2018-12-10 19:24:50 +08:00
test_disk_accountant.py Optionally disable disk_limit_per_job 2019-02-22 08:10:59 +01:00
test_encryption.py Use nested tempfile fixture for cleanups 2018-02-06 15:18:45 -08:00
test_executor.py Make test setup_config more pure 2020-02-28 11:50:22 +01:00
test_gerrit.py Gerrit checks: trigger new patchset behavior 2020-02-13 14:00:33 -08:00
test_gerrit_crd.py Make test setup_config more pure 2020-02-28 11:50:22 +01:00
test_gerrit_legacy_crd.py Fix gerrit errors from production 2019-09-20 07:26:04 -07:00
test_git_driver.py Make test setup_config more pure 2020-02-28 11:50:22 +01:00
test_github_crd.py Remove unecessary shebang and exec bit 2018-07-26 07:12:24 +00:00
test_github_driver.py Merge "Test canMerge also with checks api" 2020-03-02 22:19:16 +00:00
test_github_requirements.py Implement basic github checks API workflow 2020-02-19 13:31:49 +01:00
test_gitlab_driver.py Gitlab - Implement the note event and the comment trigger action 2020-02-12 22:33:10 +00:00
test_inventory.py Merge "Speed up test_inventory" 2020-02-19 02:06:55 +00:00
test_keystorage.py Add private key storage migration 2018-09-04 15:42:38 -07:00
test_lib_ansible.py ansible manager: only failed if last ansible failed 2020-02-04 15:06:00 +01:00
test_merger_repo.py tests: remove test_repo_repr 2020-01-21 23:14:11 +01:00
test_model.py Revert "Revert "Add the process environment to zuul.conf parser"" 2019-11-02 09:10:18 +09:00
test_multi_driver.py Make test setup_config more pure 2020-02-28 11:50:22 +01:00
test_nodepool.py Add caching of autohold requests 2019-09-16 10:46:36 -04:00
test_openstack.py Remove unecessary shebang and exec bit 2018-07-26 07:12:24 +00:00
test_pagure_driver.py Merge "Pagure: Fix handling of threshold_reached: None" 2019-12-06 22:00:44 +00:00
test_push_reqs.py Make test setup_config more pure 2020-02-28 11:50:22 +01:00
test_requirements.py Fix reject clauses in the absence of approvals 2018-08-13 12:37:32 +02:00
test_scheduler.py Merge "Authorization rules: add templating" 2020-03-06 18:12:45 +00:00
test_ssh_agent.py Add SSH Agent Primitives and usage 2017-05-26 09:52:22 -07:00
test_stack_dump.py Several executor threading fixes 2017-10-17 09:49:29 -07:00
test_streaming.py Add command processor to zuul-web 2019-06-21 18:11:40 +02:00
test_supercedent.py Check branches in supercedent pipelines 2019-04-05 13:59:05 -07:00
test_v3.py Match tag items against containing branches 2020-03-06 13:29:18 -08:00
test_web.py Merge "Don't run jobs if only their file matchers are updated" 2020-02-12 21:53:20 +00:00
test_web_urls.py Add command processor to zuul-web 2019-06-21 18:11:40 +02:00
test_zk.py Add caching of autohold requests 2019-09-16 10:46:36 -04:00
test_zuultrigger.py Fix issue search in FakeGithubClient 2019-11-15 15:15:45 +01:00