Skip to content

Unit Testing Dependencies Not Properly Mocked #219

Open
@DarkArc-Github

Description

@DarkArc-Github

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:

  1. ini_subsetting type
  2. pe_ini_subsetting type
  3. puppetserver service
  4. 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:

  1. Create a profile that includes the splunk_hec class
  2. Write rspec tests for that profile
  3. Run pdk test unit

Environment:

  • puppetlabs-splunk_hec version: 1.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions