Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python and JS support #1197#1199

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tamarinvs19 merged 112 commits intomainfromtamarinvs19/UnitTestBot_Family_PR
Nov 9, 2022
Merged

Conversation

@tamarinvs19
Copy link
Collaborator

Description

We added Python and JavaScript tests generation.

UI

To expand UtBot UI functionality we added next new modules:

  • utbot-ui-common module:

    • in this module we used no language-specific IntelliJ SDK API
    • this gradle module contains common to all languages logic formutbot-intellij to avoid cyclic dependencies in project building
    • LanguageAssistant 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 functions
  • utbot-intellij-python,utbot-intellij-js modules:
    These modules contain language-specific implementations ofLanguageAssistans,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 usedCodegenLanguage should not be used with new languages.

Our solution suggest to use abstract classCgLanguageAssistant 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 deleteCodegenLanguage.JAVA andCodegenLanguage.Kotln, but it is possible if our solution will be approved.
Base implementation forJava andKotlin we have already added inorg.utbot.framework.plugin.api.

Analogically we addedLanguageTestFrameworkManager to organize test framework logic for different languages.

CLI

Modulesutbot-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:

Modulesutbot-python andutbot-js can be used from IntelliJ-plugin and from CLI. They contain independent of PSI logic, for example, languageUtModels, fuzzing and code generation declarated there.

Fixes#1197

Type of Change

Please delete options that are not relevant.

  • Refactoring (typos and non-functional changes)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Automated Testing

We have code examples for testing how UtBot works:

  • utbot-python/samples/
    There are scriptgenerate_test_samples.sh for automatic run generation test from cli andrun_test_samples.sh for run generated tests.
  • utbot-js/samples/

Manual Scenario

  • Open Python-, JavaScript-project in IDEA and run UtBot plugin.
  • Or, generate and run test with CLI.

Checklist (remove irrelevant options):

  • The change followed the style guidelines of the UTBot project
  • Self-review of the code is passed
  • The change contains enough commentaries, particularly in hard-to-understand areas
  • New documentation is provided or existed one is altered
  • No new warnings
  • New tests have been added
  • All tests pass locally with my changes

denis-fokinand others added30 commitsOctober 19, 2022 10:07
tamarinvs19and others added9 commitsOctober 31, 2022 15:07
# 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
rudolf101and others added11 commitsNovember 1, 2022 16:31
# 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
@tamarinvs19tamarinvs19 merged commitef83e13 intomainNov 9, 2022
@tamarinvs19tamarinvs19 deleted the tamarinvs19/UnitTestBot_Family_PR branchNovember 9, 2022 07:36
CaelmBleidd added a commit that referenced this pull requestNov 10, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@tochilinaktochilinaktochilinak left review comments

@rudolf101rudolf101rudolf101 left review comments

@zishkazzishkazzishkaz left review comments

@DamtevDamtevDamtev approved these changes

@denis-fokindenis-fokinAwaiting requested review from denis-fokin

@EgorkaKulikovEgorkaKulikovAwaiting requested review from EgorkaKulikov

@sergeypospelovsergeypospelovAwaiting requested review from sergeypospelov

@MarkoutteMarkoutteAwaiting requested review from Markoutte

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Python and JS support

10 participants

@tamarinvs19@alisevych@Markoutte@denis-fokin@tochilinak@Damtev@rudolf101@zishkaz@GlebSolovev

[8]ページ先頭

©2009-2025 Movatter.jp