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

Error: connect ECONNREFUSED 127.0.0.1:5173

Open CaiqueCoelho opened this issue 1 year ago • 2 comments

I'm trying to add a container image for cypress/browsers and setting browser as chrome to run Cypress tests in the GHA with cypress-io/github-action@v6 but I'm getting the following error

Error: connect ECONNREFUSED 127.0.0.1:5173

This is my config:

jobs:
  cypress-super-user:
    runs-on: ubuntu-20.04
    container:
      image: cypress/browsers:node-20.18.0-chrome-129.0.6668.89-1-ff-131.0.2-edge-129.0.2792.65-1
      options: --user 1001
    strategy:
      fail-fast: false
      matrix:
        containers: [1, 2, 3, 4]
    timeout-minutes: 180
    steps:
      - name: Checkout 🛎️
        uses: actions/checkout@v4
        with:
          token: ${{ steps.generate_token.outputs.token }}
          submodules: recursive
          persist-credentials: false

      - name: Set up Node
        uses: actions/setup-node@v4
        with:
          node-version: 20.18.0

      - name: Install Dependencies
        run: npm i

      - name: Run directory_ui
        run: npm run serve &

      - name: Cypress Tests 🧪
        uses: cypress-io/[email protected]
        with:
          record: true
          parallel: true
          browser: chrome
          wait-on: "http://localhost:5173/"
          wait-on-timeout: 180
          env: userType=userSuperAdminType
          group: Raidiam - Super Admin
          config: baseUrl=http://localhost:5173

If I remove the container from the job Cypress is able to connect to 127.0.0.1:5173 and all tests pass

Additional Information: I'm using VUE version 2.7.14 and VITE version 5.4.6 Cypress version 13.15.0

CaiqueCoelho avatar Oct 16 '24 20:10 CaiqueCoelho

@CaiqueCoelho

You may find the README section Debugging helpful to look at what is going wrong in your workflow. There may be some timing differences between running directly in ubuntu-20.04 compared to running in a container using a Cypress cypress/browsers:node-20.18.0* Docker image, which is based on Debian 12.7.

You mention that you are using VUE version 2.7.14. According to https://v2.vuejs.org/eol/, Vue 2 reached end of life on Dec 31, 2023 and is no longer maintained.

MikeMcC399 avatar Oct 17 '24 08:10 MikeMcC399

@CaiqueCoelho

Although I don't expect it to solve your issue, regarding the following section:

      - name: Install Dependencies
        run: npm i

      - name: Run directory_ui
        run: npm run serve &

if your repo contains a package-lock.json, then you may be able to replace these two steps using the start option. See the README documentation Start server.

MikeMcC399 avatar Oct 17 '24 09:10 MikeMcC399

@CaiqueCoelho

Are you expecting any further assistance with your issue?

MikeMcC399 avatar Oct 23 '24 14:10 MikeMcC399

Closing, since there hasn't been any feedback to the comments and there is no other action that can be taken in the repository concerning this issue.

MikeMcC399 avatar Oct 24 '24 17:10 MikeMcC399