dotherightthing / wpdtrt-npm-scripts

NPM build scripts.
0 stars 0 forks source link

CI: test:js (Cypress test) fails with "dri3 extension not supported" #62

Open dotherightthing opened 2 years ago

dotherightthing commented 2 years ago
   2) scripts
       wordpress-plugin
         test
           runs Cypress (JS) tests:

      AssertionError: [5371:0828/003835.669238:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
tput: No value for $TERM and no -T specified
tput: No value for $TERM and no -T specified: expected '[5371:0828/003835.669238:ERROR:gpu_me…' to equal ''
      + expected - actual

      -[5371:0828/003835.669238:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
      -tput: No value for $TERM and no -T specified
      -tput: No value for $TERM and no -T specified

      at Context.<anonymous> (file:///home/runner/work/wpdtrt-npm-scripts/wpdtrt-npm-scripts/test/tasks/scripts.spec.mjs:460:30)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
dotherightthing commented 2 years ago

Sounds like a Chromium issue, see:

masaok commented 2 years ago

This article helped me: https://shouv.medium.com/how-to-run-cypress-on-wsl2-989b83795fb6 OS: Windows 10 with WSL2

abdulflorez commented 1 year ago

@masaok Hi! Excuse me, could you explain exactly what you did?

ddnexus commented 1 year ago

It looks like a more general github issue with cypress 12 to me, not related to "dri3 extension not supported", which does not stop the tests when it is triggered in the case below.

Opening Cypress...
[2[21](https://github.com/ddnexus/pagy/actions/runs/3682064615/jobs/6229346491#step:6:22)3:1213/034520.912967:ERROR:sandbox_linux.cc(377)] InitializeSandbox() called with multiple threads in process gpu-process.
[[22](https://github.com/ddnexus/pagy/actions/runs/3682064615/jobs/6229346491#step:6:23)13:1213/034520.919424:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped

====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        10.3.0                                                                         │
  │ Browser:        Electron 100 (headless)                                                        │
  │ Node Version:   v16.13.0 (/home/runner/runners/2.[29](https://github.com/ddnexus/pagy/actions/runs/3682064615/jobs/6229346491#step:6:30)9.1/externals/node16/bin/node)              │
  │ Specs:          6 found (calendar-nav.cy.ts, combo-nav.cy.ts, helpers.cy.ts, input.cy.ts, nav. │
  │                 cy.ts, trim.cy.ts)                                                             │
  │ Searched:       cypress/e2e/**/*.cy.{js,jsx,ts,tsx}                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

(you can see the original run here And open "Run Cypress Tests")

@dotherightthing maybe the link to your failed run would help.

Here is a run that fails (but after the error) CI action, and the difference is cypress 12 instead of 10, but it might be related to my specific case.

@dotherightthing which version are you using?

sachingainewar commented 1 year ago

@ddnexus , did you find teh solution for cypress 12 errors ? Missing baseUrl in compilerOptions. tsconfig-paths will be skipped ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported

I am also straggling with these error for cypress 12...

ddnexus commented 1 year ago

@sachingainewar In my case there was a missing explicit installation of typescript in the workflow, that for some reason was not affecting the previous version. You can see the changes here.

KjetilIN commented 1 year ago

@ddnexus Do you have to specify typescript? Why? Still struggle to make it work with version 12.17 Probably me setting it up wrong

maxie7 commented 1 year ago

I have the same issue!!! I tried cypress image 12.3.0 and 12.17.1. Typescript is installed

Here is my output if it could clarify something:

image

Cypress starts and works well from the root of the project without docker. This issue caused by docker images. It seems Cypress included images do not ship any browser except electron.

So it's related to this issue: https://github.com/cypress-io/cypress-docker-images/issues/695

KjetilIN commented 1 year ago

My solution: Wrong cypress command

In the CI/CD yml file:

...
- name: Run cypress Test
        uses: cypress-io/github-action@v5
        with:
          start: npm run dev #Running frontend code
          wait-on: http://localhost:3000 #Wait before testing
          command: npm run cypress-test #Running the test command
...

cypress-test is defined inpackage.json as:

"cypress-test": "cypress run --browser chrome --env test=true"

I tried to use cypress open and also without waiting on the frontend code to be run. cypress run does not open a browser but instead runs the test.

Maybe this could help @ddnexus , idk ✍️

maxie7 commented 1 year ago

Sorry, I have nothing about CI/CD, just docker-compose.yml.

I tried this: "cypress run --browser chrome --env test=true" but the result is the same. Are there any docs about how to configure Cypress with docker like this one ?!