puppetconf 2016: the future of testing puppet code – gareth rushgrove, puppet
TRANSCRIPT
![Page 1: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/1.jpg)
(without introducing more risk)
The Future of Testing Puppet Code
PuppetGareth Rushgrove
Who, What, Why, How
![Page 2: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/2.jpg)
(without introducing more risk)
@garethr
![Page 3: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/3.jpg)
(without introducing more risk)
Gareth Rushgrove
![Page 4: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/4.jpg)
(without introducing more risk)This TalkWhat we’ll cover
![Page 5: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/5.jpg)
- Why test Puppet anyway- Existing Puppet testing tools- Different users and usecases- Future challenges
Gareth Rushgrove
![Page 6: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/6.jpg)
Mainly a talk about problems,rather than solutions
Gareth Rushgrove
![Page 7: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/7.jpg)
Not a talk about how to testPuppet code. Lot of existing content on that subject
Gareth Rushgrove
![Page 8: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/8.jpg)
(without introducing more risk)
Gareth Rushgrove
PuppetConf 2014
![Page 9: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/9.jpg)
(without introducing more risk)
Gareth Rushgrove
Survey of 300 Puppet users
![Page 10: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/10.jpg)
(without introducing more risk)
Gareth Rushgrove
![Page 11: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/11.jpg)
(without introducing more risk)Why Test Puppet
And a little history
![Page 12: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/12.jpg)
Gareth Rushgrove
![Page 13: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/13.jpg)
- You have lots of Puppet code- You’re targeting a wide range of OS’s- The Puppet language has more features
Gareth Rushgrove
![Page 14: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/14.jpg)
(without introducing more risk)
Gareth Rushgrove
Lots of codeBut how much is lots
![Page 15: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/15.jpg)
Note that this just represents public code on GitHub. Lots of private Puppet code out there too
Gareth Rushgrove
![Page 16: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/16.jpg)
(without introducing more risk)
Gareth Rushgrove
How many .pp files on GitHub?
SELECT COUNT(*) FROM [puppet.puppet_files]
-- 489725
![Page 17: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/17.jpg)
(without introducing more risk)
Gareth Rushgrove
How many lines of Puppet code?
SELECT COUNT(line) total_lines FROM ( SELECT SPLIT(content, '\n') AS line FROM [puppet.puppet_content] )
-- 6697099
![Page 18: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/18.jpg)
(without introducing more risk)
Gareth Rushgrove
How big are .pp files?
SELECT QUANTILES(total_lines, 10) AS q FROM ( SELECT COUNT(line) total_lines FROM ( SELECT SPLIT(content, '\n') AS line, id FROM [puppet.puppet_content] ) GROUP BY id )
![Page 19: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/19.jpg)
50% of Puppet files are 20 lines or less. 90% of Puppet files are 100 lines or less
Gareth Rushgrove
![Page 20: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/20.jpg)
The largest Puppet file public on GitHub has 25,238 lines
Gareth Rushgrove
![Page 21: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/21.jpg)
(without introducing more risk)
Gareth Rushgrove
Mixed environmentsSo many platforms
![Page 22: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/22.jpg)
Gareth Rushgrove
![Page 23: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/23.jpg)
A third of respondents run more than one OS on there development machine
Gareth Rushgrove
![Page 24: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/24.jpg)
Gareth Rushgrove
![Page 25: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/25.jpg)
60% of respondents run more than one OS in production
Gareth Rushgrove
![Page 26: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/26.jpg)
(without introducing more risk)
Gareth Rushgrove
The Puppet language
Types, lambdas, iterators, functions
![Page 27: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/27.jpg)
Gareth Rushgrove
![Page 28: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/28.jpg)
(without introducing more risk)Existing Tools
Providing some context
![Page 29: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/29.jpg)
Gareth Rushgrove
![Page 30: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/30.jpg)
(without introducing more risk)Core tools
Common starting points
Gareth Rushgrove
![Page 31: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/31.jpg)
(without introducing more risk)
Gareth Rushgrove
puppet-lint
![Page 32: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/32.jpg)
(without introducing more risk)
Gareth Rushgrove
Style conformance
$ puppet-lint /etc/puppet/modules foo/manifests/bar.pp - ERROR: trailing whitespace found on line 1 apache/manifests/server.pp - WARNING: variable not enclosed in {} on line 56 ...
![Page 33: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/33.jpg)
(without introducing more risk)
Gareth Rushgrove
rspec-puppet
![Page 34: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/34.jpg)
(without introducing more risk)
Gareth Rushgrove
Unit tests for Puppet
it { is_expected.to compile } it { is_expected.to contain_class('db') } it do is_expected.to contain_package('mysql-server') .with_ensure('present') end it { is_expected.to have_exec_resource_count(0) }
![Page 35: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/35.jpg)
(without introducing more risk)
Gareth Rushgrove
puppet-syntax
![Page 36: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/36.jpg)
(without introducing more risk)
Gareth Rushgrove
Popular Puppet gemsSELECT package, COUNT(*) count FROM ( SELECT REGEXP_EXTRACT(line, r'gem [\'|"](.*)[\'|"]') package, id FROM ( SELECT SPLIT(content, '\n') line, id FROM [puppet.gemfile_contents] WHERE content CONTAINS 'gem' ) GROUP BY package, id ) GROUP BY 1 ORDER BY count DESC LIMIT 30;
![Page 37: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/37.jpg)
(without introducing more risk)
Gareth Rushgrove
Popular gem results
puppetlabs_spec_helper 1157 puppet 1142 rake 1135 puppet-lint 768 beaker-rspec 610 rspec-puppet 576 metadata-json-lint 566 beaker 440 puppet-blacksmith 425 serverspec 359
![Page 38: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/38.jpg)
(without introducing more risk)
Gareth Rushgrove
puppetlabs_spec_helper
![Page 39: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/39.jpg)
(without introducing more risk)
Gareth Rushgrove
Advanced toolsNext steps
![Page 40: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/40.jpg)
(without introducing more risk)
Gareth Rushgrove
beaker-rspec
![Page 41: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/41.jpg)
(without introducing more risk)
Gareth Rushgrove
Serverspec
![Page 42: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/42.jpg)
(without introducing more risk)
Gareth Rushgrove
rubocop
![Page 43: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/43.jpg)
(without introducing more risk)
Gareth Rushgrove
Other toolsAlternative approaches
![Page 44: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/44.jpg)
(without introducing more risk)
Gareth Rushgrove
puppet-catalog-test
![Page 45: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/45.jpg)
(without introducing more risk)
Gareth Rushgrove
Test catalogue compilation
$ puppet-catalog-test -m modules -M site.pp [INFO] Using puppet 3.0.2 [PASSED] foo (compile time: 0.168182 seconds) [PASSED] default (compile time: 0.003451 seconds)
---------------------------------------- Compiled 2 catalogs in 0.1717 seconds (avg: 0.0858 seconds)
![Page 46: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/46.jpg)
(without introducing more risk)
Gareth Rushgrove
Test Kitchen
![Page 47: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/47.jpg)
(without introducing more risk)Different Users
And different usecases
![Page 48: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/48.jpg)
Gareth Rushgrove
![Page 49: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/49.jpg)
Half of respondents regularly writetests for Puppet code
Gareth Rushgrove
![Page 50: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/50.jpg)
A quarter of respondents never write tests for Puppet code
Gareth Rushgrove
![Page 51: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/51.jpg)
The problem with a tool-centricworld view
Gareth Rushgrove
![Page 52: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/52.jpg)
Understanding user needs meansstarting with users
Gareth Rushgrove
![Page 53: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/53.jpg)
Gareth Rushgrove
- The Vox Pupuli folks- Lots of Puppet employees- You in-house Puppet expert- Custom functions
The module authors
![Page 54: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/54.jpg)
The regular Puppet users
Gareth Rushgrove
- Roles and profiles- Using Puppet weekly or more- PuppetDB, Puppet Server- Custom facts
![Page 55: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/55.jpg)
The occasional Puppet user
Gareth Rushgrove
- Using Puppet as needed- Basic Puppet code- Hieradata
![Page 56: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/56.jpg)
Today different types of Puppet users have a very different experience
Gareth Rushgrove
![Page 57: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/57.jpg)
Gareth Rushgrove
![Page 58: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/58.jpg)
For those with no Ruby experience the average was 2 out of 5
Gareth Rushgrove
![Page 59: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/59.jpg)
For those with a little Ruby experience the average was still only 2.5 out of 5
Gareth Rushgrove
![Page 60: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/60.jpg)
Of the people who love the testing experience 33% are self-described power users of both Puppet and Ruby
Gareth Rushgrove
![Page 61: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/61.jpg)
Gareth Rushgrove
![Page 62: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/62.jpg)
But more than 50% of respondents have little or no Ruby experience
Gareth Rushgrove
![Page 63: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/63.jpg)
(without introducing more risk)Challenges
What we need for the future
![Page 64: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/64.jpg)
(without introducing more risk)
Gareth Rushgrove
Improved getting started experience
Helping a new generation of users
![Page 65: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/65.jpg)
- Getting started testing documentation- Single entry point for users- Opinionated workflow
Gareth Rushgrove
![Page 66: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/66.jpg)
(without introducing more risk)
Gareth Rushgrove
Adopting acceptance testing
Still too hard
![Page 67: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/67.jpg)
27 of the 67 Serverspec users are not using either Beaker or Test Kitchen.
Gareth Rushgrove
![Page 68: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/68.jpg)
Only 5 of the Beaker (without rspec) users are not also using beaker-rspec
Gareth Rushgrove
![Page 69: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/69.jpg)
3 of the Test Kitchen users are also using some flavour of Beaker
Gareth Rushgrove
![Page 70: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/70.jpg)
So only 26% to 35% of respondents are using an acceptance testing tool with there Puppet code
Gareth Rushgrove
![Page 71: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/71.jpg)
(without introducing more risk)
Gareth Rushgrove
Experience mattersConsistence interfaces
![Page 72: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/72.jpg)
(without introducing more risk)
Gareth Rushgrove
Inconsistencies
$ puppet-lint vs rake lint vs rake validate $ rake syntax vs puppet parser validate $ rspec vs rake spec $ BEAKER_destroy=no rake beaker vs beaker
![Page 73: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/73.jpg)
We have a language style guide. What about other Puppet user interfaces?
Gareth Rushgrove
![Page 74: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/74.jpg)
(without introducing more risk)
Gareth Rushgrove
Ruby heritageRuby as a development environment
![Page 75: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/75.jpg)
60% of respondents described themselves as Puppet power users
Gareth Rushgrove
![Page 76: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/76.jpg)
Only 12% of respondents described themselves as Ruby power users. A third of those work for Puppet!
Gareth Rushgrove
![Page 77: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/77.jpg)
- More help with using Ruby for testing?- Support for testing in other languages?- Native Puppet support for testing?- Containerised testing abstraction?
Gareth Rushgrove
![Page 78: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/78.jpg)
(without introducing more risk)
Gareth Rushgrove
jordan/spec
![Page 79: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/79.jpg)
(without introducing more risk)
Gareth Rushgrove
Test Puppet with Puppet
file { '/tmp/test': ensure => present, content => 'The file content', }
assertion { 'that the file has the correct contents': subject => File['/tmp/test'], attribute => 'content', expectation => 'The file content', }
![Page 80: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/80.jpg)
(without introducing more risk)Conclusions
Where to go from here
![Page 81: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/81.jpg)
Thanks to the community we have a collection of powerful testing tools in the Puppet ecosystem
Gareth Rushgrove
![Page 82: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/82.jpg)
But we don’t have consistent user interfaces or the opinionated workflows useful for beginners
Gareth Rushgrove
![Page 83: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/83.jpg)
Testing shouldn’t just be apower user feature
Gareth Rushgrove
![Page 84: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/84.jpg)
As a community we should talkabout design more often
Gareth Rushgrove
![Page 85: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/85.jpg)
(without introducing more risk)
Gareth Rushgrove
https://goo.gl/forms/nchOp5hYdLLgmJ8z1
![Page 86: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/86.jpg)
Gareth Rushgrove
![Page 87: PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet](https://reader033.vdocuments.site/reader033/viewer/2022052606/587495601a28abc62f8ba8a1/html5/thumbnails/87.jpg)
(without introducing more risk)Questions?And thanks for listening