Skip to content

ITrxReportCapability interface design has a flaw where "enabled" state is unknown to callers #5532

@Youssef1313

Description

@Youssef1313

We have IsSupported property and Enable method.

The intent is that a framework can only produce Trx properties if the extension is enabled. But then given the interface, I can't correctly determine whether or not the extension is enabled.

The only way around it today is that concrete implementation of the capability can have IsTrxEnabled property (not part of the interface), and the framework then casts ITrxReportCapability to the concrete implementation to know whether or not the extension was enabled. But this is not good enough, and can't work reliable for VSTestBridge where we don't necessarily control the concrete implementation of the capability.

Two questions here:

  1. Is IsSupported actually needed? Why would it need to be "dynamically" calculated?
    • My theory here is that if a framework doesn't support Trx, it shouldn't implement ITrxReportCapability at all. Given that, I don't see the use case of needing IsSupported
  2. Should we add IsEnabled property to the interface (breaking change) in MTP v2?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: MTPBelongs to the Microsoft.Testing.Platform core libraryArea: TRX

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions