gaelcolas / Sampler

Module template with build pipeline and examples, including DSC elements.
MIT License
172 stars 42 forks source link

CodeCoverage export - Improve error message #297

Open gaelcolas opened 3 years ago

gaelcolas commented 3 years ago

When you have a configuration error and the merge may not be finding the files, be more explicit about Where the files are expected.

ERROR: Found 0 code coverage file. Need at least two files to merge.
At /home/vsts/work/1/s/output/RequiredModules/Sampler/0.111.3/tasks/JaCoCo.coverage.build.ps1:157 char:13
+             throw "Found $($codecovFiles.Count) code coverage file. N …
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
At /home/vsts/work/1/s/output/RequiredModules/Sampler/0.111.3/tasks/JaCoCo.coverage.build.ps1:57 char:1
+ task Merge_CodeCoverage_Files {

Also, in the task "header" showing variables used for the run, be more descriptive about what is used where (Code Coverage Output File and Code Coverage Merge Output File and Code Coverage File Pattern...

    Project Name               = 'MyModule'
    Source Path                = '/home/vsts/work/1/s/source'
    Output Directory           = '/home/vsts/work/1/s/output'
    Built Module Subdirectory  = '/home/vsts/work/1/s/output/'
    Module Manifest Path (src) = '/home/vsts/work/1/s/source/MyModule.psd1'
    Versioned Output Directory = 'True'
    Built Module Manifest      = '/home/vsts/work/1/s/output/MyModule/3.3.0/MyModule.psd1'
    Built Module Base          = '/home/vsts/work/1/s/output/MyModule/3.3.0'
    Module Version             = '3.3.0-micy'
    Module Version Folder      = '3.3.0'
    Pre-release Tag            = 'micy'
    Built Module Root Script   = '/home/vsts/work/1/s/output/MyModule/3.3.0/MyModule.psm1'
    Release Notes path         = '/home/vsts/work/1/s/output/ReleaseNotes.md'

    Pester Output Folder            = '/home/vsts/work/1/s/output/testResults'
    Code Coverage Threshold         = '0.1'
    Code Coverage Output File       = /home/vsts/work/1/s/output/testResults/JaCoCo_coverage.xml
    Code Coverage Merge Output File = /home/vsts/work/1/s/output/testResults/CodeCov_Merged.xml
    Code Coverage File Pattern      = Codecov*.xml
    Merging Code Coverage Files     = ''