[英]NX Cypress run twice on the GitHub Action
I am using NX 14.5.1 and cypress 10.2.0.我正在使用 NX 14.5.1 和 cypress 10.2.0。 When I run e2e tests on GitHub actions, my tests always run twice.
当我对 GitHub 操作运行 e2e 测试时,我的测试总是运行两次。 Sometimes one of them causes an error.
有时其中一个会导致错误。
This is my github workflow:这是我的 github 工作流程:
jobs:
continuous_integration:
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
# run copies of the current job in parallel
containers: [1, 2, 3, 4, 5]
steps:
- name: 🏁 Checkout Repo
uses: actions/checkout@v3
- name: 🏁 Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
- name: Install Firebase Emulator Suite
run: npm install -g firebase-tools@9.20.0
- name: 💾 Install Dependencies
run: npm ci
- name: ✅ E2E Tests
uses: cypress-io/github-action@v4
with:
install: false
start: |
npm run e2e:firebase
npm run e2e
wait-on: http://localhost:4200
wait-on-timeout: 120
working-directory: apps/e2e
record: true
parallel: true
env:
FIREBASE_TOKEN: '${{ secrets.NX_FIREBASE_TOKEN }}'
And the result is like this result e2e test on GitHub Action结果就像GitHub 上的结果 e2e 测试
✓ should go to My Cards page (5043ms)
✓ should open Paint Point modal (3831ms)
✓ should open Insight modal (3323ms)
✓ should open Idea modal (2591ms)
(Attempt 1 of 3) should go to My Cards page
✓ should go to My Cards page (2328ms)
✓ should open Paint Point modal (1978ms)
✓ should open Insight modal (2302ms)
✓ should open Idea modal (2245ms)
✓ should create Paint Point card (4321ms)
(Attempt 1 of 3) should create Paint Point card
✓ should create Insight card (7147ms)
✓ should create Idea card (8727ms)
✓ should create Paint Point card (13580ms)
✓ should show modal from header create button (7298ms)
Do I miss a GitHub workflow configuration here?我在这里错过了 GitHub 工作流程配置吗?
I think that's because you will need to split the workflow into 2 jobs as describe here .我认为这是因为您需要将工作流程拆分为 2 个作业,如此处所述。
Also you would need to make sure you are using their container image as mentioned Here此外,您还需要确保您使用的是这里提到的他们的容器图像
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.