PyCharm plugin: adding python files at deployment, custom project type support, testing custom run configurations
Hi,
I'm writing a custom test runner plugin for PyCharm and have some questions I would like to ask.
1. I implemented a custom run configuration and a _jb_my_own_runner.py script, tested things are working via "Debug Plugin" action. Now I want to package the plugin. If I run "Prepare Plugin Module For Deployment", I get a jar file without the python script. How should I mark the script (probably in the plugin.xml) so it is included?
2. I implemented the runner script based on the article found here: https://confluence.jetbrains.com/display/~link/PyCharm+test+runners+protocol , but I don't see how the name affects the test running logic in PyCharm as the built-in test frameworks use another API (universal tests something), which is not extensible as I see it. Is this article still relevant in any way for the plugin development?
3. Is there an example of writing unit tests for a custom run configuration? Didn't find anything helpful in the examples (http://www.jetbrains.org/intellij/sdk/docs/tutorials/writing_tests_for_plugins.html), maybe there is an access to your own unit tests for PyCharm?
<s>4. Is there an option of implementing a plugin with custom project type in PyCharm Community Edition or are custom project types available only in the Professional Edition?</s>
Actually, found out this one myself: the directoryProjectGenerator extension is responsible for that, works fine with both community and professional editions!
Thanks in advance,
Oleg
P.S. мне можно отвечать по-русски, если Вам так удобнее ;-)
Please sign in to leave a comment.
Hello.
This docment is more about internal test runners structure. Please check https://confluence.jetbrains.com/display/~link/Custom+test+runner+example . In covers latest 2017.2 and future (2017.3) version.
I will investigate how to add helper (py file) to plugin and aswer you later. You can now simply provilde full path to your helper (see doc above) just to make sure it works.
Hi Ilya,
thanks a lot for the detailed example! This is really helpful as I now see that I did my impl pretty close to your example reference. I also noticed that you wrote the example in Kotlin, something that I will also try out.
As for bundling python scripts in plugin, I found one workaround although I can't imagine this the official way doing that. I noticed PyCharm can instal plugins as zip files, so I packed the jar file along with the python sources in a zip archive and PyCharm could install it. I would still be grateful for the info what is the official way of bundling python scripts in a plugin.
Thanks again for your answer,
Oleg