Skip to content

Make testing easier and unified #504

@The-Huginn

Description

@The-Huginn

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions