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-465) Improve output from spec_prep/spec_clean failures #290

Merged
merged 1 commit into from
Sep 12, 2017

Conversation

rodjek
Copy link
Contributor

@rodjek rodjek commented Sep 11, 2017

Example output for a git clone failure from a bad .fixtures.yml entry.

asmodean :0: pdk/foo (git:pdk-465-2 → origin {2} U:1 ?:1!)$ ../bin/pdk test unit
[✖] Preparing to run the unit tests.
pdk (ERROR): Could not find semantic_puppet gem, falling back to internal functionality. Version checks may be less robust.
pdk (ERROR): Cloning into 'spec/fixtures/modules/notexist'...
pdk (ERROR): fatal: remote error:
pdk (ERROR):   this/does/not/exist is not a valid repository name
pdk (ERROR):   Email [email protected] for help
pdk (ERROR): rake aborted!
pdk (ERROR): Failed to clone git repository git://github.com/this/does/not/exist.git into spec/fixtures/modules/notexist
pdk (ERROR): /home/tsharpe/.pdk/cache/ruby/2.1.0/gems/puppetlabs_spec_helper-2.3.2/lib/puppetlabs_spec_helper/rake_tasks.rb:165:in `clone_repo'
pdk (ERROR): /home/tsharpe/.pdk/cache/ruby/2.1.0/gems/puppetlabs_spec_helper-2.3.2/lib/puppetlabs_spec_helper/rake_tasks.rb:275:in `block (3 levels) in <top (required)>'
pdk (ERROR): Tasks: TOP => spec_prep
pdk (ERROR): (See full trace by running task with --trace)
[✔] Cleaning up after running unit tests.
pdk (FATAL): Failed to prepare to run the unit tests.
asmodean :0: pdk/foo (git:pdk-465-2 → origin {2} U:1 ?:1!)$

@rodjek
Copy link
Contributor Author

rodjek commented Sep 11, 2017

Probably want to strip out some of that rake generated noise from the error output too

@DavidS
Copy link
Contributor

DavidS commented Sep 11, 2017

Another option would be to make clear that the output shown is not from the PDK itself.

@rodjek
Copy link
Contributor Author

rodjek commented Sep 11, 2017

@DavidS, how about this:

  • Added a log message saying that the error is coming from a rake task
  • Padded the rake output with newlines to separate it from the PDK output
  • Removed the PDK logger prefix text from the rake output.
asmodean :0: pdk/foo (git:pdk-465-2 → origin {2} U:1 ?:1!)$ ../bin/pdk test unit
[✖] Preparing to run the unit tests.
pdk (ERROR): The spec_prep rake task failed with the following error(s):

Could not find semantic_puppet gem, falling back to internal functionality. Version checks may be less robust.
Cloning into 'spec/fixtures/modules/notexist'...
fatal: remote error:
  this/does/not/exist is not a valid repository name
  Email [email protected] for help
rake aborted!
Failed to clone git repository git://github.com/this/does/not/exist.git into spec/fixtures/modules/notexist
/home/tsharpe/.pdk/cache/ruby/2.1.0/gems/puppetlabs_spec_helper-2.3.2/lib/puppetlabs_spec_helper/rake_tasks.rb:165:in `clone_repo'
/home/tsharpe/.pdk/cache/ruby/2.1.0/gems/puppetlabs_spec_helper-2.3.2/lib/puppetlabs_spec_helper/rake_tasks.rb:275:in `block (3 levels) in <top (required)>'
Tasks: TOP => spec_prep
(See full trace by running task with --trace)

[✔] Cleaning up after running unit tests.
pdk (FATAL): Failed to prepare to run the unit tests.

I'd like to get rid of those last 4 lines of output too, but that's best done in puppetlabs_spec_helper itself (have the task exit gracefully rather than using Kernel#abort).

@DavidS
Copy link
Contributor

DavidS commented Sep 11, 2017

👍 looks class.

@rodjek rodjek force-pushed the pdk-465-2 branch 4 times, most recently from 5953aa1 to a7f6244 Compare September 12, 2017 04:30
@puppetlabs puppetlabs deleted a comment from coveralls Sep 12, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Sep 12, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Sep 12, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Sep 12, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Sep 12, 2017
@puppetlabs puppetlabs deleted a comment from coveralls Sep 12, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 94.066% when pulling 9f7b70a on rodjek:pdk-465-2 into 121b4ef on puppetlabs:master.

@rodjek rodjek changed the title [WIP] (PDK-465) Improve output from spec_prep/spec_clean failures (PDK-465) Improve output from spec_prep/spec_clean failures Sep 12, 2017
@DavidS DavidS merged commit 728afa5 into puppetlabs:master Sep 12, 2017
@bmjen bmjen added the feature label Sep 13, 2017
@rodjek rodjek deleted the pdk-465-2 branch November 26, 2018 23:14
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.

4 participants