aGallea / tests-coverage-report

Github action for tests coverage report
MIT License
24 stars 0 forks source link

Error when setting junit-path to a folder #33

Open StefanLobbenmeierObjego opened 6 months ago

StefanLobbenmeierObjego commented 6 months ago

In the docs it says that junit-path can be a file or folder, so I tried giving the whole junit folder as the argument, but it fails

Error: failed to read file: build/test-results/test. error: EISDIR: illegal operation on a directory, read
Error: EISDIR: illegal operation on a directory, read

This is the full output:

Run aGallea/tests-coverage-report@v1
  with:
    min-coverage-percentage: 90
    fail-under-coverage-percentage: true
    diffcover-ref: jacoco
    junit-path: build/test-results/test
    jacoco-path: build/reports/jacoco/test/jacocoTestReport.xml
    github-token: ***
    title: Tests Report
    cobertura-path: ./coverage/cobertura-coverage.xml
    clover-path: ./coverage/clover.xml
    lcov-path: ./coverage/lcov.info
    show-junit: true
    show-diffcover: true
    show-failures-info: false
    override-comment: true
  env:
    MAVEN_SERVER_PASSWORD: ***
    JAVA_HOME: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/[2](https://github.com/objego/objego-calculation-management-service/actions/runs/7811698884/job/21312523870#step:5:2)1.0.2-1[3](https://github.com/objego/objego-calculation-management-service/actions/runs/7811698884/job/21312523870#step:5:3)/x6[4](https://github.com/objego/objego-calculation-management-service/actions/runs/7811698884/job/21312523870#step:5:4)
    JAVA_HOME_21_X[6](https://github.com/objego/objego-calculation-management-service/actions/runs/7811698884/job/21312523870#step:5:6)4: /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/21.0.2-[13](https://github.com/objego/objego-calculation-management-service/actions/runs/7811698884/job/21312523870#step:5:13)/x64
    GRADLE_BUILD_ACTION_SETUP_COMPLETED: true
    GRADLE_BUILD_ACTION_CACHE_RESTORED: true

Error: failed to read file: build/test-results/test. error: EISDIR: illegal operation on a directory, read
Error: EISDIR: illegal operation on a directory, read
success

This is the relevant workflow:

    inputs:
      JUNIT_RESULT_FILE_PATH:
        type: string
        default: 'build/test-results/test'
      JACOCO_RESULT_FILE_PATH:
        type: string
        default: 'build/reports/jacoco/test/jacocoTestReport.xml'

...

      - name: Coverage Report
        if: always()
        uses: aGallea/tests-coverage-report@v1
        with:
          min-coverage-percentage: '90'
          fail-under-coverage-percentage: 'true'
          diffcover-ref: jacoco
          junit-path: ${{ inputs.JUNIT_RESULT_FILE_PATH }}
          jacoco-path: ${{ inputs.JACOCO_RESULT_FILE_PATH }}
StefanLobbenmeierObjego commented 6 months ago

Debug logs:

##[debug]Evaluating condition for step: 'Coverage Report'
##[debug]Evaluating: always()
##[debug]Evaluating always:
##[debug]=> true
##[debug]Result: true
##[debug]Starting: Coverage Report
##[debug]Loading inputs
##[debug]Evaluating: inputs.JUNIT_RESULT_FILE_PATH
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'JUNIT_RESULT_FILE_PATH'
##[debug]=> 'build/test-results/test'
##[debug]Result: 'build/test-results/test'
##[debug]Evaluating: inputs.JACOCO_RESULT_FILE_PATH
##[debug]Evaluating Index:
##[debug]..Evaluating inputs:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'JACOCO_RESULT_FILE_PATH'
##[debug]=> 'build/reports/jacoco/test/jacocoTestReport.xml'
##[debug]Result: 'build/reports/jacoco/test/jacocoTestReport.xml'
##[debug]Evaluating: github.token
##[debug]Evaluating Index:
##[debug]..Evaluating github:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'token'
##[debug]=> '***'
##[debug]Result: '***'
##[debug]Loading env
Run aGallea/tests-coverage-report@v1
Error: failed to read file: build/test-results/test. error: EISDIR: illegal operation on a directory, read
Error: EISDIR: illegal operation on a directory, read
success
##[debug]Node Action run completed with exit code 1
##[debug]Finishing: Coverage Report