rspec-puppet and puppet doc conflicts

123 views
Skip to first unread message

llo...@oreillyauto.com

unread,
Jul 18, 2012, 5:35:44 PM7/18/12
to puppet...@googlegroups.com
I recently started trying to use rspec-puppet and puppetlabs-rspec-helper.

When I ran 'rspec-puppet-init' in one o fmy modules, it created a series of symlinks.

Now, when I run puppet doc (via a rake task supplied by The Foreman, but also when I call it directly) I get the following error:

Could not generate documentation: Definition 'mongodb::addmongouser' is already defined at /etc/puppet/environments/test/modules/mongodb/spec/fixtures/modules/mongodb/manifests/addmongouser.pp:36; cannot be redefined at /etc/puppet/environments/test/modules/mongodb/manifests/addmongouser.pp:36
Failed to process puppetdocs for /var/www/test while executing puppetdoc --output /var/www/test --modulepath /etc/puppet/environments/test/modules:/etc/puppet/modules -m rdoc

What's the best way to handle this, w/o having to constantly have to delete and recreate the symlinks created by rspec-puppet ?

Mark Roggenkamp

unread,
Jul 19, 2012, 8:26:29 AM7/19/12
to puppet...@googlegroups.com
Perhaps make your puppet doc rake task depend on the spec_clean task? It seems like you may not need the symlinks created by rspec-puppet-init as a dynamic fixture environment is created via .fixtures.yml.

Mark

Nan Liu

unread,
Jul 19, 2012, 12:55:10 PM7/19/12
to puppet...@googlegroups.com
On Thu, Jul 19, 2012 at 5:26 AM, Mark Roggenkamp
<mark.ro...@gmail.com> wrote:
> Perhaps make your puppet doc rake task depend on the spec_clean task? It
> seems like you may not need the symlinks created by rspec-puppet-init as a
> dynamic fixture environment is created via .fixtures.yml.

Yep, in general rake spec should clean up everything in the fixtures
directory after the spec test unless there's a failure, and
Rake::Task[:spec_clean] will clean up the fixtures directory. If you
find a Puppet Labs module with cruft in spec/fixtures/modules
directory, please file a bug.

Thanks,

Nan
Reply all
Reply to author
Forward
0 new messages