Tests Ignored - No Compilation Issues

3,326 views
Skip to first unread message

James Young

unread,
Dec 5, 2017, 11:23:14 AM12/5/17
to Illuminated Cloud General Discussion
Hey All,

I am trying to run all of my Unit Tests and they repeatedly get entirely ignored. I am running Windows 10 with IC on IJ Community 2017.3

A few additional details:

1) I can run indiviual test/test classes without issue - this is a short-term workaround, but takes a lot of manual effort so I'd rather not have to do it for long
2) I tried the compile all code option in the Setup interface - no issues there
3) I tried reloading the local objects table
4) I have tried turning it off and back on again (restarting IntelliJ, Rebooting my machine)

Any ideas on what I could check next?

sc...@illuminatedcloud.com

unread,
Dec 5, 2017, 11:28:37 AM12/5/17
to Illuminated Cloud General Discussion
James, when this happens the underlying cause is almost always a bad compilation state in the org. The easiest way to find the particular problem(s) is to log into the Salesforce org, navigate into the Setup menu and then to Apex Classes, and click Compile All Classes. That will show you which classes are in a bad state. Once those problems are remedied the tests should run just fine.

Unfortunately there's no public API for Compile All Classes or I'd integrate it into IC, and when the org is in this state the test runner just omits results for failing tests, hence the "Ignored" state in IC.

Please let me know if that doesn't help you get past this issue, and I apologize for the vague form that it takes.

Regards,
Scott Wells

James Young

unread,
Dec 5, 2017, 11:36:57 AM12/5/17
to Illuminated Cloud General Discussion
Hey Scott,

Thanks for responding - I saw this response on a previous message, so I had already tried it (It was my point #2 above).

I got no errors, but still have the problem with IC.

sc...@illuminatedcloud.com

unread,
Dec 5, 2017, 11:45:55 AM12/5/17
to Illuminated Cloud General Discussion
Ah, I see that now. So sorry I just evidently glossed over that assuming this was the same old, same old. Let's do this...please add the following under Help>Debug Log Settings and let's reproduce the issue with a detailed log of the test run:

#com.illuminatedcloud.intellij.unittest.ApexUnitTestRunProcessHandler


Then send me your idea.log so I can take a close look and see if there's anything obvious in there. Might help me to provide better end user feedback on these types of issues as well.

Regards,
Scott

James Young

unread,
Dec 5, 2017, 11:52:18 AM12/5/17
to Illuminated Cloud General Discussion
Sent.

sc...@illuminatedcloud.com

unread,
Dec 5, 2017, 11:56:56 AM12/5/17
to Illuminated Cloud General Discussion
Okay, so here's the problem from the log:

2017-12-05 10:46:54,743 [1385476]  DEBUG - .ApexUnitTestRunProcessHandler - Posting the following to runTestsAsynchronous: 
2017-12-05 10:46:54,743 [1385476]  DEBUG - .ApexUnitTestRunProcessHandler -   {"tests":[{"className":...}]} 
2017-12-05 10:46:57,194 [1387927]   WARN - cloud.client.ForceComApiClient - Status code 403 returned trying to retrieve 'https://....my.salesforce.com/services/data/v41.0/tooling/runTestsAsynchronous/': Forbidden 
2017-12-05 10:46:57,194 [1387927]   WARN - .ApexUnitTestRunProcessHandler - Null async Apex job ID returned from queue request. 

I've seen this happen a handful of times recently but am not 100% sure why. It seems to have started with Winter '18, though, when Salesforce added the ability to run tests by name instead of ID. Let me reach out to my Salesforce contacts and see if they know why that might be happening.

In the interim, I'd be curious to know if you turn off the All Tests flag on the run configuration and instead explicitly select all test classes/methods, does the same thing occur? Perhaps IC is adding something to the All Tests config that shouldn't be added? If it does occur, is there some class or method in the set of those selected that is causing this?

I'll let you know what I figure out. Thanks for providing the log!

Regards,
Scott

James Young

unread,
Dec 5, 2017, 1:12:59 PM12/5/17
to Illuminated Cloud General Discussion
I found the problem, it turns out I'm a bit of a dummy.

I didn't notice that the local version of the code I was working with still had a test class in it that was not on the server (it had recently been refactored away on a separate machine and I didn't properly sync the metadata on my local machine). When I deleted it from the local project (and removed it from the test suite), all worked as it should.

May help you deduce what causes the error message in the log you found, but this specific instance was definitely user error.

sc...@illuminatedcloud.com

unread,
Dec 5, 2017, 1:25:49 PM12/5/17
to discu...@illuminatedcloud.com
Thanks for letting me know. Makes total sense. Winter '18 added the ability to run tests by name so IC doesn't query test class IDs anymore. That actually acted as a bit of a filter for things that exist locally but not on the server, so that's why this happens now but didn't before. I think I probably just need to communicate this particular issue to the user more clearly to help guide them to the solution.

Regards,
Scott

Reply all
Reply to author
Forward
0 new messages