Skip to content

Inconsistencies in CYPRESS_DOWNLOAD_PATH_TEMPLATE handling #19914

Closed
@mjhenkes

Description

@mjhenkes

Current behavior

There seem to be some inconsistencies in how CYPRESS_DOWNLOAD_PATH_TEMPLATE is handled from the .npmrc file depending on package manager and version.

Given
CYPRESS_DOWNLOAD_PATH_TEMPLATE=${endpoint}/${platform}-${arch}/cypress.zip

npm 7 works, though locally i've seen the env fail to get picked up because of casing.
npm 6 attempts to replay endpoint etc with other ENVs (this is unfortunate, but you can escape them but that doesn't work either)
Yarn 1 doesn't remove double quotes.

I haven't tested yarn 3 or npm 8 but they should be looked at, as well as windows useage.

Desired behavior

Ideally you could set the CYPRESS_DOWNLOAD_PATH_TEMPLATE variable with any package manager

Test code to reproduce

Try out setting variations of

CYPRESS_DOWNLOAD_PATH_TEMPLATE=${endpoint}/${platform}-${arch}/cypress.zip
CYPRESS_DOWNLOAD_PATH_TEMPLATE=\${endpoint}/\${platform}-\${arch}/cypress.zip
CYPRESS_DOWNLOAD_PATH_TEMPLATE="${endpoint}/${platform}-${arch}/cypress.zip"
CYPRESS_DOWNLOAD_PATH_TEMPLATE="\${endpoint}/\${platform}-\${arch}/cypress.zip"

Cypress Version

9.3.1

Other

Where CYPRESS_DOWNLOAD_PATH_TEMPLATE is used
https://github.com/cypress-io/cypress/blob/develop/cli/lib/tasks/download.js#L67

getEnv implementation
https://github.com/cypress-io/cypress/blob/develop/cli/lib/util.js#L459

We should probably be setting trim on getENV, that should resolve any double quotes problems.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions