From a3a8a71756fc39d4f61e4ec114b0f29fae8c142d Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Fri, 18 Jan 2019 10:46:00 -0800 Subject: [PATCH] Add more testing for pass-to-parent Also test that an untrusted job with secrets that are passed to parent becomes marked post-review. Change-Id: If3691163f0804ebb8cc3148a5e51c56c9d2ad845 --- .../config/pass-to-parent/git/org_project/zuul.yaml | 5 +++++ tests/unit/test_v3.py | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/tests/fixtures/config/pass-to-parent/git/org_project/zuul.yaml b/tests/fixtures/config/pass-to-parent/git/org_project/zuul.yaml index 1b13146f38..5252b955d5 100644 --- a/tests/fixtures/config/pass-to-parent/git/org_project/zuul.yaml +++ b/tests/fixtures/config/pass-to-parent/git/org_project/zuul.yaml @@ -58,6 +58,11 @@ files: override.txt - project: + check: + jobs: + - no-pass + - pass + - override gate: jobs: - no-pass diff --git a/tests/unit/test_v3.py b/tests/unit/test_v3.py index 35a7fa2f4a..becc88c0a5 100644 --- a/tests/unit/test_v3.py +++ b/tests/unit/test_v3.py @@ -3846,6 +3846,15 @@ class TestSecretPassToParent(ZuulTestCase): [{'parent_secret': {'password': 'password3'}, 'secret': {'password': 'password1'}}]) + B = self.fake_gerrit.addFakeChange('org/project', 'master', 'B', + files=file_dict) + self.fake_gerrit.addEvent(B.getPatchsetCreatedEvent(1)) + self.waitUntilSettled() + self.assertHistory([ + dict(name='pass', result='SUCCESS', changes='1,1'), + ]) + self.assertIn('does not allow post-review', B.messages[0]) + def test_secret_override(self): # Test that secrets passed to parents don't override existing # secrets.