[PUP-4239] add acceptance for hash and array lookup() Created: 2015/03/18  Updated: 2019/04/04  Resolved: 2015/05/20

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: PUP 4.1.0

Type: Bug Priority: Normal
Reporter: Eric Thompson Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relates to PUP-3948 Let lookup be the impl for agnostic l... Closed
Story Points: 1
Sprint: Language 2015-04-01, Language 2015-04-15
QA Contact: Eric Thompson


include the full stack of global hiera, environment, and module data.

The hiera_include function is simple, it looks up 'classes' and then loops over them to include those. If an acceptance test correctly looks up (global, env, module) then hiera_include should work (tested with an integration test).

Comment by Eric Thompson [ 2015/03/26 ]

Henrik Lindberg hmmm... maybe i mis-interpreted your statement i cut and pasted in the description. do we need acceptance to test lookup() including classes?
more cut and pasting from pup-3948

# like this
lookup('classes').each |$c| { include $c }
# or like this
include lookup('classes')

Comment by Henrik Lindberg [ 2015/03/26 ]

Both of those look fine. The first one for sure, and include should be able to take an array (the result of lookup('classes')).

Now, if we need this or not - We do need a test that checks that the call goes all the way through when everything is packaged. Which key that is looked up is less interesting - e.g. there is nothing special about the key 'classes', nor that it is possible to call include with what is returned.

The more interesting test is that it is possible to lookup across hiera, environment, and module. If one such lookup works, then the rest are covered by unit/integration testing (all of the deep, unique variants, etc. - no need to repeat those). You had something like that setup when you tested the lookup function (a hash with keys coming from env/module IIRC. That seemed like a good test for acceptance.

Comment by Eric Thompson [ 2015/03/26 ]

previous lookup() acceptance just tested strings.
i will expand to test hashes and arrays. sounds like calling include on the result is not-important.
thanks, Henrik!

Comment by Thomas Hallgren [ 2015/04/01 ]

Merged to master at 73a594a.

Comment by Eric Thompson [ 2015/04/06 ]

passed CI... resolving

Generated at Sun Aug 09 00:03:27 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.