Skip to content

Latest commit

 

History

History
88 lines (78 loc) · 2.91 KB

TODO.org

File metadata and controls

88 lines (78 loc) · 2.91 KB

Config options used by rspec-puppet:

Puppet[:certname] Puppet[:code] Puppet[:config] Puppet[:libdir] Puppet[:manifest] Puppet[:manifestdir] Puppet[:modulepath] Puppet[:templatedir]

rspec config added by rspec-puppet

RSpec.configure do |c| c.add_setting :module_path, :default => ‘/etc/puppet/modules’ c.add_setting :manifest_dir, :default => nil c.add_setting :manifest, :default => nil c.add_setting :template_dir, :default => nil c.add_setting :config, :default => nil end

Feature ideas

Test defined types

Test templates

test for creation of namespaced types

test that created types actually exist

play nicely with rspec-puppet

Stub puppet functions (inc extlookup and hiera)

Test classes

Stub facts

from rspec-puppet?

node_obj = Puppet::Node.new(nodename) # default to Puppet[:certname]? node_obj.merge(facts_val) # but what is this?

Release it!

Fix bug where multiple with_foo() conditions would be overridden by the last

should contain_file('foo').with_content(/bar/).with_content(/baz/) would not check /bar/, only /baz/, for example

Document it!

  • [X] gem install or gemfile line

Issue with global Puppet settings config & running rspec-puppet simultaneously with puppet…

See the fizzgig branch of puppet for an example

Can we isolate the compiler from the settings?

Answer seems to be yes – use puppetlabs_spec_helper or directly Puppet::Test::TestHelper to tear down Puppet.settings after each test.

Ensure that modulepath can take multiple directories

  • in govuk/puppet, we had trouble having multiple directories on the module path, so we ended up doing this:
RSpec.configure do |c|
  c.module_path = File.join(HERE, 'modules')
# ...
end

# note monkey-patch here because the modulepath isn't working
module RSpec::Puppet
  module Support
    alias_method :real_build_catalog, :build_catalog
    def build_catalog (nodename, fact_val, code)
      Puppet[:modulepath] = File.join(HERE, 'modules') + ':' + File.join(HERE, 'vendor', 'modules')
      real_build_catalog(nodename,fact_val,code)
    end
  end
end

That’s not so cool :(

Rename

functions with multiple arguments

nodes

See govuk_nodes_spec_optional for examples of this. the rspec-puppet equivalent is :type => :host

implement defined types from ruby hashes

update README to reflect defined type API change

implementation-independent dependency assertions

Test standalone puppet modules

Test puppet types (ie from lib/puppet/parser/types)

Test templates in isolation

maybe testing functions more generally?

Test custom facts

Virtual/exported resources

@dcarley’s trick of using a precondition with a collector might be helpful here

Parameterized classes

Preconditions (do I actually want this?)