Ei ollut tuo. Sain tuon kuitenki toimimaan näin:Olisko tämä:
We are getting reports that Cypress has suddenly started crashing when running on ubuntu-latest OS. Seems, GH Actions have switched from 16.04 to 18.04 overnight, and are having a xvfb issue. Please work around this problem by using runs-on: ubuntu-16.04 image or upgrading to Cypress v3.8.3 where we explicitly set XVFB arguments.
Koodi:
name: End-to-end tests
on: [push, pull_request]
jobs:
cypress-run:
runs-on: ubuntu-16.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- run: npm install
working-directory: backend
- name: Cypress run
uses: cypress-io/github-action@v1
with:
working-directory: frontend
config-file: cypress.json
start: npm run start:ci
wait-on: http://localhost:3000
env:
TEST_MONGODB_URI: ${{ secrets.TEST_MONGODB_URI }}
JWT_SECRET: ${{ secrets.JWT_SECRET }}
RECAPTCHA_SECRET_TEST: ${{ secrets.RECAPTCHA_SECRET_TEST }}
Eli nyt tein tonne frontendin puolelle package.json tiedostoon start:ci skriptin, joka käynnistää backendin ja frontendin näin: "start:ci": "cd ../backend && npm run start:ci & npm start".
Nyt testit pyörähti käyntiin oikein ja suurin osa meni jopa läpi. Jotkut testit feilasi, mutta ainoastaan käyttöjärjestelmäerojen takia.
