Ali Unsal Albaz
Ali Unsal Albaz

Reputation: 55

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/[email protected]
        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.

enter image description here

Upvotes: 1

Views: 187

Answers (1)

VonC
VonC

Reputation: 1324248

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.

Upvotes: 1

Related Questions