简体   繁体   中英

Cypress code coverage, Pipeline Docker save logs error

im running my cypress code coverage report with using "npx nyc report --reporter=lcov --reporter=text-summary" also i have script which is "yarn e2e:coverage" but i want to see result in github actions log;

**

- name: Save logs
        continue-on-error: true
        if: ${{ always() }}
        env:
          COMMIT_SHA: ${{ steps.vars.outputs.sha_short }}
        run: |
          docker ps
          docker cp cypress_test:/cypress-coverage cypress-coverage
      - name: Compress action step
        uses: a7ul/tar-action@v1.1.0
        id: compress
        with:
          command: c
          cwd: .
          files: |
            cypress-coverage
          outPath: test_cypress_coverage.tar
      - name: Archive coverage
        continue-on-error: true
        if: ${{ always() }}
        env:
          COMMIT_SHA: ${{ steps.vars.outputs.sha_short }}
        uses: actions/upload-artifact@v2
        with:
          name: "${{ steps.date.outputs.yyyymmdd }}_E2E_test_coverage_${{ env.COMMIT_SHA }}"
          path: |
            test_cypress_coverage.tar
          retention-days: 7

**

Im using this part for it but there is a error "Error: No such container:path: cypress_test:/cypress-coverage" do you guys have a any idea how to find correct path ? How to see log of coverage result ? Btw i can get artifacts its working as expected but i got save logs error.

在此处输入图像描述

If the compress_test container has a bash, I would try and check:

  • if there is a log file produced at that stage
  • where it is.

That would be:

docker exec -it compress_test find / -name "cypress-coverage*"

That way, you can see for yourself where the file is.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM