How to speed up the doll module test development cycle?

I am looking for some recommendations to improve my productivity when writing new puppet modules. My workflow is as follows:

  • vagrant up
  • Make changes / corrections
  • brokerage
  • Find Errors / Errors, GOTO 2

After doing all the errors / errors, I do:

  • roving destroy
  • vagrant up
  • Make sure everything works.
  • commit my changes

It's too slow ... How can I make this workflow faster?
I refuse to write puppet tests. What are my other options?

+8
vagrant puppet
source share
2 answers
  • cache your apt / yum repository on your host with the vagrant-cachier plugin
  • use the -evaltrace profile to find where you are wasting your time when fully configured
  • use basic package distribution :
    • for example: rvm install ruby-2.0.0 vs a pre-compiled ruby package created using fpm
    • avoid the "wget ​​the internet and compile" approach
    • this is likely to make your provision more reproducible and faster.
  • not code modules
    • try reusing some of forge / github / ...
    • Please note that this may be against my previous advice.
  • if this is an option, upgrade the puppet / ruby ​​version
  • iterate and prevent full customization
    • vagrant up
    • brokerage
    • change manifest / modules
    • brokerage
    • change manifest / modules
    • brokerage
    • roving destroy
    • vagrant up
    • running server-spec
  • minimize typed command
    • start command when changing your files
    • you can configure guard to run lint / test / spec / provision while saving
    • you can also send notifications from the guest machine to vagrant-notify
  • test without actual provision in the vagrant
  • check your preparation instead of manual verification
    • stop vagrant ssh - check whether the service is running or the configuration is set to
    • running server-spec
    • look beaker
  • the delegate runs the test on your preferred ci server (jenkins, travis-ci, ...)
  • if you're a little puzzled by a puppet ... take a look ansible
    • easy to configure (no ruby ​​to install / compile)
    • you can select the part of the material that you want to run with tags
    • you can share textbooks through synchronized folders and run them locally in a wandering field (without starting librairian-puppet).

update: after discussing with @garethr, check out his latest defense.

+14
source share

I recommend using a puppet language . It comes with a command line tool ( puppetresources ) that can calculate directories on your computer and let you examine them. It has several useful features that cannot be found in Puppet:

  • It is very fast (6 times faster in one directory, in many directories about 50 times).
  • It keeps track of where each resource has been defined, and what the “class stack” is at this point, which is very convenient when you have duplicate resources.
  • It automatically checks that the files you link to are
  • It is more strict than Puppet (for example, it splits undefined variables)
  • It allows you to print to the standard output the contents of any file, which is useful for developing complex templates

The only caveat is that it only works with “modern” puppet practices. For example, require not executed. It also works only with Linux.

+2
source share

All Articles