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.

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board

💡 Feature Request

Date

3 months ago

Author

Xtos

Subscribe to post

Get notified by email when there are changes.