dmc icon indicating copy to clipboard operation
dmc copied to clipboard

Add test options for classes and specific tests

Open cyborgx37 opened this issue 9 years ago • 2 comments

dmc test currently accepts a --ns option, but there are no options to run a specific class or a specific test within a class.

Add the following options:

  • --class to filter apex classes by name
  • --name to filter tests by name

Options may be used independently or may be combined to provide even more targeted filters for which tests to run.

For now, only exact name matches (case-insensitive) will be supported, although a future iteration could potentially allow globbing patterns ("BR1_*", for example)

Example usage:

dmc test --class AccountTests
dmc test --name BR1_AccountManagerOrRegionManagerRequired
dmc test --class AccountTests --name BR1_AccountManagerOrRegionManagerRequired
dmc test --ns MyManagedPackage --class AccountTests --name BR1_AccountManagerOrRegionManagerRequired

cyborgx37 avatar Aug 04 '16 01:08 cyborgx37

I'd be happy to help by submitting a PR once this issue has been reviewed and approved/amended.

cyborgx37 avatar Aug 04 '16 01:08 cyborgx37

dmc test uses the same globbing patterns as a deploy to select which classes to run tests on. Something like this works...

dmc test src/classes/MyTest*

The ability to specify tests methods to run does not currently exist and I'd be happy to entertain a PR for it. It's in my mental backlog of things to add right now.

kevinohara80 avatar Aug 10 '16 16:08 kevinohara80