Skip to content

Add OS related attribute #4700

Open
@Evangelink

Description

Summary

Add a new attribute that will skip running the test if the OS doesn't match.

Background and Motivation

There are many implementation of OS skip attributes in other test framework but none in MSTest. We should close the gap here.

Looking at people implementation, there are 2 main trends, an inclusive attribute like SupportedOS and an exclusive attribute like IgnoreOnOS. Both of these ways have cons when you want to have all but one (few) in which case the other attribute would be better.

Proposed Feature

I would like to have our implementation allowing to choose between "include" and "exclude" mode (with most likely "include" as default behavior).
The attribute name could be:

  • ConditionalOSAttribute
  • OSConditionAttribute
  • OSFilterAttribute

I think a naming like Condition, Conditional or Filter would give us more flexibility to introduce more features alike (e.g. conditional run based on architecture, based on locale, based on env var...)

Alternative Designs

We could also ship 2 specific attributes

  • SupportedOSAttribute
  • UnsupportedOSAttribute

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions