Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for multi-repo setup #100

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Conversation

yasunariw
Copy link
Collaborator

@yasunariw yasunariw commented Dec 25, 2020

Description of the task

(depends on #97)

How to test

Existing tests should pass without regression. Three additional test cases confirm additional behavior related to this multi-repo setup. Namely:

  • If the allowed_repos list excludes the payload repo, it should be ignored. (status.multi_repo_disallowed_repo)
  • The status rules should be evaluated for the correct repo. In this test case, it should correctly detect that master's last build status was a failure for the given payload repo, and issue a success notification.(status.multi_repo_independent_status_state)
make test

References

With repo-specific secrets, we'll need the repo name in order
to obtain the webhook token used for signature validation. So
parsing the request body for a GH payload needs to happen before,
not after, the signature check.
Define custom getters for retrieving GH secret values. As the
getter for each token type defaults to looking for a global value
if a repo-specific vaue isn't found, existing deployments don't
need to change.
For each test case, initializes a repo state from file if one exists.
Make secrets, config, state, and incoming payload configurable
individually, so that it's easier to test multi-repo behavior.
`status.multi_repo_disallowed_repo`
If `allowed_repositories` excludes the payload repo, it should be
ignored even if payload would generate notification otherwise.

`status.multi_repo_independent_status_state`
The status rules should be evaluated for the correct repo. In this
test case, it should correctly detect that `master`'s last build
status was a failure for the given payload repo, and issue a
success notification, despite the last build status success in a
different repo.
@yasunariw yasunariw marked this pull request as ready for review January 5, 2021 06:29
@yasunariw yasunariw requested review from ygrek and Khady January 5, 2021 06:30
@yasunariw yasunariw force-pushed the yasu/support-multiple-repos branch 3 times, most recently from d3fe839 to 3e47dde Compare December 3, 2021 10:29
@yasunariw yasunariw force-pushed the yasu/support-multiple-repos branch from 9697bed to 233543c Compare May 6, 2022 10:04
Base automatically changed from yasu/support-multiple-repos to master June 28, 2022 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant