Preview deployments

Test the Vercel preview of each pull request and see the result on the commit.

A pull request rule can test the preview Vercel builds for each pull request. The result appears as a check on the pull request, so you see it before you merge.

Rehearsal learns about a preview from GitHub. Vercel reports each deployment there when your repository deploys through Vercel's GitHub integration.

Set it up Link to Set it up

  1. Step 1: Connect the repository

    Connect the repository Vercel deploys to your project. See Connect a repository.

  2. Step 2: Add a pull request rule

    Open Deployments, press Rules, then Add a rule. Choose When a pull request is opened or updated and write the target branch, such as main.

  3. Step 3: Choose the tests and the preview

    Pick a suite or All approved tests. Under the address question, choose The pull request's Vercel preview. Press Save rule.

On each pull request Link to On each pull request

  1. Step 1: The pull request opens or changes

    A check named Rehearsal appears on the newest commit. It reads "Waiting for Vercel to deploy this commit".

  2. Step 2: The preview is ready

    When Vercel reports the preview ready, the tests start against its address. The check reads "Queued" and then "Running", with the number of tests.

  3. Step 3: The run ends

    The check shows the result, a table of the tests and a link to the run. See Checks on commits.

When no tests run Link to When no tests run

A waiting check always ends, so a required check never waits forever.

What happenedThe check readsConclusion
The deployment failedThe deployment failed, so there was nothing to testaction_required
No deployment arrived within 30 minutesRehearsal did not receive a deployment for this committimed_out
A newer commit arrivedA newer commit replaced this onecancelled
The pull request was closedThe pull request was closedcancelled
  • Before a check closes for lack of a deployment, Rehearsal asks GitHub once whether it missed one. If it did, the tests run.
  • A newer commit also stops a run that is still testing an older one.
  • Failed and missing deployments end as action_required and timed_out, so a required check keeps the pull request from merging.

Protected previews Link to Protected previews

Rehearsal cannot open protected previews yet, so your previews must be public.

The rule has a field for the secret from Vercel's Protection Bypass for Automation. You can save one there, but runs do not send it yet.

Pull requests from forks Link to Pull requests from forks

A pull request from a fork gets no check. Rehearsal skips it.

Branch deployments Link to Branch deployments

A branch or pattern rule can test Vercel's deployment of the branch instead, such as each deployment of main. It has no waiting check. The check appears when the tests start, under a name such as Rehearsal · main.

Next steps Link to Next steps