You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With PDK 2.1.0, when you have a module with no unit tests and run pdk test unit with both the --parallel and --format= options then it fails with this error:
pdk test unit --parallel --format=text:test_output.txt
pdk (INFO): Using Ruby 2.7.2
pdk (INFO): Using Puppet 7.5.0
[✔] Preparing to run the unit tests.
[✔] Running unit tests in parallel.
/opt/puppetlabs/pdk/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.1.0/lib/pdk/util/json_finder.rb:42:in `objects': undefined method `compact' for nil:NilClass (NoMethodError)
from /opt/puppetlabs/pdk/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.1.0/lib/pdk/util.rb:210:in `find_all_json_in'
from /opt/puppetlabs/pdk/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.1.0/lib/pdk/tests/unit.rb:115:in `invoke'
from /opt/puppetlabs/pdk/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.1.0/lib/pdk/cli/test/unit.rb:80:in `block (2 levels) in <module:CLI>'
from /opt/puppetlabs/pdk/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:329:in `run_this'
from /opt/puppetlabs/pdk/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:269:in `run'
from /opt/puppetlabs/pdk/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:287:in `run'
from /opt/puppetlabs/pdk/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/cri-2.10.1/lib/cri/command.rb:287:in `run'
from /opt/puppetlabs/pdk/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.1.0/lib/pdk/cli.rb:71:in `run'
from /opt/puppetlabs/pdk/private/ruby/2.4.10/lib/ruby/gems/2.4.0/gems/pdk-2.1.0/exe/pdk:6:in `<top (required)>'
from /opt/puppetlabs/pdk/private/ruby/2.4.10/bin/pdk:23:in `load'
from /opt/puppetlabs/pdk/private/ruby/2.4.10/bin/pdk:23:in `<main>'
To Reproduce:
pdk new module testmod
cd testmod
pdk test unit --parallel --format=text:output.txt
The text was updated successfully, but these errors were encountered:
Thanks for the report! It appears that the code path expects there to be stdout to parse, but when there are no tests to run PDK outputs that on stderr. Since this path isn't checking for stderr, it fails. We'll triage this in the next planning
With PDK 2.1.0, when you have a module with no unit tests and run
pdk test unit
with both the--parallel
and--format=
options then it fails with this error:To Reproduce:
The text was updated successfully, but these errors were encountered: