microsoft / azure-pipelines-tasks

Tasks for Azure Pipelines
https://aka.ms/tfbuild
MIT License
3.51k stars 2.62k forks source link

[BUG]: build.gradle.kts not recognized when enabling code coverage #19937

Open erosb opened 6 months ago

erosb commented 6 months ago

New issue checklist

Task name

Gradle

Task version

3

Issue Description

My gradle build file is a kotlin file, build.gradle.kts , and not build.gradle. The .kts file isn't recognized when the task wants to enable code coverage. See the attached log output: it complains about missing build.gradle file and doesn't try to look for build.gradle.kts. At the first glance, it happens because the filename is hardcoded here: https://github.com/microsoft/azure-pipelines-tasks/blob/master/Tasks/GradleV3/Modules/code-coverage.ts#L19

Environment type (Please select at least one enviroment where you face this issue)

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

ubuntu-latest

Relevant log output

##[warning]Unable to append code coverage data: Error: File or folder doesn't exist: /home/vsts/work/1/s/build.gradle
    at Object.appendTextToFileSync (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/node_modules/azure-pipelines-tasks-codecoverage-tools/utilities.js:80:15)
    at JacocoGradleCodeCoverageEnabler.enableCodeCoverage (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/node_modules/azure-pipelines-tasks-codecoverage-tools/jacoco/jacoco.gradle.ccenabler.js:37:18)
    at Object.enableCodeCoverageAsync (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/Modules/code-coverage.js:34:32)
    at /home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/gradletask.js:92:43
    at Generator.next (<anonymous>)
    at /home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/gradletask.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/gradletask.js:4:12)
    at run (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/gradletask.js:27:12)
    at Object.<anonymous> (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/gradletask.js:154:1)
##[warning]Failed to enable code coverage: Unable to append code coverage data: Error: File or folder doesn't exist: /home/vsts/work/1/s/build.gradle
    at Object.appendTextToFileSync (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/node_modules/azure-pipelines-tasks-codecoverage-tools/utilities.js:80:15)
    at JacocoGradleCodeCoverageEnabler.enableCodeCoverage (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/node_modules/azure-pipelines-tasks-codecoverage-tools/jacoco/jacoco.gradle.ccenabler.js:37:18)
    at Object.enableCodeCoverageAsync (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/Modules/code-coverage.js:34:32)
    at /home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/gradletask.js:92:43
    at Generator.next (<anonymous>)
    at /home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/gradletask.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/gradletask.js:4:12)
    at run (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/gradletask.js:27:12)
    at Object.<anonymous> (/home/vsts/work/_tasks/Gradle_8d8eebd8-2b94-4c97-85af-839254cc6da4/3.238.0/gradletask.js:154:1)
/home/vsts/work/1/s/gradlew clean build jacocoTestReport

Full task logs with system.debug enabled

No response

Repro steps

No response

kirill-ivlev commented 6 months ago

Hi @erosb, thanks for reporting! We are working on more prioritized issues at the moment, but will get back to this one soon.

github-actions[bot] commented 3 days ago

This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days

erosb commented 2 days ago

Hello, can this be prioritized any time soon?