question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support absolute path in `files` setting

See original GitHub issue

I would like to collect test results somewhere in /tmp (so that I don’t modify the checked out source tree that is the current working directory). Unfortunately, this fails with the following error:

Traceback (most recent call last):
  File "/action/publish_unit_test_results.py", line 202, in <module>
    main(settings)
  File "/action/publish_unit_test_results.py", line 52, in main
    files = [str(file) for file in pathlib.Path().glob(settings.files_glob)]
  File "/action/publish_unit_test_results.py", line 52, 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

Here is my configuration:

      - name: Publish Unit Test Results
        uses: EnricoMi/publish-unit-test-result-action@v1.12
        # run even if tests failed
        if: always()
        with:
          files: /tmp/test-reports/**/*.xml

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
EnricoMicommented, May 3, 2021

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

0reactions
EnricoMicommented, Feb 24, 2022

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
Read more comments on GitHub >

github_iconTop Results From Across the Web

File path formats on Windows systems | Microsoft Learn
As result, the first is an absolute path from the root directory of drive C: , whereas the second is a relative path...
Read more >
Java File Path, Absolute Path and Canonical Path | DigitalOcean
On UNIX systems, a relative pathname is made absolute by resolving it against the current user directory.
Read more >
How to set an absolute path in TypeScript | Towards the Cloud
Absolute file paths can help organize the imports in your TypeScript projects by improving the way import locations are fetched by the ...
Read more >
Relative and absolute paths, in the file system and on the web ...
If the path is built starting from the system root, it is called absolute. · If the path is built starting from the...
Read more >
Classic SysAdmin: Absolute Path vs Relative Path in Linux/Unix
An absolute path is defined as the specifying the location of a file or directory from the root directory(/). In other words we...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found