sorry-cypress / cy2

Integrate Cypress with alternative cloud services like Sorry Cypress or Currents
https://docs.sorry-cypress.dev/cypress-agent/cy2
GNU General Public License v3.0
32 stars 5 forks source link

Unsupported NODE_EXTRA_CA_CERTS #48

Closed agoldis closed 1 year ago

agoldis commented 1 year ago

Before opening, please confirm:

Environment information

All environments

Describe the bug

Version 4.0.0+ does not support providing NODE_EXTRA_CA_CERTS

Expected behavior

NODE_EXTRA_CA_CERTS should work

Log and debug output

n/a

Additional information and screenshots

n/a

krukonshedul commented 1 year ago

In our setup, we have one process which then triggers Cypress via Module API multiple times (retries all failed tests once more to rule-out infra flakyness, runs agains multiple viewports etc). What's interesting, after updating Cy2, the very first Cypress run works as expected - it's only the subsequent ones that crash with NODE_EXTRA_CA_CERTS not supported error.

Observing this as it's blocking us from updating Cypress. If I can help anyhow, gladly will.

agoldis commented 1 year ago

@krukonshedul can you please try cy2@4.0.5-alpha.0

krukonshedul commented 1 year ago

@agoldis Getting a different error now.

Below is the rough representation of how we run cypress

const { run } = require('cy2'}
const runOptions1 = { // some options }
const runOptions2 = { // some other options }
const apiUrl = '' // cypress API URL

async function runCypressStages() {
    return run(apiUrl, runOptions1).then(results => {
        processResults(results)
        return run(apiUrl, runOptions2)
    }.then(results => processResults(results))
}

This first run works as expected. The other one shows up the following error:

WARNING  Mismatch between protocol 'http' and env variable HTTPS_PROXY: http://127.0.0.1:39211/. Use HTTP_PROXY instead. 
libva error: va_getDriverName() failed with unknown libva error,driver_name=(null)
[840:0116/170940.149317:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
Couldn't find tsconfig.json. tsconfig-paths will be skipped
cypress-grep: filtering using tag(s) "smoke"
cypress-grep: will omit filtered tests

WARNING  Error connecting to <DIRECTOR URL> connect ECONNREFUSED 127.0.0.1:39211 

We encountered an unexpected error talking to our servers.

We will retry 3 more times in 30 seconds...

The server's response was:

RequestError: Error: ESOCKETTIMEDOUT

It's worth noting that we haven't been originally setting NODE_EXTRA_CA_CERTS ourselves - they were set by Cy2.

In my previous attempts, I have added following line after each "run" command, and with this hacky change I have been seeing errors similar to the one I've pasted above:

delete process.env.NODE_EXTRA_CA_CERTS 
agoldis commented 1 year ago

@krukonshedul please try using cy2@4.0.5-alpha.1

krukonshedul commented 1 year ago

@agoldis alpha.1 worked perfectly, thank you! :bow: