Code Monkey home page Code Monkey logo

Comments (8)

EnricoMi avatar EnricoMi commented on May 18, 2024 1

Sorry, I had to revert that feature as it introduced some regression: #124

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024

Good point, this is a limitation of the used glob library. #121 fixes this, among other improvements.

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024

This has been released and is available as uses: EnricoMi/publish-unit-test-result-action@v1.

Thanks for raising this issue.

from publish-unit-test-result-action.

sjkingo avatar sjkingo commented on May 18, 2024

Just checking uses: EnricoMi/publish-unit-test-result-action@v1 definitely should fix this? I am using this:

        with:
          files: /github/workspace/pytest.xml

And still getting this:

 Traceback (most recent call last):
  File "/action/publish_unit_test_results.py", line 199, in <module>
    main(settings)
  File "/action/publish_unit_test_results.py", line 51, in main
    files = [str(file) for file in pathlib.Path().glob(settings.files_glob)]
  File "/action/publish_unit_test_results.py", line 51, in <listcomp>
    files = [str(file) for file in pathlib.Path().glob(settings.files_glob)]
  File "/usr/local/lib/python3.6/pathlib.py", line 1098, in glob
    raise NotImplementedError("Non-relative patterns are unsupported")
NotImplementedError: Non-relative patterns are unsupported

My use case is the previous build step runs tests inside a Docker container, which stores the xunit result file in the mapped /github/workspace volume. I need to publish it from there.

from publish-unit-test-result-action.

sjkingo avatar sjkingo commented on May 18, 2024

Thanks for the update.

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024

The bug has been resolved in #126 and released again.

from publish-unit-test-result-action.

invalidred avatar invalidred commented on May 18, 2024

Hey @EnricoMi is absolute file path supported? I have the following config with my test results stored in /tmp/e2e-artifacts/results.xml

      - name: run e2e test
        env:
          LOGIN_SECRET: ${{secrets.LOGIN_SECRET}}
        run: |
          docker run -t  \
          -e LOGIN_SECRET \
          -e CI=true \
          -v /tmp/e2e-artifacts/:/app/playwright-report/ \
          -v /tmp/e2e-artifacts/:/app/test-results/ \
          ${{ env.TEST_TAG }}

      - name: upload e2e artifact
        uses: actions/upload-artifact@v2
        if: ${{ always() }}
        with:
          name: e2e-artifact
          path: /tmp/e2e-artifacts/
          retention-days: 5

      - name: check contents of /tmp
        run: ls /tmp/e2e-artifacts/

      - name: Publish Unit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v1
        if: always()
        with:
          files: |
             /tmp/e2e-artifacts/results.xml

According the the ls /tmp/e2e-artifacts/ I see the artifact file does exists

data
index.html
results.xml
src-pages-me-booking-links-__tests__-create-booking-link-Create-booking-link-Create-simple-booking-link--chromium
src-pages-me-calendars-__tests__-calendar-Calendar-operations-create-calendar-update-delete-calendar-chromium

However I see the following when the Publish Unit Test Results runs

Warning: Could not find any files for /tmp/e2e-artifacts/results.xml

I was wondering if absolute paths are supported.

Thank you for your wonderful GH action.

from publish-unit-test-result-action.

EnricoMi avatar EnricoMi commented on May 18, 2024

I think the issue is that uses: EnricoMi/publish-unit-test-result-action@v1 runs the action in a docker container which mounts the current working directory but nothing beyond.

The following should work:

      - name: Move artifacts from /tmp into CWD
        run: mv -v /tmp/e2e-artifacts ./

      - name: Publish Unit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v1
        if: always()
        with:
          files: |
             ./e2e-artifacts/results.xml

from publish-unit-test-result-action.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.