You are browsing a read-only backup copy of Wikitech. The live site can be found at

Puppet coding/Testing

From Wikitech-static
< Puppet coding
Revision as of 05:17, 30 July 2017 by imported>BryanDavis (BryanDavis moved page Puppet testing to Puppet coding/Testing without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Puppet Compiler Jenkins Job

To run the puppet compiler on a gerrit change set go to the Build with Parameters page of the puppet compilers Jenkins job, fill in GERRIT_CHANGE_NUMBER and add fully qualified domains to LIST_OF_NODES. After its done look on for the build number.

There is a also a tool called pcc under the operations/puppet/utils repo. You'll need your Jenkins token to make it work, retrievable under$YOURUSERNAME/configure.


./utils/pcc GERRIT_CHANGE_NUMBER LIST_OF_NODES --username YOUR_USERNAME --api-token 12312312312312313  
./utils/pcc 282936 oxygen.eqiad.wmnet --username batman --api-token 12312312312312313

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