Skip to content

Fails to find files with mixed backward slashes in path #127

@atruskie

Description

@atruskie

With these options set:

      - name: Publish Test Results
        uses: dorny/test-reporter@v1.4.3
        with:
          name: AP Test Results win-x64 Release
          path: "${{runner.temp}}/Acoustics.Test_Results/**/*.trx"
          reporter: "dotnet-trx"

The action fails to find any files:

Run dorny/test-reporter@v1.4.3
  with:
    name: AP Test Results win-x64 Release
    path: D:\a\_temp/Acoustics.Test_Results/**/*.trx
    reporter: dotnet-trx
    list-suites: all
    list-tests: all
    max-annotations: 10
    fail-on-error: true
  env: {}
Check runs will be created with SHA=784cf60c324629adef252f2338961c097772c804
::group::Listing all files tracked by git
Listing all files tracked by git
Found 1320 files tracked by GitHub
Using test report parser 'dotnet-trx'
::group::Creating test report AP Test Results win-x64 Release
Creating test report AP Test Results win-x64 Release
  Warning: No file matches path D:\a\_temp/Acoustics.Test_Results/**/*.trx
  ::endgroup::
::set-output name=conclusion::success
##[debug]='success'
::set-output name=passed::0
##[debug]='0'
::set-output name=failed::0
##[debug]='0'
::set-output name=skipped::0
##[debug]='0'
::set-output name=time::0
##[debug]='0'
Error: No test report files were found
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Publish Test Results

The issues is that the GitHub runner.temp context variable contains \ slashes in the path.

Creating a safe version of runner.temp in a previous workflow step allows me to bypass the problem:

      - name: Calculate variables
        id: calc_vars
        shell: pwsh
        run: |
          $safe_temp = "${{ runner.temp }}" -replace "\\","/"
          echo "::set-output name=SAFE_TEMP::$safe_temp"

With that, this will work:

      - name: Publish Test Results
        uses: dorny/test-reporter@v1.4.3
        with:
          name: AP Test Results win-x64 Release
          path: "${{  steps.calc_vars.outputs.SAFE_TEMP }}/Acoustics.Test_Results/**/*.trx"
          reporter: "dotnet-trx"

I think the path just needs to be normalized before you pass it to the glob function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions