Common Patterns
These patterns apply to every CI system; the platform-specific recipes below differ only in how they wire up the secrets.-
Always pass
--headless. CI runners have no display. -
Always set
--timeout <seconds>. A hung run cannot be allowed to block the pipeline. -
Authenticate with
--usernameand--access-keyfrom CI secrets. Do not callkane-cli loginin CI — that flow opens a browser for OAuth and will not work on a runner. -
Load test data with
--variables-file <path>. Check the file into your repo (without secret values), or generate it before the step. A{{name}}with no value fails the job with exit2before any browser starts, with a receipt naming the variable, so fill values from CI secrets in that step, not later. -
Run the suite on the cloud grid when the runner cannot run it.
kane-cli testrun run … --remoteturns the suite into one HyperExecute job: the grid supplies Chrome on a macOS runner, or, for mobile_test.mdmembers, a virtual Android emulator or iOS simulator, so the runner needs no Chrome, Xcode or Android Studio, and--parallel Nspreads the members across N grid runners. The recordings and the evidence pack come back to the checkout as if the suite had run on your machine.It needs a plan with HyperExecute macOS runners. Web and mobile members go in separate runs. Pick devices withkane-cli devices list --target emulator|simulator --remote, and allow a timeout of about 10 minutes. See Remote Runs. -
Check the exit code.
0passed,1failed,2error,3timeout or cancellation.
Authentication in CI/CD
Pass credentials directly on the run command using environment variables from your secrets store:Exit Codes
CI/CD Checklist
- Always use
--headlessand--agent: no display server in CI - Set
--timeout: prevents pipeline hangs (e.g.--timeout 300) - Set
--max-steps: caps run length (e.g.--max-steps 50) - Use
--variables-file: load test data from a committed config file - Store credentials as secrets: never hardcode in pipeline files
Platform Guides
- GitHub Actions
- GitLab CI
- Jenkins
- Bitbucket Pipelines
- Docker / Generic
Store
LT_USERNAME and LT_ACCESS_KEY as repository secrets under Settings > Secrets and variables > Actions.Running Multiple Tests
Run several tests and fail the pipeline if any fail:Variables in CI/CD
Commit a non-secret variables file to your repo, and inject secrets at runtime:A shared context store in CI
When your team shares the context graph through a location, a pipeline works on the same store: clone it once, pull before each run, and push the facts the run produced after. The sync commands never call the agent or spend credits, while the run between them,kane-cli context extract below, is an ordinary extraction and consumes credits like any other.
- Sign in without a person. For a GitHub location over HTTPS, set
KANE_SYNC_GIT_TOKENfrom a CI secret: a repository-scoped personal access token with Contents read and write, or a GitHub App installation token. A workflow’s ownGITHUB_TOKENonly reaches the workflow’s repository, so a separate context repository needs its own token. Over SSH, an SSH deploy key on the context repository works with no token. Kane CLI never answers an SSH prompt, so the runner must have the key loaded and the host’s key already accepted (ssh-keyscan github.com >> ~/.ssh/known_hosts). Repository rules must also allow the connection check’s scratch reference underrefs/kane/probe/, see Three kinds of location. For an S3-compatible location, setKANE_SYNC_S3_ACCESS_KEY_IDandKANE_SYNC_S3_SECRET_ACCESS_KEY. Neither is ever written to disk by Kane CLI. See Context sync environment variables. - Use
--mode agentfor structured output, and read the exit code:0done,3a person has to decide (the runner is behind or diverged, or a rebase stopped on decisions),2a precondition (the location cannot be reached, keys missing, a rebase still open). - Do not answer decisions blindly. A rebase that stops on a decision is a job that stops. Save
kane-cli context sync status origin --jsonas a build artifact: it is a report of what is waiting, not something a later job can replay on its own, because answers go to the store that holds the open rebase. The follow-up job must run on the same persisted.context/, a workspace or cache that survives between jobs, where a person or an agent answers withkane-cli context sync origin --answer <id>=<choice>.keep-theirswrites nothing, but it is a choice: the local change stays in the backup. The full contract is in Agents and CI. - Keep
.context/out of version control. The store never goes through a git merge, and the location is where it is shared.