Allow the option to run unit tests by ID instead of by name to avoid failures when named test classes/methods are missing

Issue #2387 open
John De Santiago created an issue

In my scenario, some class files are uncompilable in a shared dev sandbox environment due to a dependency change. During this state, all test execution is blocked. However, the issue is in a part of the code base unrelated to what I am developing and is being worked on by a different team. The class file with the dependency error won’t be executed as part of my isolated test run. Still, because of this issue, I can’t run any tests using IC.

In a perfect world, I would have a unique dev sandbox, but given our current workflow, I have to deal with this as is. I noticed VS Code and even Apex Test Runner in setup does not have this limitation and will execute the requested tests just fine.

Is there a way for IC to ignore unrelated compile errors during test execution?

Comments (4)

  1. Scott Wells repo owner
    • changed status to open

    Yeah, this is a long-standing issue with the API used by IC2 for test execution where it doesn't always allow a partial test execution based on the request. IC2 currently uses the API where you specify test classes and methods by name instead of by ID, and it's sometimes (but not always) an all-or-nothing proposition. The API that accepts test class IDs seems more robust, but it requires IC2 to execute one additional step to resolve names to IDs to ensure a proper request. In densely-populated orgs, that additional step can be quite expensive.

    In a perfect world, the name-based API would be more accepting of malformed/partially-formed requests and/or server states. I'll bring that up again with Salesforce, but if there's not a server-side resolution in the works, I may have to look at allowing execution by ID again, even if just as an option.

  2. Log in to comment