Adding a new unit test framework to the line marker

Answered

I'm looking at integrating a unit test framework into my plugin. I have seen https://intellij-support.jetbrains.com/hc/en-us/community/posts/206103879-Graphical-integration-of-running-tests-in-plugin about integrating it with the test result tree/run console -- this is helpful.

I'm trying to figure out how to get the "Run Test" line marker working for modules and test functions identified by my plugin, with the standard test context menu. In addition I am trying to understand how to get the "test failed"/"test passed" state indicated in the line markers. What classes/interfaces/services do I need to implement to achieve this?

Thanks,

Reece

6 comments
Comment actions Permalink

See com.intellij.testIntegration.TestRunLineMarkerProvider for Java solution

0
Comment actions Permalink

Thanks for the reference. I now have the run icons appearing in the gutter, but clicking on them is showing "Nothing here" in the popup menu.

I'm implementing RunLineMarkerContributor via the runLineMarkerContributor endpoint. My getInfo method is using ExecutorAction.getActions(1) to get the actions (via the RunLineMarkerContributor#withExecutorActions helper method) -- that is returning the correct AnAction list, and the getPopupMenuActions function in RunLineMarkerProvider looks to be returning the correct values in the action group.

0
Comment actions Permalink

Please try debugging com.intellij.execution.lineMarker.RunLineMarkerProvider.RunLineMarkerInfo#RunLineMarkerInfo CTOR

0
Comment actions Permalink

The values in that constructor look correct.

Investigating further, I think it is because the calls to ExecutorAction#getConfigurations are returning an empty sequence. Do you know where I should be looking? -- I have a configuration type registered for the test run configuration, and have that displaying and working in the Run/Debug Configurations dialog (although I don't currently have that working with the test console yet).

0
Comment actions Permalink

I've done a bit more digging and it looks like I need to implement the runConfigurationProducer endpoint using the LazyRunConfigurationProducer base class.

0
Comment actions Permalink

Implementing runConfigurationProducer works. Thanks for your help.

0

Please sign in to leave a comment.