zuul/tests/unit
James E. Blair 9eef4e532a Don't run jobs if only their file matchers are updated
Normally, if a change is made to a job configuration, we want to
ignore the file matchers and run the job so that we can see the
update in practice.  However, we don't want to do so if the
*only* change to the job configuration is the file matchers.  The
result is no different than before, and running the job tells us
nothing about the value of the change.

This behavior was already the case, but due to a bug.  This
change both fixes the bug and intentionally restores the
behavior.

The bug that is corrected is that when variants were applied, the
actual file matchers attached to the frozen job were updated, but
not their string/list representation (stored in the '_files' and
'_irrelevant_files' attributes).  This change moves those
attributes to the list of context attributes (which are
automatically copied on inheritance) -- the same as the actual
matcher attributes.

We also do the same for the '_branches' attribute (the text
version of the branch matcher).  These changes make the
serialized form of the frozen job (which is returned by the web
api) more accurate.  And in the case of the files matchers,
causes Zuul to correctly detect that the job has changed when
they are updated.

To restore the current (accidental but desired) behavior, we now
pop the files and irrelevant-files keys from the serialized
representation of the job before comparison when deciding whether
to run the job during a config update.  This means that it will
only run if something other than a files matcher is changed.

This change also removes the _implied_branch job attribute
because it is no longer used anywhere (implied branches now
arrive via projects and project templates).

Change-Id: Id1d595873fe87ca980b2f33832f55542f9e5d496
2020-02-07 07:16:25 -08:00
..
__init__.py Move tests into test/unit 2017-01-24 10:18:38 -08:00
test_bubblewrap.py test: prevent ResourceWarning in test_bubblewrap 2020-01-22 11:50:34 +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 Authorization rules: support YAML nested dictionaries 2020-01-13 15:00:51 +01: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 Don't set ansible_python_interpreter if in vars 2019-12-13 11:48:41 +01:00
test_gerrit.py Gerrit: poll for merged changes if no stream events 2020-02-03 11:33:31 -08:00
test_gerrit_crd.py Fix gerrit errors from production 2019-09-20 07:26:04 -07:00
test_gerrit_legacy_crd.py Fix gerrit errors from production 2019-09-20 07:26:04 -07:00
test_git_driver.py Merge "Increase event timeouts in git tests" 2019-03-25 20:32:19 +00:00
test_github_crd.py Remove unecessary shebang and exec bit 2018-07-26 07:12:24 +00:00
test_github_driver.py Keep tenant_last_reconfigured float precision (time.sleep removal) 2019-10-25 07:51:16 +00:00
test_github_requirements.py Remove unecessary shebang and exec bit 2018-07-26 07:12:24 +00:00
test_inventory.py Add Zuul's event id to Ansible inventory 2020-02-06 11:32:48 +01:00
test_keystorage.py Add private key storage migration 2018-09-04 15:42:38 -07: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 Remove status handling from FakeGithubConnection 2017-08-03 19:22:54 +00: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 Ensure ref-updated jobs run with their ref 2017-08-02 16:56:18 -07:00
test_requirements.py Fix reject clauses in the absence of approvals 2018-08-13 12:37:32 +02:00
test_scheduler.py Don't run jobs if only their file matchers are updated 2020-02-07 07:16:25 -08: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 Allow skipping child jobs from paused job again 2020-01-29 10:45:18 +01:00
test_web.py Don't run jobs if only their file matchers are updated 2020-02-07 07:16:25 -08: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