test: restrict example/env to Cypress <15.10 - #1888
Open
MikeMcC399 wants to merge 1 commit into
Open
Conversation
Collaborator
|
MikeMcC399
force-pushed
the
example-env-pre-15.10
branch
from
September 5, 2026 08:33
8047f00 to
3962636
Compare
MikeMcC399
marked this pull request as ready for review
September 5, 2026 08:37
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PREREQUISITE FOR CYPRESS 16 UPGRADE
Situation
The example directory examples/env uses the Cypress.env() API call to get environment variables in tests. These are non-secret environment variables. The related workflow example-env.yml refers to this usage in comments.
In cypress@15.10.0
Cypress.env()was deprecatedallowCypressEnvwas introduced for the remaining lifetime of Cypress 15.x to enable explicitly disallowingCypress.env()cy.env()was added for sensitive configuration informationenvcorresponding to the action parameterenvis now specified for use with secret environment variablesCypress.expose()was added for non-sensitive configuration informationIn cypress-io/github-action@7.3.0
exposeparameter was added to be able to pass this to the Cypress Module APICypress.expose()In cypress@16.0.0
Cypress.env()was removedallowCypressEnvwas removedAssessment
The
envexamples are still relevant for action users that have not upgraded to minimum Cypress 15.10. They are however incompatible with Cypress 16 and block upgrading the repo.envcontinues to be available for GitHub Actions workflows for both secret and non-secret variables. Preserving various examples usingenvis therefore helpful for understanding how to use variables.Change
Skip the tests in examples/env for Cypress >=15.10.0
Update code inline comments and documentation accordingly.
Verification
Confirm that each test is successful.
Note
Low Risk
Documentation and example-test gating only; no changes to the GitHub Action runtime behavior.
Overview
Prepares the repo for a Cypress 16 upgrade by keeping the legacy
examples/envworkflow and tests while avoiding failures whereCypress.env()is deprecated (15.10+) or removed (16+).examples/enve2e specs now usesemverto run the existingCypress.env()assertions only on Cypress <15.10.0; on newer versions they register a no-op skip test instead.semveris added as a devDependency in that example package.Docs and CI comments are updated to state that
Cypress.env()is legacy, point readers toexample-expose.ymlfor non-sensitive config on 15.10+, and clarify in README that the actionenvinput is for older Cypress and for secrets on 15.10+, withexposefor public values.Reviewed by Cursor Bugbot for commit 3962636. Bugbot is set up for automated code reviews on this repo. Configure here.