Skip to content

Support multiple targets under test  #67

@rickeylev

Description

@rickeylev

On more than one occasion, I or others have needed to have multiple targets under test. This is usually done to verify that a particular configuration change doesn't change behavior from a base line, or to verify that the rule-under-test ignores some configuration change. By having a "baseline" with fixed config settings, it makes it possible to reliably check the expected vs actual state.

This is somewhat possible today, but is rather verbose. If config settings are involved, it's even more verbose, and if different config settings are involved for the targets under test, then even more.

Proposed API:

  • Add a targets arg. It is mutually exclusive with the target arg.
  • It is either a list of target names or a dict of name -> <target under test kwargs>.
  • When list is provided, each target under test is given the same settings as if a single target was provided (e.g. the same aspect, config settings, expect failure, etc settings)
  • When a dict is provided, each target under test is given the settings as specified by their associated key. This allows each target under test to have custom config settings, aspects, etc.

Hm, well, I'm not sure I 100% like this proposed api, but it works. I'm just not a fan of currying through arbitrary lists of kwargs through things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions