Skip to main content

Allow custom run titles (e.g., use Playwright test/spec name instead of commit/PR title)

Summary

For scheduled (cron) and single-spec runs, the commit/PR title isn’t meaningful. We need a deterministic way to set the Currents “Run title” from the Playwright test/spec name or a custom function, without relying on environment hacks.


Problem

  • Currents run titles default to commit/PR. For hourly monitors and smoke checks this is noisy and unhelpful.

  • When we execute one spec or one test, we want the run title to reflect that test/spec (e.g., “[plan-check] Bronze/Silver/Gold exist”) so dashboards and Slack alerts are instantly readable.

Impact

  • Much clearer run list, filters, and Slack notifications.

  • Easier triage: the title itself tells us what failed.

  • Works especially well for cron jobs where git metadata is irrelevant.

Proposal

Add a first-class way to control the run title in the Playwright reporter options (and via env/CLI) Ex:

// playwright.config.ts

['@currents/playwright', {

recordKey: process.env.CURRENTS_RECORD_KEY,

projectId: process.env.CURRENTS_PROJECT_ID,

// NEW: choose the title source

runTitleSource: 'firstTest' | 'specFile' | 'project+spec' | 'commit' | 'custom',

// NEW: if 'custom', Currents calls this with context about the run

buildNameFn: (ctx) => {

// ctx: { firstTest?, specFile?, projectName, branch, sha, workflow, attempt, ... }

return [plan-check] ${ctx.firstTest?.title ?? ctx.specFile ?? 'run'}; },


// keep existing env override if set buildName: process.env.CURRENTS_BUILD_NAME,

}]

Also support env/CLI equivalents, e.g.:

  • CURRENTS_RUN_TITLE_SOURCE=firstTest|specFile|project+spec|commit|custom

  • If CURRENTS_BUILD_NAME is present, it still wins.

Behavior / Acceptance Criteria

  • Single test run: title becomes the test title (or buildNameFn output).

  • Single spec with multiple tests: title can be the spec filename or project+spec, or buildNameFn.

  • Multi-spec runs: use the selected source (project+spec (N tests)), or buildNameFn.

  • Title is shown consistently in runs list, run detail page, and Slack notifications.

Nice-to-have

  • Expose more fields in ctx (tags, duration, status counts).

  • Per-run tag injection that also shows in Slack.

Current Workaround

  • We set CURRENTS_BUILD_NAME before each invocation and run one spec per step. This works but is fragile and verbose across multiple suites.

1 comment

Log in to comment and vote

Comments1

  • Andrew Goldis

    Team•

    Nov 11, 2025

    @Xtos thanks for the detailed breakdown!

    As a workaround, I suggest using COMMIT_INFO_MESSAGE as appears in https://docs.currents.dev/dashboard/runs/commit-information to set the run title as a workaround.

    I understand that it is more correct and convenient to have a distinct environment variable like CURRENTS_RUN_TITLE or a function, without overriding / mixing in git commit info; e.g. an output from configuration file function.

    However, having predefined sources like firstTest or specFile is too specific for your use case and fragile for various popular scenarios like multi-shard executions.

    Please note that in multi-shard scenarios run title will be determined by the first “create run” request.