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-680) Make pdk test unit interactive by default #748

Merged
merged 1 commit into from
Sep 16, 2019

Conversation

rodjek
Copy link
Contributor

@rodjek rodjek commented Sep 11, 2019

semirhage :0: pdk/foo (git:pdk-680 → origin {3} ?:1!)$ ../bin/pdk test unit --interactive
pdk (INFO): Using Ruby 2.4.6
pdk (INFO): Using Puppet 6.8.1
[✔] Preparing to run the unit tests.
/home/tsharpe/.rbenv/versions/2.4.6/bin/ruby -I/home/tsharpe/.pdk/cache/ruby/2.4.0/gems/rspec-core-3.8.2/lib:/home/tsharpe/.pdk/cache/ruby/2.4.0/gems/rspec-support-3.8.2/lib /home/tsharpe/.pdk/cache/ruby/2.4.0/gems/rspec-core-3.8.2/exe/rspec --pattern spec/\{aliases,classes,defines,functions,hosts,integration,plans,tasks,type_aliases,types,unit\}/\*\*/\*_spec.rb
Failed to retrieve Augeas version: cannot load such file -- augeas
Run options: exclude {:bolt=>true}

foo::bar
  on oraclelinux-7-x86_64

From: /home/tsharpe/code/puppetlabs/pdk/foo/spec/classes/bar_spec.rb @ line 9 :

     4: describe 'foo::bar' do
     5:   on_supported_os.each do |os, os_facts|
     6:     context "on #{os}" do
     7:       let(:facts) { os_facts }
     8:
 =>  9:       it { binding.pry; is_expected.to compile }
    10:     end
    11:   end
    12: end

[1] pry(#<RSpec::ExampleGroups::FooBar::OnOraclelinux7X8664>)>

@natemccurdy
Copy link
Contributor

natemccurdy commented Sep 12, 2019

What happens now if I have a binding.pry line in my spec tests and I run pdk test unit without the --interactive flag? Will it still hang like it currently does?

@scotje
Copy link
Contributor

scotje commented Sep 12, 2019

I think the most recent thing we discussed (documented here: https://tickets.puppetlabs.com/browse/PDK-680?focusedCommentId=678885&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-678885) was making this the default behavior in most cases.

@natemccurdy
Copy link
Contributor

Right, my understanding of the conversation in PDK-680 was that interactive features like pry would work without having to add any additional flags to PDK.

Please excuse me if I'm misunderstanding this particular PR, but it seems to be requiring the flag.

@scotje
Copy link
Contributor

scotje commented Sep 12, 2019

Yeah, I think the PR needs to be revised to reflect that updated expectation. I guess the ticket description/acceptance criteria itself was never updated.

@scotje
Copy link
Contributor

scotje commented Sep 12, 2019

@rodjek see comments above ^^

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 92.061% when pulling a6fcbd8 on rodjek:pdk-680 into 378f22d on puppetlabs:master.

Copy link
Contributor

@scotje scotje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

On a related note, we need to look into the startup time for the puppetlabs_spec_helper tasks because it really seems to be impacting the overall test duration, even after the spec_prep has completed.

@rodjek rodjek changed the title (PDK-680) Add --interactive flag to pdk test unit (PDK-680) Make pdk test unit interactive by default Sep 16, 2019
@rodjek
Copy link
Contributor Author

rodjek commented Sep 16, 2019

Updated for the new criteria :)

@rodjek rodjek merged commit 6286733 into puppetlabs:master Sep 16, 2019
@rodjek rodjek deleted the pdk-680 branch September 16, 2019 23:29
@rodjek rodjek added the feature label Oct 9, 2019
@rodjek rodjek added this to the September 2019 milestone Oct 9, 2019
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