Provide a more specific error when Running apex tests instead of "Test Ignored"
When you run Apex tests with a depended class that is invalid or needs recompilation, the only error you get is Test Ignored
It would be beneficial to get the more specific error. Example.
OpportunityTrigger calls ClassA
ClassA calls ClassB.foo()
ClassB.foo() is updated to ClassB.foo(String bar)
Running classBTest
, that creates an opportunity will show Test Ignored
if since the trigger will invoke ClassA.
In Dev Console in SFDC you will get the following message when you try to run.
line 180, column 48: Dependent class is invalid and needs recompilation:
Comments (4)
-
repo owner -
repo owner Okay, I see what's happening. The error message is being reported in the context of the trigger instead of the test class/method, e.g.:
{ "successes": [], "failures": [ { "type": "Trigger", "namespace": null, "name": "ShoppingListTrigger", "methodName": null, "message": "line 14, column 38: Dependent class is invalid and needs recompilation:\n Class ProductionClass : Method is not visible: void AbandonedShoppingCartRemover.doSomething()", "stackTrace": null, "id": "01q61000000bIeeAAE", "seeAllData": true, "time": -1.0, "packageName": "ShoppingListTrigger" } ], "totalTime": 0.0, "apexLogId": null, "numTestsRun": 0, "codeCoverage": [], "codeCoverageWarnings": [], "numFailures": 1 }
The IC test runner then tries to write the information to a node in the tree with that name, but we never ran a test class/method with that trigger's name. And unfortunately there's no concrete tie-back to the test class/method in the provided error at all.
I should be able to log it at the root level of the tree. I'll try to include that in the next build.
-
repo owner - changed status to resolved
Delivered in 1.8.2.2 and 2.0.1.3.
-
repo owner - changed component to Apex Unit Testing
- Log in to comment
Mike, what version of IC are you running? I've been trying to address these "Test Ignored" issues in the last few builds. There's one more instance of it that a user has reported that I'm going to try to address this weekend, but if you're not on the most recent build of IC, please make sure to update and see if it helps.