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
Description:
When using puppetlabs-splunk_hec as a dependency in another module's test suite, the following resources need to be mocked but should be handled within the module itself:
ini_subsetting type
pe_ini_subsetting type
puppetserver service
Custom fact splunk_hec_is_pe
Current Behavior:
Tests fail with errors like:
Unknown variable: 'ini_subsetting'
Could not find resource 'Service[puppetserver]'
Expected Behavior:
The module's test suite should handle these dependencies internally, allowing dependent modules to test only their integration points without needing to mock core module dependencies.
Steps to Reproduce:
Create a profile that includes the splunk_hec class
Write rspec tests for that profile
Run pdk test unit
Environment:
puppetlabs-splunk_hec version: 1.4.0
The text was updated successfully, but these errors were encountered:
Thank you for opening this issue. I was able to reproduce the compilation errors following the steps you provided.
error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Unknown resource type: 'Ini_subsetting' (file: test_module/spec/fixtures/modules/splunk_hec/manifests/init.pp, line: 214, column: 5)
error during compilation: Could not find resource 'Service[puppetserver]' in parameter 'notify' (file: test_module/spec/fixtures/modules/splunk_hec/manifests/init.pp, line: 221)
We have a mocked report processor here for our traditional rspec tests. With rspec-puppet when the manifest being tested relies on an existing state, such as another class being included or setting variables, it can be specified using let(:pre_condition). We mock these resources in our testing here.
The evaluation error can be resolved by adding the puppetlabs/inifile module to .fixtures.yml.
Please let us know if this information does not help in resolving the errors you are seeing. If any additional issues or concerns arise please do not hesitate to report them to us.
Description:
When using puppetlabs-splunk_hec as a dependency in another module's test suite, the following resources need to be mocked but should be handled within the module itself:
ini_subsetting
typepe_ini_subsetting
typepuppetserver
servicesplunk_hec_is_pe
Current Behavior:
Tests fail with errors like:
Expected Behavior:
The module's test suite should handle these dependencies internally, allowing dependent modules to test only their integration points without needing to mock core module dependencies.
Steps to Reproduce:
pdk test unit
Environment:
The text was updated successfully, but these errors were encountered: