-
Notifications
You must be signed in to change notification settings - Fork 47
Python and JS support #1197 #1199
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? No Sign in to your account
Merged
Merged
Conversation
This file contains hidden or 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
# Conflicts: # utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgMethodConstructor.kt # utbot-intellij/build.gradle.kts # utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/actions/GenerateTestsAction.kt
…R' into tamarinvs19/UnitTestBot_Family_PR
…R' into tamarinvs19/UnitTestBot_Family_PR
Damtev
approved these changes
Nov 1, 2022
# Conflicts: # utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/CodeGenerator.kt # utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgTestClassConstructor.kt # utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/visitor/CgAbstractRenderer.kt
# Conflicts: # utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgTestClassConstructor.kt # utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/visitor/CgAbstractRenderer.kt # utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator/CodeGenerationController.kt
…R' into tamarinvs19/UnitTestBot_Family_PR # Conflicts: # utbot-js/src/main/kotlin/service/BasicCoverageService.kt
# Conflicts: # utbot-ui-commons/src/main/kotlin/org/utbot/intellij/plugin/ui/components/TestFolderComboWithBrowseButton.kt
This was referenced Nov 9, 2022
CaelmBleidd
added a commit
that referenced
this pull request
Nov 10, 2022
No Sign up for free
to join this conversation on GitHub.
Already have an account?
No Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
We added Python and JavaScript tests generation.
UI
To expand UtBot UI functionality we added next new modules:
utbot-ui-common
module:utbot-intellij
to avoid cyclic dependencies in project buildingLanguageAssistant
access to dynamically connect API from language dependent modules. Now exists Python, JS and JVM assistants.BaseTestModel
- parent class forPythonTestModel
,JsTestModel
andGenerateTestModel
. This class was created becauseGenerateTestModel
use JVM specific functionsutbot-intellij-python
,utbot-intellij-js
modules:These modules contain language-specific implementations of
LanguageAssistans
,BaseTestModel
,DialogWindow
and other classes.Code generation
Previous solution of the problem with different logic for different languages (Java and Kotlin) in code generation which used
CodegenLanguage
should not be used with new languages.Our solution suggest to use abstract class
CgLanguageAssistant
which contains information about code generation language (e.g.languageKeywords
, getters forCgNameGenerator
,CgMethodConstructor
...). In language-specific modules we can create implementations with language-specific logic.We did not delete
CodegenLanguage.JAVA
andCodegenLanguage.Kotln
, but it is possible if our solution will be approved.Base implementation for
Java
andKotlin
we have already added inorg.utbot.framework.plugin.api
.Analogically we added
LanguageTestFrameworkManager
to organize test framework logic for different languages.CLI
Modules
utbot-cli-python
andutbot-cli-js
contain command line generation and run tests interface for Python and JavaScript. They depends onutbot-cli
module.Main language modules:
Modules
utbot-python
andutbot-js
can be used from IntelliJ-plugin and from CLI. They contain independent of PSI logic, for example, languageUtModel
s, fuzzing and code generation declarated there.Fixes #1197
Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Automated Testing
We have code examples for testing how UtBot works:
utbot-python/samples/
There are script
generate_test_samples.sh
for automatic run generation test from cli andrun_test_samples.sh
for run generated tests.utbot-js/samples/
Manual Scenario
Checklist (remove irrelevant options):