The coverageBrowserOutputDir
isn’t commented out or anything, right? Also, that cfparam only fires if the URl var doesn’t already exist. Is it possible it’s been set explicitly to an empty string somewhere else?
Add a dump/abort into the processCodeBrowser()
function inside the testbox/system/coverage/CoverageService.cfc
.
// Only generate browser if there's a generation path specified
if ( len( opts.browser.outputDir ) ) {
var codeBrowser = new browser.CodeBrowser( opts.coverageTresholds );
codeBrowser.generateBrowser( qryCoverageData, stats, opts.browser.outputDir );
return opts.browser.outputDir;
}
If opts.browser.outputDir
is an empty string, you can work backwards to figure out why. The default options are configured in the setDefaultOptions()
method in the same CFC.
PLEASE NOTE: whatever runner you are using MUST PASS the coverage options explicitly to the testbox object. If you have built a custom runner that manually instantiates TestBox and doesn’t rely on the core testbox/system/runners/HTMLRunner.cfm
, then you will need to manually pass those options.
testbox = new testbox.system.TestBox(
labels = url.labels,
excludes = url.excludes,
options = {
coverage : {
enabled : url.coverageEnabled,
pathToCapture : url.coveragePathToCapture,
whitelist : url.coverageWhitelist,
blacklist : url.coverageBlacklist,
sonarQube : {
XMLOutputPath : url.coverageSonarQubeXMLOutputPath
},
browser : {
outputDir : url.coverageBrowserOutputDir
}
}
}
);