Skip to content

Conversation

@vedantvakharia
Copy link

Problem

Hi maintainers! I noticed Cypress tests in CI are failing. Would you like to enable Cypress Cloud recording, or should I disable it instead?

Cypress tests in CI are failing with the following error:

You passed the --record flag but this project has not been setup to record.
This project is missing the projectId inside of: cypress.config.ts

Root Cause:

  • GitHub Actions workflow has record: true enabled (line 48 of .github/workflows/yarn_test.yaml)
  • The workflow references secrets.CYPRESS_PROJECT_ID and secrets.CYPRESS_RECORD_KEY
  • These GitHub secrets are not currently configured in the repository

Option A: Enable Cypress Cloud (if you'd like)

Changes made to implement this fix

  • Updated apps/nowcasting-app/cypress.config.ts:
    • Added explicit placeholder for projectId with clear TODO comment
    • Made it obvious when environment variable is missing

If you'd like to enable Cypress Cloud recording, I'd need some help getting the credentials. Here's what would be needed:

1. Getting Cypress Cloud Credentials

If you have access to the Cypress Dashboard:

  1. Log into Cypress Dashboard
  2. Navigate to this project (or create a new project if needed)
  3. In Project Settings, you'll find the Project ID (looks like: abc123)
  4. In the Record Keys section, there should be an existing record key (or you could create a new one)

2. Adding GitHub Secrets

If you could add these two secrets to the repository at:
https://github.com/openclimatefix/quartz-frontend/settings/secrets/actions

Secret Name Value Where to find it
CYPRESS_PROJECT_ID abc123 (example) Cypress Dashboard → Project Settings
CYPRESS_RECORD_KEY a1b2c3d4-e5f6-... (example) Cypress Dashboard → Project Settings → Record Keys

Note: The record key should be kept private (it's like an API token)

Once these are added, the CI should automatically pick them up and recording will work!

Testing

Before Secrets are Added

The configuration will use the placeholder value. Tests will run but may show warnings.

After Secrets are Added

  1. CI will automatically work - No code changes needed
  2. Cypress Dashboard will show test recordings
  3. Test results will include videos and screenshots

Local Testing

# Run Cypress locally (no recording)
cd apps/nowcasting-app
yarn cypress run

# Run with recording (requires record key)
CYPRESS_PROJECT_ID=abc123 CYPRESS_RECORD_KEY=xxx yarn cypress run --record

Option B: Disable Recording

If you prefer not to use Cypress Cloud recording, you can instead:

  1. Set record: false in .github/workflows/yarn_test.yaml (line 48)
  2. Remove CYPRESS_RECORD_KEY and CYPRESS_PROJECT_ID from env block (lines 61-62)

Tests will still run locally and in CI, just not recorded to Cypress Cloud.

Let me know which approach you prefer!

Checklist

  • Updated cypress.config.ts with clear placeholder
  • Added TODO comment for maintainers
  • Documented required GitHub secrets
  • Provided step-by-step instructions
  • Maintainer: Add CYPRESS_PROJECT_ID to GitHub Secrets
  • Maintainer: Add CYPRESS_RECORD_KEY to GitHub Secrets
  • Verify: CI passes with recording enabled

Benefits

  • Makes configuration requirement explicit
  • Provides clear instructions for maintainers
  • No code changes needed once secrets are added
  • Tests continue to run

Questions? Happy to help with either approach or discuss further! Let me know what works best for your team.

Adds explicit placeholder configuration to cypress.config.ts that makes it
clear when CYPRESS_PROJECT_ID environment variable is missing. This change:

- Adds fallback placeholder value with clear TODO comment
- Documents that maintainers need to add GitHub Secrets
- Makes missing configuration obvious without breaking tests

Maintainers need to add these GitHub Secrets to complete the fix:
- CYPRESS_PROJECT_ID (from Cypress Dashboard)
- CYPRESS_RECORD_KEY (from Cypress Dashboard)

This enables Cypress Cloud recording in CI (currently failing).
@vercel
Copy link

vercel bot commented Jan 1, 2026

@vedantvakharia is attempting to deploy a commit to the Open Climate Fix Team on Vercel.

A member of the Team first needs to authorize it.

@vedantvakharia
Copy link
Author

CI Update: Additional Missing Secret Discovered

Hi maintainers! While testing this PR, I discovered there's another missing GitHub Secret that's preventing the Cypress tests from running. This is separate from the Cypress Cloud issue addressed in this PR.

The Issue

The Cypress tests are failing with:

TypeError: "secret" is not allowed to be empty
at auth0-session/get-config.js:197:15

This causes the Next.js server to crash with a 500 error when trying to load http://localhost:3002/.

Root Cause

The AUTH0_SECRET environment variable is referenced in the workflow (line 60 of .github/workflows/yarn_test.yaml):

AUTH0_SECRET: ${{ secrets.AUTH0_SECRET }}

However, this secret hasn't been added to the repository's GitHub Secrets yet.

What's Needed

To fix the CI tests completely, you'll need to add one more secret:

Secret Name: AUTH0_SECRET
Value: Your Auth0 secret key (used for session encryption)
Where to add: https://github.com/openclimatefix/quartz-frontend/settings/secrets/actions

Note: This should be a randomly generated string (at least 32 characters) used for encrypting Auth0 sessions. If you're using Vercel or another platform for deployment, this is typically the same value as the AUTH0_SECRET environment variable there.

Summary of All Missing Secrets

For the CI to pass, these three secrets need to be added:

Secret Name Purpose This PR Addresses
CYPRESS_PROJECT_ID Cypress Cloud project identifier Yes
CYPRESS_RECORD_KEY Cypress Cloud authentication Yes
AUTH0_SECRET Auth0 session encryption Pre-existing issue

My Recommendation

Since this is a separate issue from the Cypress Cloud configuration, you could:

  1. Add all three secrets at once (recommended - fixes both issues)
  2. Or add AUTH0_SECRET first to unblock CI, then add Cypress Cloud credentials later

Either way works! Happy to help if you need any clarification.


Note: This Auth0 issue was already present in the repository - my PR just helped surface it while testing the Cypress fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant