Filter Sessions by Start URL

By default a test run replays all of your project's selected sessions. When triggering a run with ci run-with-uploaded-asset-chunks you can restrict the run to the sessions that start on specific routes — for example to only test the part of your app affected by a change — by passing a session filter.

Usage

Write a JSON file with a session-start-url-matches-any-regex key listing one or more regexes:

cat > session-filter.json <<'EOF'
{
  "session-start-url-matches-any-regex": [
    "/checkout/",
    "^https://app\\.example\\.com/settings"
  ]
}
EOF

npx @alwaysmeticulous/cli ci run-with-uploaded-asset-chunks \
  --apiToken="$METICULOUS_API_TOKEN" \
  --commitSha="$CI_COMMIT_SHA" \
  --assetReferencesManifest="./assets-manifest.json" \
  --sessionFilter="./session-filter.json"

A session is replayed if its start URL — the URL the session started recording on — matches at least one of the regexes. The same filtered set of sessions is used for both the head run and any base run created to compare against, so comparisons stay consistent. If the filter matches no sessions, the command fails with an error rather than triggering an empty run.

Regex syntax

Regexes use Google's RE2 syntax. They are validated before the run is triggered, so a regex that doesn't compile fails fast in the CLI with a clear error.

The session filter narrows a single test run down from the project's selected sessions; it doesn't change which sessions Meticulous records or selects. Runs triggered without --sessionFilter still replay the full selected set.