Skip to content

Improve --contains #181

@bonachea

Description

@bonachea

Currently the --contains option can (effectively) only be passed once on the command line (subsequent arguments seem to be silently ignored, which itself probably represents a defect). Also the provided filter string specifies a literal case-sensitive string match. This is not very flexible.

This feature would be more usable if:

  1. --contains defaulted to case-INsensitive string matching, because that's probably what the end user usually wants
  2. --contains accepted a comma-delimited list of patterns (e.g. --contains=foo,bar) and/or supported passing the option multiple times (e.g. --contains=foo --contains=bar) where in both cases this would be interpreted as a logical OR filter (i.e. run tests with a name/description matching any provided pattern).
  3. --not-contains A new option to enable runtime skipping of known-broken tests. This could perhaps be used either in isolation (e.g. --not-contains=broken runs every test not matching "broken"), or in combination with --contains as an additional negative filter (e.g. --contains=foo,bar --not-contains=broken runs every test matching ("foo" OR "bar") AND NOT "broken")

One could certainly imagine more powerful options, ranging from introducing syntax to support logical-AND of --contains, to support for full regex pattern matching. However even just something akin to the initial few options sketched above would be an improvement and should hopefully not be too difficult to implement.

See also related issue #142

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions