Running E2E post deployment

I have a static site, and I’ve written some end-to-end tests for it in Cypress.

I would like to run these tests on the live site after a successful deployment, but I can’t think of a way to do it. As far as I know, there are no “post deploy” hooks in Render.

What are my options here? The code resides in Github, and I have access to GH actions.

1 Like

Hi @nixstrom, welcome to the Render community! We do have a couple features that are planned that I think would be helpful for your use case in providing signal of a successful deploy: Github Checks may be one, as well as Deploy Webhooks. You can upvote the feature requests to receive future updates on development progress.

1 Like

If your service is managed using IaC, Render will post deployment status updates to the Github repository. It looks like you can trigger a Github Action based on a deployment status, so you should be able to run E2E tests when a deployment is marked as active.

2 Likes

Oh, that sounds like a good solution, Jake. However, I can see that Render does not in fact post a deployment status to the repo, even though it has full access. Do I need to do something special to enable this?

PS: The service is managed with IaC.

Could you share the service ID? Feel free to DM me.

Any outcome here? We have the same usecase and need to trigger GH actions that run e2e tests when a render preview deployment is successfully deployed. Ideally, we could also get the URL of it but we will get away without that one for now.

Definitely feels like GitHub actions can help here - I started experimenting with this myself and got as far as:

name: Staging e2e testson: deployment_statusjobs: e2e: if: ${{ github.event.deployment_status.state == 'success' && github.ref == 'refs/heads/staging' }} runs-on: ubuntu-latest steps: - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - run: echo "Target URL is ${{github.event.deployment_status.target_url }}" - run: echo "Deployment URL is ${{github.event.deployment.url }}"

getting the URL of the actual deployment seems tough from the GitHub API - the ‘View Deployment’ button that is shown in the GitHub UI doesn’t seem to exist in the deployment API endpoints

John B