Skip to content

Commit 17feedd

Browse files
committed
BUG: Solved Travis CI unit testing error "Invalid resource type archive at /home/travis/build/Chassis/puppet-wp/spec/fixtures/modules/wp/manifests/cli.pp:22". This is caused by the module archive missing in the execution of the unit tests. I've added support for specifying external modules in the .fixtures.yml file. This file is loaded by the puppetlabs_spec_helper gem. This is the standard used in PDK for testing with external modules. This should solve the errors. I've also ran the same changes in testing code on the original code and all tests pass fine then as well.
1 parent bbf7316 commit 17feedd

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.fixtures.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fixtures:
2+
repositories:
3+
archive: "git://github.com/voxpupuli/puppet-archive"

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ gem 'puppet-lint'
1111
gem 'rspec-puppet'
1212
gem 'syck'
1313
gem 'puppet', puppetversion
14+
gem "puppetlabs_spec_helper", "2.10.0"
15+

Rakefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
1-
require "rake"
2-
require "rspec/core/rake_task"
1+
require 'puppetlabs_spec_helper/rake_tasks'
32

4-
RSpec::Core::RakeTask.new(:spec) do |t|
5-
t.pattern = Dir.glob("spec/**/*_spec.rb")
6-
end
7-
8-
task default: :spec

spec/spec_helper.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'puppetlabs_spec_helper/module_spec_helper'
12
require 'rspec-puppet'
23

34
fixture_path = File.join(File.dirname(File.expand_path(__FILE__)), 'fixtures')

0 commit comments

Comments
 (0)