Puppet coding/Testing

From Wikitech
Jump to: navigation, search

Puppet Compiler Jenkins Job

You can get puppet-compiler to generate a catalog for you.

Puppet CI

  • Lints
    • [done] Puppet-typos
    • [done] Puppet-validate
    • [ongoing] Misc language-specific stuff, e.g. pep8
    • Puppet-lint, someday?
      • Easy to implement, but can probably never actually block.
  • Unit Tests
  • Compile Tests
    • [ON HOLD] --noop tests within modules
      • Mostly done
      • Insecure
    • Run compiles for expressly-written test manifests
      • Probably safe to run on gallium if we use a fake node with ready-made facts
    • Enumerate node definitions, run compile test on each (?)
      • Do this later or never
      • Need way to inject/mock up facts
  • Integration Tests
    • Build VMs from short list of test node definitions
    • Can test successfull puppet runs, but not really test that the servers work
      • This might be easy once we figure out vagrant/labs integration for Compile tests.
    • Build VMs from every existing test node definition (?)
      • This will be insanely expensive, probably can't happen per patch.

Andrew idea: create an empty VM, apply a bunch of roles and make sure everything works fine after a single puppet run.


Isolation requirements: - VM must not have access network - VM must have a predefined time to live