Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-5743

Puppet 3.8.5 breaks compatibility with rspec-puppet

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.8.5, PUP 4.3.2
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:

      Running rspec tests

    • Template:

      Description

      After release of Puppet 3.8.5 some rspec tests fail. I was able to pinpoint the point where it breaks.

      It seams to be connected with using shared_examples and setting parameters for class. Like this:

      shared_examples 'working class' do
        it { expect(subject).to compile }
        it { expect(subject).to contain_class 'repo::mvn_releases' }
      end
       
      describe 'repo::mvn_releases', :type => :class do
        let(:facts) do
          { :path => '/bin:/sbin:/usr/bin:/usr/sbin' }
        end
        context 'with default arguments' do
          it_behaves_like 'working class' # this one works fine
        end
        context 'with ["pl.gov.coi:sample::jar"] arguments' do
          let(:params) do
            { :coordinates => ['pl.gov.coi:sample::jar'] }
          end
          it_behaves_like 'working class' # this one fails
        end
      end
      

      The errors seams to be in line: https://github.com/rodjek/rspec-puppet/blob/master/lib/rspec-puppet/matchers/create_generic.rb#L82 `catalogue.call` returns nil in those case.

      Some output:

          behaves like working class
            should compile into a catalogue without dependency cycles (FAILED - 10)
      place: /home/ksuszynski/.rvm/gems/ruby-2.1.6/gems/rspec-puppet-2.3.0/lib/rspec-puppet/matchers/create_generic.rb:83
      catalogue: #<Proc:0x00000004421810@/home/ksuszynski/.rvm/gems/ruby-2.1.6/gems/rspec-puppet-2.3.0/lib/rspec-puppet/support.rb:8 (lambda)>
      @catalogue.class: NilClass
      @referenced_type: "Class"
      @title: "repo::mvn_releases"
      

      Switching back to Puppet 3.8.4 fixes this issue.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              cardil Chris Suszynski
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support