You can operate BugBug via the Command Line Interface (CLI). This empowers you to integrate with any continuous integration (CI) or continuous deployment (CD) pipelines or build system hooks.
You need Node.js version 14 or newer
After you have nodeJS and npm installed simply run:
npm install -g @testrevolution/bugbug-cli
Remember that you need to have admin user permissions on nodeJS execution.
You need to take the API token of the project you want to run with CLI. You will find that in the BugBug web app in the Integrations tab from the side menu:
The API token for the project
Then configure CLI with the alphanumerical project's API token:
bugbug config set-token API_TOKEN_FROM_WEBAPP_PROJECT_SETTINGS
On BugBug npm's page, you find the available commands. You can also just strike
bugbug helpto see what you can do and how.
Example: list suites within the connected project:
To run a particular test via CLI you need to find the ID of the test. It's easy, just go to your test, expand
3 dots, and select
Run via CLI. Just simply copy the command for running, open the terminal, and paste and run. The command looks as below:
bugbug remote run test TEST_Id
You can run the whole suite as well by going to
Suitesthe tab, expanding the details, and selecting
Run via CLI. The command is the same but SUITE_ID is different. That's how we recognize you want to run the whole suite!
Update your CI/CD build scripts to see test results directly in your build management tool (for example in Bitbucket)
Here's an example of what you can add to your build script.
You can also override individual variables from the command line with
--variable variableName="customVariableValue". This allows you to run different combinations of test data in different environments, for example, you can insert a different user password on prod and a different one on staging.
If you're ambitious
Command line variables override allows you to test various combinations of test data. You could create a
for eachtype of script and execute a suite with all the combinations.
When you run your pipeline, BugBug tests would be triggered and your build will only be successful if all tests passed.