Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 of 7 tasks
erosb opened this issue May 31, 2024 · 5 comments
Open
4 of 7 tasks

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

erosb opened this issue May 31, 2024 · 5 comments

Comments

@erosb
Copy link

erosb commented May 31, 2024

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)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

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
Copy link
Contributor

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

Copy link

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

@github-actions github-actions bot added the stale label Nov 27, 2024
@erosb
Copy link
Author

erosb commented Nov 28, 2024

Hello, can this be prioritized any time soon?

@github-actions github-actions bot removed the stale label Nov 28, 2024
@JG9A
Copy link

JG9A commented Dec 19, 2024

This is the same issues as here that was closed...

#15814

@JG9A
Copy link

JG9A commented Dec 19, 2024

It is only the additional of the coverage keys in the tasks inputs that are causing the error, it looks like a really simple fix can we have at least an estimation date for the solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants