puppetlabs_spec_helper icon indicating copy to clipboard operation
puppetlabs_spec_helper copied to clipboard

task to check if puppet resources have a spec described

Open h0tw1r3 opened this issue 1 year ago • 4 comments

Anyone interested in this? Request for comment / improvements / toss it out?

Example:

$ pdk bundle exec rake spec_described[90]
pdk (INFO): Using Ruby 3.2.2
pdk (INFO): Using Puppet 8.4.0
===> rake: spec_described
Spec described coverage: 92.9%
  * 4 defines: 100.0%
  * 21 classes: 95.2%
    missing:
    - puppetdb::something
    unknown:
    - something in spec/classes/whoknows_spec.rb
  * 1 type_alias: 0.0%
    missing:
    - Puppetdb::Ttl
  * 2 functions: 100.0%

h0tw1r3 avatar Feb 15 '24 07:02 h0tw1r3

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (e3b7546) 41.71% compared to head (d49de85) 40.85%.

Files Patch % Lines
lib/puppetlabs_spec_helper/rake_tasks.rb 16.66% 20 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #439      +/-   ##
==========================================
- Coverage   41.71%   40.85%   -0.86%     
==========================================
  Files          10       10              
  Lines         676      700      +24     
==========================================
+ Hits          282      286       +4     
- Misses        394      414      +20     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 15 '24 07:02 codecov[bot]

Overall puppet-strings can already parse and extract the various types, which is probably better than using regular expressions. Any thoughts on using puppet-strings to generate a list of all resources?

Thanks for the feedback. I'll check it out, cheers!

h0tw1r3 avatar Feb 16 '24 13:02 h0tw1r3

Hi @h0tw1r3. We all like this on devx, so kicked off a discussion https://github.com/puppetlabs/puppetlabs_spec_helper/discussions/442

gavindidrichsen avatar Mar 08 '24 11:03 gavindidrichsen

I like this and share the same opinion as @ekohl . I think this would be a helpful addition to puppetlabs_spec_helper.

bastelfreak avatar Mar 08 '24 11:03 bastelfreak