bugster update
to automatically create tests for new functionality, modify tests impacted by code changes, and delete tests for removed features. Use it locally on demand or automatically on every pull request via the GitHub App.
In this guide you will learn:
- How to keep your test suite synchronized with your codebase using
bugster update
. - How to use different update modes for local development and CI workflows.
- How to compare changes against different baselines like the default branch or the last update.
Prerequisites
- Bugster CLI installed and authenticated.
- Run commands from your repo root (the directory containing
/.bugster/
). - For PR automation: the Bugster GitHub App is installed on the repo (document required permissions) and PR previews are available if your flow depends on them.
Usage Modes
Local (manual)
Runbugster update
when you’re confident about local changes and ready to sync them. The command analyzes committed changes only - both staged and unstaged files are ignored. Only differences between commits are considered for test updates.
Scope flag precedence: If multiple scope flags are provided, the command will error and ask you to specify only one scope option.
Automatic on Pull Requests
When you open a Pull Request, Bugster’s E2E agent runsbugster update
first. New commits or force-pushes will amend the existing Update PR rather than creating a new one.
1
Bugster creates an Update PR
Bugster opens a secondary PR targeting your feature branch with the suggested test suite changes.
2
Review the results
The original PR gets a comment with the test results and a link to the “Bugster Update PR”.
3
Approve and merge
You approve and merge the “Bugster Update PR”.
4
Merge your feature
Once the test updates are in, you can merge your feature branch.
Remember to review the Bugster Update PR before merging your feature.
Comparison Baselines
Choose the comparison model that fits your development stage:Baseline | Use When | Command |
---|---|---|
Last commit (default) | Small, isolated edits | bugster update |
Default branch | Before PR / comprehensive sweep | bugster update --against-default |
Since last update | Tight inner loop without reprocessing | bugster update --against-last-update |
Last commit (default)
When to use: Small, isolated editsAgainst default branch
When to use: Before PR / comprehensive sweepmain
). Sees all changes in your feature branch.
Since last update
When to use: Tight inner loop without reprocessingbugster update
. The “last update” state is stored in .bugster/state/last-update-hash
and tracks the commit hash from your previous update.
Recommended Workflow
Scenario | Command | Use Case |
---|---|---|
During active development | bugster update --against-last-update | Tight feedback loop |
Before opening a PR | bugster update --against-default | Final, comprehensive sweep |
For small, isolated edits | bugster update | Default mode usually sufficient |
Examples
Here are common scenarios and the commands to use.Default update for recently touched files
Default update for recently touched files
Full branch comparison before creating a PR
Full branch comparison before creating a PR
Tight inner loop without reprocessing old changes
Tight inner loop without reprocessing old changes
Limit to modifications only (no new/deleted tests)
Limit to modifications only (no new/deleted tests)
Generate suggestions for new areas only
Generate suggestions for new areas only
Purge tests tied to removed features
Purge tests tied to removed features
Combine scope and baseline
Combine scope and baseline
Review Tips
- Always review the Update PR diff before merging.
- Keep descriptive commit messages (e.g.,
bugster: update tests for billing portal flow
). - If a change looks incorrect, adjust the code or the test, rerun
bugster update
, and re-review.