在 GitHub 上并行运行测试只为最后执行的测试文件生成 Allure 报告

问题描述 投票:0回答:0

当我在本地或按顺序在 GitHub 上运行这些测试时,它会生成 Allure 报告,但是当我使用三个不同的 GitHub 实例并行运行它时,它只会为最后执行的测试文件生成结果。

    name: PROD_ALLURE_REPORT
on:
  workflow_dispatch:
jobs:
  build:
    runs-on: ubuntu-latest
    env:
        STAGE_USER_NAME: ${{ secrets.STAGE_USER__EMAIL}}
        STAGE_USER_PASSWORD: ${{ secrets.STAGE_USER_PASSWORD}}

    strategy:
      matrix:
        node-version: [18.14.0]
        test-file:
                  - bprod.test.js
                  - login.test.js
                  - Facebook.test.js

      fail-fast: false
      max-parallel: 3   
    steps:
    - uses: actions/checkout@v3
    - name: Use Node.js ${{ matrix.node-version }}
      uses: actions/setup-node@v3
      with:
        node-version: ${{ matrix.node-version }}
        cache: 'npm'
    - run: npm install
    - run: npm install jest puppeteer jest-puppeteer
    - run: npm install -g jest   
    - run: npm i jest-allure
    - run: npm i allure-commandline
    - run: npm install dotenv
    - run: npm install @babel/core @babel/preset-env babel-jest
    - name: Run Tests   
      id: build
      run: npx jest ${{ matrix.test-file }} jest --reporters default jest-allure --detectOpenHandles --forceExit --testTimeout=300000
      continue-on-error: true
   
    - run: npm run alluregenerate
    - name: Upload a Build Artifact
      if: always()
      uses: actions/upload-artifact@v2-preview
      with: 
          name: report-${{ github.run_number }}
          path: allure-report
github github-actions puppeteer allure jest-puppeteer
© www.soinside.com 2019 - 2024. All rights reserved.