GitHub Bot
Nunu AI offers a GitHub app that integrates seamlessly with your development workflow, enabling automated testing directly from pull requests.
Overview
The GitHub app acts as an intelligent PR bot that:
- Connects a single Nexus project to a single GitHub repository
- Creates and runs discovery tests when tagged in PR comments
- Reports test results directly back to the pull request
Installation
Prerequisites
Before installing the GitHub app, ensure you have:
- A Nexus project set up
- A
nunu.tomlconfiguration file in the root of your repository (see Configuration) - Build storage configured for your project
- Automatic upload of builds to build storage set up (see the GitHub Action)
Installing the App
The GitHub app installation must be initiated from Nexus, not from GitHub directly.
- Navigate to your Nexus project settings
- Click the “Connect to GitHub” button
- Follow the authorization flow to grant Nexus access to your repository
- Select the GitHub repository you want to connect
Once connected, your Nexus project will be linked to the selected GitHub repository.
Configuration
Create a nunu.toml file in the root of your repository with the following configuration:
deployment_config = "<name of the deployment config you want to use>"
agent = "<name of the agent config you want to use>"Advanced Configuration: Config IDs
You may choose to use a config ID instead of a config name by specifying the <type>_config_id field in your nunu.toml file.
Exactly one of each type of config must be specified, either by name or by ID.
deployment_config_id = "<uuid>"
agent_config_id = "<uuid>"Advanced Configuration: Test Case Templates
If you want to customize the discovery test cases the bot
creates, you can do so by providing a template.
Templates are written in Handlebars . You can see the default template and
experiment with creating your own in nexus under tools / template debug. For more info, check the templating page.
Context from the PR may be included by referencing the variables in your template. View the default template in the template debugger tool for reference.
Example:
In this example, we use the {{title}} (PR title) and {{instructions}} (the text of the comment in which you tagged @nunu-ai) to create a test case which always does a smoke test in addition to the instructions provided.
# nunu.toml
test_case_template = '''
You are testing changes introduced by the PR {{title}}.
Do a sweep of the main menu, and verify that the shop is working correctly.
Additionally, {{instructions}}
'''Advanced Configuration: Profiles
If you want to use multiple agent- or deployment configs, or different templates depending on your situation, you can leverage profiles.
Profiles are a way to override the default configuration of the bot. They can be defined in nunu.toml, and invoked
when tagging the bot in your comment. See profiles usage for more details.
Example:
# nunu.toml
deployment_config = "android_config"
agent = "agent"
# this profile is used to run on ios instead of android
# note that this profile does not specify an agent.
# This means that the default agent will be used.
[profiles.ios]
deployment_config = "ios_config"
# this profile is used to run a smoke test,
# without the need to provide instructions.
# it will use the default deployment config and agent,
# but overrides the default (predefined) template.
[profiles.smoke]
test_case_template = "You run a smoke test. Open the app and ..."Usage
Triggering Tests from Pull Requests
To trigger a test run from a pull request:
- Ensure your CI uploads a build created from the latest PR commit to build storage, tagged with the full commit hash
- Comment on the PR and tag the bot with
@nunu-aifollowed by your test instructions - The bot will:
- Create a discovery test using your instructions
- Start a test run against your uploaded build
- Reply to the comment with the test report once complete
Example:
@nunu-ai, I've added a new banner to the main menu.
Please check that clicking on it leads to the new gem minigame@nunu-ai Please test the new friends feature.Advanced usage: Profiles
To specify the profile the bot should use, add a hashtag followed by the profile name (e.g. #profile-b) after the @nunu-ai tag.
@nunu-ai #ios Test the main menuWhen tagging the bot, provide complete instructions including all necessary context. The bot will use exactly what you write as the test instructions.