You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,19 @@ The general overview of what you will need to do:
41
41
Or, you can use a service such as https://ngrok.com/ to access on your local dev machine via localhost.
42
42
Installation is fairly simple, though requires setting up a (free) account.
43
43
Run the command `ngrok http 8000` to forward to port 8000 on localhost.
44
+
45
+
> Note: GitHub has a webhook forwarding service available in beta.
46
+
> See [cli/gh-webhook](https://docs.github.com/en/developers/webhooks-and-events/webhooks/receiving-webhooks-with-the-github-cli) for more information.
47
+
> This is super easy to use, and doesn't require manually configuring webhook settings.
> Where the value in`--secret` is the secret value you place in`GITHUB_WEBHOOK_SECRET` described below, and `--repo` is the repo you want to test against.
56
+
44
57
4. Create a GitHub repo to run some tests on.
45
58
5. Configure the webhook in your GitHub repo.
46
59
I recommend at least skimming the [GitHub webhook documentation](https://docs.github.com/en/developers/webhooks-and-events/webhooks/about-webhooks) if you are not familiar with webhooks. In short:
@@ -67,6 +80,17 @@ The general overview of what you will need to do:
67
80
8. Add a `triagebot.toml` file to the main branch of your GitHub repo with whichever services you want to try out.
68
81
9. Try interacting with your repo, such as issuing `@rustbot` commands or interacting with PRs and issues (depending on which services you enabled in`triagebot.toml`). Watch the logs from the server to see what's going on.
69
82
83
+
## Tests
84
+
85
+
When possible, writing unittests is very helpful and one of the easiest ways to test.
86
+
For more advanced testing, there is an integration test called `testsuite` which provides an end-to-end service for testing triagebot.
This sets up an HTTP server that mimics api.github.com and verifies the client's behavior.
91
+
* [`server_test`](tests/server_test/mod.rs) — This tests the `triagebot` server itself and its behavior when it receives a webhook.
92
+
This launches the `triagebot` server, sets up HTTP servers to intercept api.github.com requests, launches PostgreSQL in a sandbox, and then injects webhook events into the `triagebot` server and validates its response.
93
+
70
94
## License
71
95
72
96
Triagebot is distributed under the terms of both the MIT license and the
0 commit comments