[PDK-1061] PDK build fails to find rake unless unit tests have been run once Created: 2018/06/30  Updated: 2018/07/26  Resolved: 2018/07/03

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

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

Windows, or Linux container with PDK 1.6 installed

Acceptance Criteria:

pdk build should get rake into the ./bin folder (and whatever else it needs), without assuming that pdk test unit has been executed; since in a GitLab CI pipeline, pdk build is likely being executed in a separate job in a fresh container (because unit tests were run in a prior step).

Method Found: Needs Assessment
Release Notes: Bug Fix
Release Notes Summary: `pdk build` now creates the rake binstub needed to clean up the module prior to packaging.
QA Risk Assessment: Needs Assessment


If you do pdk build in a module directory where ./bin/rake does not exist, you get an error like:

Failed to execute '/path-to-my-module/bin/rake spec_clean': No such file or directory

The only command that will put rake in ./bin is pdk test unit.

This is very problematic in a CI pipeline where pdk build is run in a separate step in a clean container from the unit test step. The workaround is to execute a unit test, but this drastically increases the time of the build step, because pdk test unit will download all dependent modules, which takes minutes.

Generated at Sun May 31 19:31:45 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.