.fixtures.yml

Our fixtures file lets our tests know what dependencies are required for our manifests. It is placed at the base of the repository, as profile/.fixtures.yml. For our particular profile, we'll build a fixtures file that contains rtyler/jenkins and all of its dependencies in order to support our test:

#profile/.fixtures.yml
fixtures:
repositories:
jenkins:
repo: "git://github.com/voxpupuli/puppet-jenkins.git"
ref: "1.7.0"
apt: "https://github.com/puppetlabs/puppetlabs-apt"
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib"
java: "https://github.com/puppetlabs/puppetlabs-java"
zypprepo: "https://github.com/voxpupuli/puppet-zypprepo.git"
archive: "https://github.com/voxpupuli/puppet-archive.git"
systemd: "https://github.com/camptocamp/puppet-systemd.git"
transition: "https://github.com/puppetlabs/puppetlabs-transition.git"

We use this file to declare a module in our test, and use a pointer to a repository to find it. In the preceding case, we're grabbing the latest version of each module except Jenkins, which we've pinned at 1.7.0 as we're using in our Puppetfile. Depending on your strategy for code, you may or may not want to tag a specific reference to a version, like I did previously.

Documentation on fixtures can be found in the spec_helper.rb GitHub repository at https://github.com/puppetlabs/puppetlabs_spec_helper#fixtures-examples.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.107.89