-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Vassiliy.Kudryashov <[email protected]>
- Loading branch information
1 parent
9fd7984
commit c5a1926
Showing
11 changed files
with
781 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...python/src/main/kotlin/org/utbot/intellij/plugin/python/ui/actions/GenerateTestsAction.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.utbot.intellij.plugin.python.ui.actions | ||
|
||
import com.intellij.openapi.actionSystem.ActionUpdateThread | ||
import com.intellij.openapi.actionSystem.AnAction | ||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.components.service | ||
import org.utbot.intellij.plugin.language.agnostic.LanguageAssistant | ||
import org.utbot.intellij.plugin.settings.Settings | ||
|
||
class GenerateTestsAction : AnAction() { | ||
override fun actionPerformed(e: AnActionEvent) { | ||
LanguageAssistant.get(e)?.actionPerformed(e) | ||
} | ||
|
||
override fun update(e: AnActionEvent) { | ||
val languageAssistant = LanguageAssistant.get(e) | ||
if (languageAssistant == null) { | ||
e.presentation.isEnabled = false | ||
} else { | ||
languageAssistant.update(e) | ||
} | ||
} | ||
|
||
override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT | ||
} |
50 changes: 50 additions & 0 deletions
50
utbot-intellij-python/src/main/resources/META-INF/plugin.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!--suppress HttpUrlsUsage --> | ||
<idea-plugin> | ||
|
||
<id>org.utbot.python</id> | ||
<name>UnitTestBot for Python</name> | ||
<vendor>utbot.org</vendor> | ||
<depends>com.intellij.modules.platform</depends> | ||
|
||
<depends config-file="withPython.xml">com.intellij.modules.python</depends> | ||
|
||
<actions> | ||
<action id="org.utbot.intellij.plugin.python.ui.actions.GenerateTestsAction" | ||
class="org.utbot.intellij.plugin.python.ui.actions.GenerateTestsAction" | ||
text="Generate Tests with UnitTestBot..." | ||
description="Cover code with auto-generated tests"> | ||
<add-to-group group-id="ProjectViewPopupMenu"/> | ||
<keyboard-shortcut keymap="$default" first-keystroke="alt shift U"/> | ||
<keyboard-shortcut keymap="$default" first-keystroke="alt U" second-keystroke="alt T"/> | ||
</action> | ||
</actions> | ||
|
||
<extensions defaultExtensionNs="com.intellij"> | ||
<projectConfigurable dynamic="true" parentId="tools" instance="org.utbot.intellij.plugin.settings.Configurable" | ||
id="org.utbot.intellij.plugin.settings.Configurable" | ||
displayName="UnitTestBot"/> | ||
<!--suppress PluginXmlValidity --> | ||
</extensions> | ||
|
||
<!-- Minimum and maximum build of IDE compatible with the plugin --> | ||
<description> | ||
<![CDATA[ | ||
UnitTestBot is the tool for automated unit test generation and precise code analysis. | ||
<br/><br/> | ||
Discover UnitTestBot key features in our latest release: | ||
<ul> | ||
<li>generating ready-to-use test cases — with valid inputs, method bodies, assertions, and comments</li> | ||
<li>maximizing <a href="https://en.wikipedia.org/wiki/Code_coverage">branch coverage</a> in <i>regression suite</i> while keeping the number of tests minimized</li> | ||
<li>finding deeply hidden code defects and expressing them as tests</li> | ||
<li>smart fuzzing platform</li> | ||
</ul> | ||
Try <a href="https://www.utbot.org/demo/?language=Python">UnitTestBot online demo</a> to see how it generates tests for your code in real time. | ||
<br/> | ||
Contribute to UnitTestBot via <a href="https://github.com/UnitTestBot/UTBotJava/blob/main/CONTRIBUTING.md">GitHub</a>. | ||
<br/> | ||
Found a bug? File an <a href="https://github.com/UnitTestBot/UTBotJava/issues">issue</a>. | ||
<br/> | ||
Have an idea? Start a <a href="https://github.com/UnitTestBot/UTBotJava/discussions">discussion</a>. | ||
]]> | ||
</description> | ||
</idea-plugin> |
4 changes: 4 additions & 0 deletions
4
utbot-intellij-python/src/main/resources/META-INF/pluginIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions
4
utbot-intellij-python/src/main/resources/META-INF/withPython.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<!--Optional dependency on com.intellij.modules.python--> | ||
<extensions defaultExtensionNs="com.intellij"> | ||
<depends>com.intellij.modules.python</depends> | ||
</extensions> |
5 changes: 5 additions & 0 deletions
5
utbot-intellij-python/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# suppress inspection "HttpUrlsUsage" for whole file | ||
backing.service.possibleEndpoints=http://utbot.org | ||
backing.service.urlPath=/utbot/errors | ||
backing.service.port=11000 | ||
request.timeoutMillis=5000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Configuration> | ||
<Appenders> | ||
<!-- Idea catches plugin stdout log and wraps it in its own format, so in IDE only message is logged--> | ||
<Console name="IdeaAppender" target="SYSTEM_OUT"> | ||
<PatternLayout pattern="| UtBot - %-25c{1} | %msg%n"/> | ||
</Console> | ||
<!-- When working as separate process - temporary log4j2.xml would be created, in which --> | ||
<!-- substring `ref="IdeaAppender"` will be replaced with `ref="EngineProcessAppender"` --> | ||
<!-- delete_this_comment_key identifies lines which will be deleted prior creating temp log4j2.xml --> | ||
<!-- You can set bufferIO=true and immediateFlush=false for better performance, --> | ||
<!-- but possibly lose some logs on process death - log4j2 service might die unflushed --> | ||
<!--delete_this_comment_key | ||
<RollingFile append="true" name="EngineProcessAppender" bufferedIO="false" immediateFlush="true" fileName="${env:UTBOT_LOG_DIR}utbot-engine-current.log" filePattern="${env:UTBOT_LOG_DIR}utbot-engine-%i.log" bufferSize="1048576"> | ||
<PatternLayout pattern="%d{HH:mm:ss.SSS} | %-5level | %-25c{1} | %msg%n"/> | ||
<Policies> | ||
<SizeBasedTriggeringPolicy size="20 MB"/> | ||
</Policies> | ||
<DefaultRolloverStrategy max="10"/> | ||
</RollingFile> | ||
delete_this_comment_key--> | ||
</Appenders> | ||
<Loggers> | ||
<Logger name="org.utbot.intellij" level="info" additivity="false"> | ||
<AppenderRef ref="IdeaAppender"/> | ||
</Logger> | ||
<Logger name="org.utbot" level="info" additivity="false"> | ||
<AppenderRef ref="IdeaAppender"/> | ||
</Logger> | ||
<Root level="error"> | ||
<AppenderRef ref="IdeaAppender"/> | ||
</Root> | ||
</Loggers> | ||
</Configuration> |
Oops, something went wrong.