quarkus-github-app icon indicating copy to clipboard operation
quarkus-github-app copied to clipboard

Make testing easier and unified

Open The-Huginn opened this issue 2 years ago • 0 comments
trafficstars

I would like to discuss an easier way to test github apps. I can see other github bots trying to do the same and test their applications with slightly different approaches. It would be best to unify this process.

There could be 2 main areas to improve on this.

  1. Create JSON processors for most common events such as Pull Request. It will make tests more readable and configurable without the need of having many slightly different *.json payloads with Pull Requests.
  2. Create easier mocking for most common cases and events (similarly to first point)

Example of JSON processor in our repo

Example of mocking builder (In case the PR was updated please use this link and find file MockedGHPullRequestProcessor). Builder and usage

We would need to find a trade-off between mocking too much and covering just the basics. Also we could provide mocking for classes not extending GHObject as they are not able to use GitHubMockContext#ghObject mocking method such as GHPullRequestCommitDetail.

Quick links to quarkus and hibernate bots

The-Huginn avatar Aug 16 '23 11:08 The-Huginn