[PDK-400] Inconsistent time reporting for test unit with/without --parallel Created: 2017/08/09  Updated: 2018/11/29  Resolved: 2018/10/29

Status: Closed
Project: Puppet Development Kit
Component/s: None
Affects Version/s: None
Fix Version/s: PDK 1.8.0

Type: Bug Priority: Major
Reporter: Austin Blatt Assignee: Tim Sharpe
Resolution: Fixed Votes: 0
Labels: resolved-issue-added
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance Criteria:

pdk test unit and pdk test unit --parallel output consistent timing.

Epic Link: PDK Maintenance
Method Found: Needs Assessment
Release Notes: Bug Fix
Release Notes Summary: The output of pdk execution duration from running a command normally versus running a command with the `parallel` flag was inconsistent. This fix makes the duration output consistent.
QA Risk Assessment: Needs Assessment

 Description   

pdk test unit reports the time that rspec spends running tests. pdk test unit --parallel reports the total time rspec tests + file loading time. This results in --parallel reporting a few second run time on a new module, when without the flag it reports <0.5 seconds run time (but still takes a few seconds to finish).

We should probably output two times for rspec tests. The CPU time that the rspec tests spent running and the total time of execution. For example,

Evaluated 6 tests (system: 0.320675 seconds, real: 3.523 seconds): 0 failures, 0 pending.



 Comments   
Comment by Bryan Jen [ 2018/10/18 ]

Output from PDK 1.7.0

PS C:\Users\Administrator\foo> pdk test unit --parallel
pdk (WARN): This module is compatible with a newer version of PDK. Upgrade your version of PDK to ensure compatibility.
pdk (INFO): Using Ruby 2.4.4
pdk (INFO): Using Puppet 5.5.3
[*] Preparing to run the unit tests.
[*] Running unit tests in parallel.
  Evaluated 9 tests in 9.500002 seconds: 0 failures, 0 pending.
PS C:\Users\Administrator\foo> pdk test unit
pdk (WARN): This module is compatible with a newer version of PDK. Upgrade your version of PDK to ensure compatibility.
pdk (INFO): Using Ruby 2.4.4
pdk (INFO): Using Puppet 5.5.3
[*] Preparing to run the unit tests.
[*] Running unit tests.
  Evaluated 9 tests in 1.218755 seconds: 0 failures, 0 pending.

Comment by Jean Bond [ 2018/11/26 ]

Tim Sharpe, does this now report only the testing time? And does this apply to pdk commands generally, or just `pdk test unit` (and `pdk validate`? )?

Comment by Bryan Jen [ 2018/11/26 ]

Jean Bond this now reports the wall time of PDK's execution of the command instead of the time rspec took to evaluate the examples.

Generated at Fri Jul 19 07:15:30 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.