Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PDK-369) Improve error context for pdk test unit failures #294

Merged
merged 1 commit into from
Sep 13, 2017

Conversation

rodjek
Copy link
Contributor

@rodjek rodjek commented Sep 13, 2017

Adds the spec description to the output for rspec events, as well as up to 5 lines of context of the failing spec (up to 2 on either side of the failing line).

Example:

asmodean :0: pdk/foo (git:sdk-369 {2} U:1 ?:2!)$ ../bin/pdk test unit
[✔] Preparing to run the unit tests.
[✖] Running unit tests.
  Evaluated 5 tests in 0.206083208 seconds: 5 failures, 0 pending.
[✔] Cleaning up after running unit tests.
failed: rspec: ./spec/classes/foo_spec.rb:8: expected that the catalogue would not compile but it does
  foo on windows-2012-x64 should not compile into a catalogue without dependency cycles
  Failure/Error:
        let(:facts) { os_facts }
  
        it { is_expected.not_to compile }
      end
    end

failed: rspec: ./spec/classes/foo_spec.rb:8: expected that the catalogue would not compile but it does
  foo on debian-8-x86_64 should not compile into a catalogue without dependency cycles
  Failure/Error:
        let(:facts) { os_facts }
  
        it { is_expected.not_to compile }
      end
    end

failed: rspec: ./spec/classes/foo_spec.rb:8: expected that the catalogue would not compile but it does
  foo on windows-2012 R2-x64 should not compile into a catalogue without dependency cycles
  Failure/Error:
        let(:facts) { os_facts }
  
        it { is_expected.not_to compile }
      end
    end

failed: rspec: ./spec/classes/foo_spec.rb:8: expected that the catalogue would not compile but it does
  foo on ubuntu-16.04-x86_64 should not compile into a catalogue without dependency cycles
  Failure/Error:
        let(:facts) { os_facts }
  
        it { is_expected.not_to compile }
      end
    end

failed: rspec: ./spec/classes/foo_spec.rb:8: expected that the catalogue would not compile but it does
  foo on redhat-7-x86_64 should not compile into a catalogue without dependency cycles
  Failure/Error:
        let(:facts) { os_facts }
  
        it { is_expected.not_to compile }
      end
    end

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 94.121% when pulling 92217f1 on rodjek:sdk-369 into e7ec32a on puppetlabs:master.

@rodjek rodjek changed the title (SDK-369) Improve error context for pdk test unit failures (PDK-369) Improve error context for pdk test unit failures Sep 13, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) to 94.121% when pulling ba96a75 on rodjek:sdk-369 into e7ec32a on puppetlabs:master.

@DavidS DavidS merged commit 6a045e7 into puppetlabs:master Sep 13, 2017
@DavidS DavidS added the feature label Sep 13, 2017
@rodjek rodjek deleted the sdk-369 branch September 13, 2017 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants