Search code examples
ccnet-config

CCNet: htmlReportPlugin - does not show content for failed builds ("Unable to find file")


I have recently reconfigured my CCNet-configuration to use the "htmlReportPlugin". However, when the build fails, I cannot view the html-output in the dashboard. Only the error message "Unable to find file" is shown.

This is exact opposite functionally from what I want: when a build fails, I need to be able to inspect the html-output, and when a build does not fail, I rather do not care about the html-output. Has anyone experienced anything similar?


Solution

  • For success and fail build "htmlReportPlugin" uses different logic for place of html file on disk.

    Better solution to use 'merge' publisher.

    All bellow actual for current version (1.8) and may be changed in future.

    If you don't have ability to use 'merge' publisher you should implement logic to place your files in correct place. First, you should member that "htmlReportPlugin" work only for subdirectory of $CCNetArtifactDirectory.

    Log file name have following structure "{0}{1}Lbuild.{2}.xml", where

    • {0} - hardcoded prefix "log"
    • {1} - build date formated using yyyyMMddHHmmss
    • {2} - build label

    "htmlReportPlugin" search pointed file in following path:

    'build_folder'\'html_file_path'
    

    'html_file_path' you point in dashboard.config

    'build_folder' for success - 'label'. Same as {2} - parameter in log file name.

    'build_folder' for fail- 'date'. Same as {1} - parameter in log file name.

    Example: dasboard.config

    Your build success, ccnet generate log with name:

    log20170301160900Lbuild.test1.xml

    • {1} - (aka 'date') - 20170301160900
    • {2} - (aka 'label') - test1

    plugin try to find file by path:

    test1\UnitTestResults\report.html
    

    Your build fail, ccnet generate log with name: log20170301160900.xml

    • {1} - (aka 'date') - 20170301160900

    plugin try to find file by path:

    20170301160900\UnitTestResults\report.html