Comments (2)
Adding this as a comment, as to not make the description too long.
I looked into the JaCoCo code coverage functions and believe I found the root cause of the issue in the enableCodeCoverage(
) function in the jacoco.ant.cc.enabler class.
In enableCodeCoverage()
, the global sourceDirs
variable is set to the value of ccProps["sourcedirectories"]
, which contains the value of the INPUT_SRCDIRECTORIES
environment variable passed from the Ant task.
From there, addCodeCoverageData()
is called, which then calls getSourceFilter()
.
protected getSourceFilter(): string {
let srcData = "";
let srcDirs = this.sourceDirs === null ? "" : this.sourceDirs;
srcDirs.split(",").forEach(dir => {
if (!util.isNullOrWhitespace(dir)) {
srcData += `<fileset dir="${dir}"/>`;
srcData += os.EOL;
}
});
if (util.isNullOrWhitespace(srcData)) {
srcData = `<fileset dir="."/>`;
srcData += os.EOL;
}
return srcData;
}
If the codeCoverageSourceDirectories
YAML input is not given a value, then INPUT_SRCDIRECTORIES
is undefined, meaning the value of global var sourceDirs
is set to undefined. Thus, calling split() on an undefined value generates the error and causes JaCoCo code coverage to fail on the pipeline.
This is a simple fix. The issue is the azure-pipelines-tasks-coverage-tools repo (which contains those JaCoCo code coverage functions) is archived, so I can't open any new issues or create any PRs. I'm opening the bug here, hoping that a contributor with access to the private repo will see it.
A minimum recreation of a possible fix would look something like:
let srcData = "";
let srcDirs = sourceDirs === null ? "" : sourceDirs;
if (srcDirs) {
srcDirs.split(",").forEach(dir => {
// continues if srcDirs != undefined
});
}
else {
// continues if srcDirs == undefined
}
After a brief search, this error might also occur for JaCoCo code coverage on Maven and Gradle tasks.
@vmapetr I see you were a contributor on the azure-pipelines-tasks-coverage-tools repo. Any chance this could help or be used at all?
from azure-pipelines-tasks.
Closing this as I see the azure-pipelines-tasks-coverage-tools
repo has been moved to azure-pipelines-tasks-common-packages, so I'll open a new issue ticket there
from azure-pipelines-tasks.
Related Issues (20)
- [REGRESSION]: HOT 2
- [BUG]: AzurePowershell@5 Decorator tasks fails to retrieve OIDC token on stage reruns
- [BUG]: Warning: Use tokens from the TokenRequest ...
- [REGRESSION]: AzureFileCopy@6 no longer works with "Workload identity federation" service connection HOT 16
- [BUG]: AzureCLI@2 returns ##[error]Unhandled: toolExecutionError.indexOf is not a function when scriptPath is missing HOT 2
- [enhancement]: Disable Legacy TLS on IIS web site
- [BUG]: MSBuild task fails after msbuild.exe exits with exit code '' (empty string)
- [BUG]: Docker@2 arguments (VSS_NUGET_EXTERNAL_FEED_ENDPOINTS) without quotes
- [BUG]: `AzureWebAppContainer@1` should error if App Service Resource Kind is not a container (such as "app,linux") HOT 1
- [Question]: My self-hosted agent cannot find gradlew HOT 4
- [Question]: How can I dynamically populate the options of a picklist HOT 3
- Cannot set unique testRunTitle when using dotnet test for multiple projects HOT 1
- [BUG]: Azure Functions Deploy task failing repeatedly HOT 6
- [Question]: no results shown on SonarQube
- [BUG]: DownloadPipelineArtifact v2: itemPattern doesn't work for multiple patterns HOT 2
- [REGRESSION]: PublishCodeCoverageResults V2 doesn't publish with network errors HOT 3
- [REGRESSION]: No attachment pushed to results HOT 1
- [Question]: Pipeline don't use correct version HOT 3
- [BUG]: Using IISWebAppManagementOnMachineGroup on Client OS fails to install IIS
- [BUG]: (node:1631) [DEP0005] DeprecationWarning:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-pipelines-tasks.