Details
-
Bug
-
Status: Closed
-
Normal
-
Resolution: Fixed
-
None
-
None
-
pdk 1.2.1
-
Needs Assessment
-
Not Needed
-
Needs Assessment
Description
The rspec in https://puppet.com/docs/pe/2017.3/quick_start_guides/writing_modules_nix_getting_started_guide.html#validate-and-unit-test-a-class doesn't pass `pdk validate`, which is a confusing new user experience.
Should either say that it might fail, or correct it.
https://gitlab.com/richardc/pdk-example-fixup/commit/ae2f896b47aef504289aba1e5f6a438330856aae is a hacky fix generated from an IRC discussion, it disables some rubocops rather than editing all the code.
Additionally it shows cd-ing into spec/classes. That's not great as the following step blows up
[root@master03 classes]# pdk test unit
|
[â] Preparing to run the unit tests.
|
[â] Running unit tests.
|
Evaluated 4 tests in 0.416371631 seconds: 4 failures, 0 pending.
|
[â] Cleaning up after running unit tests.
|
/opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/report/event.rb:329:in `read': No such file or directory @ rb_sysopen - ./spec/classes/pe_getstarted_app_spec.rb (Errno::ENOENT)
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/report/event.rb:329:in `context_lines'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/report/event.rb:102:in `to_text'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/report.rb:99:in `block (2 levels) in write_text'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/report.rb:98:in `each'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/report.rb:98:in `block in write_text'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/report.rb:97:in `each'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/report.rb:97:in `write_text'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/cli/test/unit.rb:51:in `block (3 levels) in <module:CLI>'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/cli/test/unit.rb:50:in `each'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/cli/test/unit.rb:50:in `block (2 levels) in <module:CLI>'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/cri-2.9.1/lib/cri/command.rb:319:in `call'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/cri-2.9.1/lib/cri/command.rb:319:in `run_this'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/cri-2.9.1/lib/cri/command.rb:264:in `run'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/cri-2.9.1/lib/cri/command.rb:282:in `run'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/cri-2.9.1/lib/cri/command.rb:282:in `run'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/lib/pdk/cli.rb:17:in `run'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/lib/ruby/gems/2.1.0/gems/pdk-1.2.1/exe/pdk:6:in `<top (required)>'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/bin/pdk:23:in `load'
|
from /opt/puppetlabs/pdk/private/ruby/2.1.9/bin/pdk:23:in `<main>'
|
Attachments
Issue Links
- duplicates
-
PDK-926 when running {{pdk test unit}} from somewhere other than the module root, spec test failures cause Errno::ENOENT errors
-
- Closed
-
- relates to
-
DOCUMENT-864 Update code style of "Getting started: Writing modules for *nix"
-
- Closed
-