diff options
author | James E. Blair <jim@acmegating.com> | 2021-10-14 15:54:17 -0700 |
---|---|---|
committer | James E. Blair <jim@acmegating.com> | 2021-10-27 16:57:22 -0700 |
commit | b2e78e398b86e000d97f5b2002b4998923e731f4 (patch) | |
tree | 610c323e4e5968d97d20b2201fbce1ef0fc89580 /tests/unit/test_web.py | |
parent | ab8b934ae38e014f9c8f7c4721c4b6a5c14f837f (diff) | |
download | zuul-b2e78e398b86e000d97f5b2002b4998923e731f4.tar.gz |
Add test_freeze_noop_job
The noop job can be special; add a test to freeze it using the
REST API to make sure that doesn't break.
Change-Id: Ib91f123ec8bbcb5b3abeb8b2062f77efb21a8f06
Diffstat (limited to 'tests/unit/test_web.py')
-rw-r--r-- | tests/unit/test_web.py | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/unit/test_web.py b/tests/unit/test_web.py index 79ad8a1eb..33d720b57 100644 --- a/tests/unit/test_web.py +++ b/tests/unit/test_web.py @@ -1123,6 +1123,64 @@ class TestWeb(BaseTestWeb): self.assertEqual(job_params, resp.json()) + @simple_layout('layouts/noop-job.yaml') + def test_freeze_noop_job(self): + + resp = self.get_url( + "api/tenant/tenant-one/pipeline/gate" + "/project/org/noop-project/branch/master/freeze-job/" + "noop") + + job_params = { + 'ansible_version': '2.9', + 'branch': 'master', + 'extra_vars': {}, + 'group_vars': {}, + 'host_vars': {}, + 'items': [], + 'job': 'noop', + 'nodeset': {'groups': [], 'name': '', 'nodes': []}, + 'override_branch': None, + 'override_checkout': None, + 'post_timeout': None, + 'projects': [], + 'repo_state': {}, + 'secret_vars': None, + 'ssh_keys': [], + 'timeout': None, + 'vars': {}, + 'workspace_scheme': 'golang', + 'zuul': { + '_inheritance_path': [ + '<Job noop branches: None source: None#0>', + '<Job noop branches: None source: ' + 'org/common-config/zuul.yaml@master#22>', + '<Job noop branches: None source: None#0>'], + 'branch': 'master', + 'build': '00000000000000000000000000000000', + 'buildset': None, + 'change_url': None, + 'child_jobs': [], + 'event_id': None, + 'items': [], + 'job': 'noop', + 'jobtags': [], + 'pipeline': 'gate', + 'post_review': False, + 'project': { + 'canonical_hostname': 'review.example.com', + 'canonical_name': 'review.example.com/org/noop-project', + 'name': 'org/noop-project', + 'short_name': 'noop-project', + 'src_dir': 'src/review.example.com/org/noop-project'}, + 'projects': {}, + 'ref': None, + 'tenant': 'tenant-one', + 'timeout': None, + 'voting': True}} + + self.assertEqual(job_params, resp.json()) + class TestWebStatusDisplayBranch(BaseTestWeb): tenant_config_file = 'config/change-queues/main.yaml' |