How to load a plugin during execution of unittests - IdeaTestCase.


I am working on a custom plugin which extends Python plugin. The IdeaTestCase written for the plugin are failing as PythonId plugin is not loaded during tests execution. Can you tell me how to load a plugin (in this case PythonId) during execution of IdeaTestCase? As PythonId plugin depends on yaml plugin - does this also gets loaded automatically or do I need to do something to load yaml plugin also?


Comment actions Permalink

do you have Python plugin defined as < depends >
in your own plugin.xml? did you set -Didea.home.path to point to your IDEA sources?

Comment actions Permalink

Yes, python plugin is defined as <depends> .. in my plugin.xml.
Does order of idea.plugins.path matter? python.jar comes before yaml.jar, I think this should be fine.

Here is the stack trace:

Plugin "MyPlugin" was not loaded: required plugin "Pythonid" not installed.:
    at IntellijTestSuite$1.processError(
    at com.intellij.testFramework.TestLogger.error(
    at com.intellij.openapi.diagnostic.Logger.error(
    at com.intellij.ide.plugins.PluginManager.prepareLoadingPluginsErrorMessage(
    at com.intellij.ide.plugins.PluginManager.initializePlugins(
    at com.intellij.ide.plugins.PluginManager.getPlugins(
    at com.intellij.openapi.application.impl.ApplicationImpl.loadApplicationComponents(
    at com.intellij.openapi.application.impl.ApplicationImpl.<init>(
    at com.intellij.openapi.application.ex.ApplicationManagerEx.createApplication(
    at com.intellij.idea.CommandLineApplication.<init>(
    at com.intellij.idea.CommandLineApplication.<init>(
    at com.intellij.idea.IdeaTestApplication.<init>(
    at com.intellij.idea.IdeaTestApplication.getInstance(
    at com.intellij.testFramework.PlatformTestCase.initApplication(
    at com.intellij.testFramework.PlatformTestCase.setUp(
    at MyPluginTest.setUp(
    at com.intellij.testFramework.PlatformTestCase$
    at java.awt.event.InvocationEvent.dispatch(
    at java.awt.EventQueue.dispatchEvent(
    at java.awt.EventDispatchThread.pumpOneEventForFilters(
    at java.awt.EventDispatchThread.pumpEventsForFilter(
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(
    at java.awt.EventDispatchThread.pumpEvents(
    at java.awt.EventDispatchThread.pumpEvents(

Comment actions Permalink

did you add all required dependent plugins (and their dependents) to your IDEA JDK?

Comment actions Permalink

When I run the test from IDE, it works fine.
I am trying to run the test from command line by passing the flags (like: idea.plugins.path etc). The test fails during command line execution.

Is there a way to get more verbose error message from Idea? [Instead of just failed to install plugin PythonId]. I think, that helps in debugging the problem.



Please sign in to leave a comment.