Running on CI

in Japanese(日本語)

Scenarios execute deterministically without any cloud LLM, so they fit CI: exit code and JUnit XML are both machine-readable. A few checks use on-device Foundation Models on your Mac; you can turn them off in the run profile. This page takes you step by step until a test project runs in CI. It uses Jenkins as the example, but steps 1 to 3 are the same on other CI systems.

1. Prepare the CI machine

Expected result:

2. Install fleetest

The extension and MCP aren't needed in CI. Check out the test project on the CI machine and clone fleetest next to it (install.sh moves it to the release tag). For keeping the test project in git, see Sharing the test project until a second person runs it.

git clone https://github.com/wave1008/fleetest.git ../fleetest

The next command is idempotent — a second run is mostly a no-op.

bash ../fleetest/Scripts/install.sh --work-dir "$PWD" --skip-extension --skip-mcp --no-doctor

Prompt for the AI

Install fleetest with install.sh. The extension and MCP are not needed; run it idempotently.

Expected result:

3. Put the run command in the job

# Run: --quiet suppresses per-step lines, --junit writes JUnit XML
../fleetest/.build/debug/fleetest run --profile ios-run --quiet --junit reports/junit.xml

Prompt for the AI

Run ios-run with --quiet --junit reports/junit.xml. Also tell me the exit code and whether reports/junit.xml exists.

Expected result:

4. Have CI read the JUnit

<testsuite> per scenario class, <testcase> per scenario. A failure carries the first failing step's summary, every failing step with its source location, the Markdown report path, and the worker it ran on. A scenario is <skipped> only when every step in it is inconclusive (a verify with zero assertions) — mixed with normal steps, it is folded into a passing <testcase> instead (visible in the execution log and the Markdown report's ❓ marker and fix suggestion).

Prompt for the AI

The job definition (a Jenkinsfile, …) can be written by the AI.

Create a Jenkinsfile in this repository. Stages: "install fleetest idempotently with install.sh (clone it to ../fleetest first if it is missing)", then "fleetest run --profile ios-run --quiet --junit reports/junit.xml". In post, collect the JUnit, and on failure archive reports/junit.xml and TestProjects/*/reports/ as artifacts.
If you write it by hand (click to show details)

A Jenkins example:

pipeline {
  agent { label 'mac' }   // an agent that runs as a logged-in GUI session user
  stages {
    stage('Install / update') {
      steps { sh '[ -d ../fleetest ] || git clone https://github.com/wave1008/fleetest.git ../fleetest'
              sh 'bash ../fleetest/Scripts/install.sh --work-dir "$PWD" --skip-extension --skip-mcp --no-doctor' }
    }
    stage('Run scenarios') {
      steps { sh '../fleetest/.build/debug/fleetest run --profile ios-run --quiet --junit reports/junit.xml' }
    }
  }
  post {
    always  { junit 'reports/junit.xml' }
    failure { archiveArtifacts artifacts: 'reports/junit.xml, TestProjects/*/reports/**', allowEmptyArchive: true }
  }
}

Expected result:

5. Make it periodic, and clean up between jobs

Have the job start periodically (in Jenkins, triggers { cron('H 2 * * *') }; for splitting what runs every time from what runs at night, see Running smoke and regression separately). When jobs run back to back, settle these three points.

Prompt for the AI

Add a nightly 2 a.m. schedule to the Jenkinsfile. Give fleetest run --wait-lock 1800, and run fleetest devices down --profile ios-run at the end of the job.

Expected result:

Things to know

Using Apple Intelligence in CI (optional)

Without Apple Intelligence in CI, two things change: screenLooksLike passes without being checked, and text visibility check judges by OCR alone (Text visibility check). A ⚠️ line is printed at startup. If you need visual checks enforced, read on.

Apple Intelligence works only when the runner is a physical Mac (bare metal). It cannot be enabled inside a macOS VM (Tart, Anka and the like), so plan on it being unavailable there.

To enable it on bare metal:

Flaky scenarios (no retry mechanism, by design)

There is no built-in per-scenario retry in CI: automatic retries hide flakiness and let it rot. Instead:

Once you find one, fix it following Writing robust scenarios, and run the same scenario several times in a row to confirm the fix.