gaelcolas / Sampler

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

Support Pester 5 coverage and more options for test pipeline #283

Closed johlju closed 3 years ago

johlju commented 3 years ago

Pull Request

This PR continues the work of @NicolasBn.

Pull Request (PR) description

Added

Changed

Task list


This change is Reviewable

johlju commented 3 years ago

@gaelcolas this works perfectly in FileSystemDsc with both the deprecated build configuration and the new build configuration. See output from two runs in the gist https://gist.github.com/johlju/056ae24843d15b1398f9311301993906.

The new build configuration is outputted in the test run if the repo hasn't opt-in to it yet, since we might not be able to change the templates for a while. See output above.

New build configuration gives more options and support all properties in the PesterConfiguration object.

Pester:
  # Pester Advanced configuration.
  # If a key is not set it will be using Sampler pipeline default value.
  Configuration:
    Run:
      Path:
        - tests/Unit
      ExcludePath:
    Filter:
      Tag:
      ExcludeTag:
    Output:
      Verbosity:
    CodeCoverage:
      Path:
      OutputFormat:
      CoveragePercentTarget: 85
      OutputPath: JaCoCo_coverage.xml
      OutputEncoding: ascii
      ExcludeTests:
    TestResult:
      OutputFormat: NUnitXML
      OutputPath:
      OutputEncoding:
      TestSuiteName:
  # Sampler pipeline configuration
  ExcludeFromCodeCoverage:
    - Modules/DscResource.Common
codecov[bot] commented 3 years ago

Codecov Report

Merging #283 (84fec55) into main (774e6ef) will decrease coverage by 2%. The diff coverage is 0%.

Impacted file tree graph

@@         Coverage Diff          @@
##           main   #283    +/-   ##
====================================
- Coverage    29%    26%    -3%     
====================================
  Files        38     38            
  Lines      1744   1894   +150     
====================================
  Hits        506    506            
- Misses     1238   1388   +150     
Impacted Files Coverage Δ
.build/tasks/Invoke-Pester.pester.build.ps1 0% <0%> (ø)