github-action icon indicating copy to clipboard operation
github-action copied to clipboard

`npm_package` variables not set when processing `cypress/plugins/index.js`

Open max-nextcloud opened this issue 3 years ago • 1 comments

We're using a webpack config that makes use of npm_package_name and npm_package_version.

These are not set during the run - which is confusing as it looks like npx is used to run the job.

I'd expect the npm_package_... variables to be set just like when i run npx cypress run locally.

max-nextcloud avatar Mar 23 '22 11:03 max-nextcloud

Setting the variable in env fixes the failing test.

max-nextcloud avatar Mar 23 '22 11:03 max-nextcloud

Ahaha, I see we had the same issue @max-nextcloud :cry:

skjnldsv avatar Jan 06 '23 13:01 skjnldsv

@max-nextcloud

It looks like you were able to resolve your issue.

Can this be closed now?

MikeMcC399 avatar Nov 06 '23 15:11 MikeMcC399

Closing, since this is a stale, inactive issue.

MikeMcC399 avatar Nov 09 '23 11:11 MikeMcC399

It looks like you were able to resolve your issue.

I was able to find a workaround by setting npm_package_name in the env even though it should be set by npx. If i remove the workaround the run still fails: https://github.com/nextcloud/text/actions/runs/6812145616/job/18524231320

Can this be closed now?

Your choice. The issue in the action still is there but a workaround exists.

max-nextcloud avatar Nov 09 '23 13:11 max-nextcloud

@max-nextcloud

Thanks for responding!

Since v2, the action uses Module API to run Cypress (see CHANGELOG), so at that point neither npm nor npx are involved.

The cypress/plugins/index.js is no longer supported (see Plugins File Removed). This affects all non-legacy versions of Cypress starting with 10.x including the current 13.x version. The repo https://github.com/nextcloud/text, which this issue is linked to, looks like it has already migrated to Cypress 13.x.

So, I would tend to leave this issue closed if you have a workaround which fits your needs. If there is anything which needs investigating, then probably a new issue would be better than re-opening this one, due to migration differences.

MikeMcC399 avatar Nov 09 '23 18:11 MikeMcC399