Run configuration for unit testing should allow saving of tests.
Problem
When running tests using the test configuration the test suite is saying no tests were found to run. When accessing the configuration all the checkboxes for the classes in the module are selected. When selecting the proper classes to run in the configuration and hitting the apply button to save and then running the selected test suite, a no tests found message is displayed.
I remember this functionality working correctly for me, but for the past couple of versions I have been unable to get my tests suite to operate correctly.
Expectation
When I am setting up my run/debug configuration test suites and I run them, I expect all the classes that I selected for the test to run in the environment they are configured for.
Comments (19)
-
repo owner -
reporter yes I am using version1.7.0.0.
My IntellJ version is 2016.1 Ultimate Edition.
-
repo owner Thanks for confirming. Let me repeat back the issue you're seeing to make sure I'm trying to reproduce the right thing. Basically you're creating a run configuration where you select one or more test classes and then click either OK or Apply to save that configuration. Then you try to run the configuration and it says no test methods were found. Is that correct? Is there anything about your configuration such as configured namespaces or similar? I ask because the issues that I fixed in 1.7.0.0 were partially due to incorrect name matching because of namespace qualifications in one location not being considered in another.
-
reporter Yes that is the issue I am experiencing.
By configured namespaces are you talking about managed package namespacing or multiple modules in my project?
-
repo owner Anything that might make this different. I just tried to reproduce the issue and wasn't able to do so. I absolutely understand that it's happening to you and will resolve it for you, but my guess is that it's not a pervasive problem or I'd be hearing about it broadly. That makes me guess that there's something in your config that contributes to the problem, and that will be invaluable to me for reproducing and addressing it.
You might send me your
.idea/illuminatedCloud.xml
,.idea/modules.xml
, IC*.iml
files, and perhaps anything inidea.log
that might indicate an issue (primarily exception stack traces). Assuming those contain sensitive information, feel free to scrub them and/or send them via email if you'd like. -
reporter Sure thing. I figured it is probably an isolated case, my colleague right who sits next to me is not having the issue. I will follow up once I get the logs together and make sure they don't contain any confidential information.
Thanks for your support and great job with this plugin, it is making a lot of peoples lives better in the world of SF development.
-
repo owner Andrew, a thought popped into my head on this. Can you rebuild indices and see if that addresses the issue? There are places in the unit test framework implementation where I consult the stored indices to determine which test class/methods are in place. If this is for some reason corrupt/stale, it might lead to the exact behavior that you're seeing. You can do this for just Illuminated Cloud in connection configuration using the Rebuild button, or you can do it for all of IntelliJ using File>Invalidate Caches/Restart. In either case I'd recommend allowing the IDE to restart before rebuilding indices. Please let me know whether that addresses the issue for you or not.
-
reporter Yeah, I can take a whack at it. Sorry the delay, I will get back to you with the results.
-
repo owner No worry on the delay at all. Hopefully this will resolve it for you, but if not, gather the requested info above when you get a chance and I'll figure out what is going on.
-
repo owner Andrew, is still still an issue for you? Trying to organize some bug fixes for the next release and wasn't sure about the status of this one.
-
repo owner - changed status to resolved
Moving this to resolved. If it's still an issue feel free to reopen with details on how to reproduce.
-
Hi Scott,
for completeness I just wanted to add that I was facing the exact same problem described here and it actually could be resolved successfully with the help of File | Invalidate Caches/Restart...
Regards Michael
-
@RoseSilverSoftware I often have this error when I revert old file version from git. Unfortunately, "File | Invalidate Caches/Restart" does not work for me. Not sure what does other than recreating whole project.
This is what appears in log when running such test: Exit code 1
2018-09-15 13:06:02,351 [ 85087] WARN - .ApexUnitTestRunProcessHandler - XmlNodeTest is not a test class. 2018-09-15 13:06:03,286 [ 86022] INFO - .ApexUnitTestRunProcessHandler - Running unit tests synchronously. 2018-09-15 13:06:03,550 [ 86286] WARN - .ApexUnitTestRunProcessHandler - Unexpected status code 403 returned.
-
repo owner @pkozuchowski I'm not sure that I follow the behavior. So basically you have a test class that you've modified, you revert those modifications via Git, and then you try to run that test class and see this behavior? Is that correct? What version of the base IDE and plugin are you using? If you can reproduce this, will you do so with debug logging enabled for unit test execution as documented here:
http://www.illuminatedcloud.com/support/debuglogging
and then provide the resulting
idea.log
? Thanks! -
"So basically you have a test class that you've modified, you revert those modifications via Git, and then you try to run that test class and see this behavior?" That is correct, I was affected by this issue a couple of times in the past and I'm positive that every time it was after GIT reset or checkout. I can see test methods in "Run/Debug configurations", I can see "Run Test" buttons next to each test method/class signature, but running tests always results in "No tests were found" error.
Today, I've tried to invalidate & restart a few times, invalidate and restart separately and it did not help, however generating offline table symbols did help. That's now always the case though, I've had this issue earlier this week and Generate offline symbol did not help, recreating project helped.
IDE and plugin versions: Illuminated Cloud 2.0.3.6 + IntelliJ Ultimate 2018.2.3
-
repo owner That's really strange. The bottom line is that you should never have to recreate a project to continue working with it. Anytime you find yourself having to do that, that's a bug I need to address. It should be a smooth operation of continuing to use and evolve the same project. Please go ahead and enable debug logging for unit testing as described above so it's already in place, then the next time this happens please send me all of your
idea.log*
files so I can do some root cause analysis. -
- attached idea.zip
-
Hi Scott,
I've attached logs with debug enabled.
Kind Regards
-
repo owner - changed component to Apex Unit Testing
- Log in to comment
Andrew, I see a version of 1.7.0.0 here, but I wanted to confirm that was the actual version you were using (I just released it this morning). I fixed some issues in this area as part of 1.7.0.0, but if it's still happening I'll definitely address it.