-
Notifications
You must be signed in to change notification settings - Fork 35
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
tasks: Add local mock PR run to run-local.sh #584
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is getting close -- the inner test fails because that |
For `run-local.sh` and possibly other purposes it is useful to be able to run this more than once. I.e. for starting the container, running `setup-tasks`, interactively doing some things and then starting the `cockpit-tasks` main loop.
Prerequisite for the next commit which will make `run-local.sh` use `setup-tasks` directly.
We already overwrite the entry point in the webhook container and on OpenShift, and we are going to for the impending job-runner/job split. So drop it from the image, and instead set it explicitly in the systemd unit. Rework run-local.sh accordingly: Replace the async "wait for initialization" loop with a synchronous call to setup-tasks, and only run the `cockpit-tasks` main loop for `test_pr()` (so that we keep covering that script) -- the other tests don't need it. This paves the way for adding a test which covers `run-queue` with custom parameters (against a mock GitHub API), which we will introduce in a follow-up PR. It also gets rid of the "check out bots" code duplication for interactive mode.
This makes them symmetric with /run/secrets/webhook. Also move the symlink setup from `Containerfile` to `setup-tasks` - that way all the secrets setup is in one place, and it's also more fungible (e.g. it's simple to bind-mount an updated `setup-tasks` script without rebuilding the image).
This is an "almost end to end" test which runs fully locally and requires no GitHub interaction or token. Add a little mock GitHub server (utilizing bots' `task.test_mock_server`) to respond to the required GitHub APIs for handling an "opened PR" webhook event. This is useful for playing around with our AMQP queue/job execution engine locally (when using the mock GH server in interactive mode), or validating changes to run-queue/AMQP structure.
OK, #585 is working, let's merge this new test there. No reason to drag around two PRs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is an "almost end to end" test which runs fully locally and requires no
GitHub interaction or token. Add a little mock GitHub server (utilizing bots'
task.test_mock_server
) to respond to the required GitHub APIs for handling an"opened PR" webhook event.
This is useful for playing around with our AMQP queue/job execution engine
locally (when using the mock GH server in interactive mode), or
validating changes to run-queue/AMQP structure.