GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Select Kotlin test src root by default when generating for Kotlin #949 by volivan239 · Pull Request #1074 · UnitTestBot/UTBotJava

Conversation

@volivan239

@volivan239 volivan239 commented Oct 4, 2022

Copy link
Copy Markdown
Collaborator

Description

Now, if project has both Java and Kotlin tests source roots, UTBot by default selects one that matches code generation language.

Note that currently there is no proper way to check whether source root is for Java or for Kotlin, so we mainly decide this by folder name (see org.utbot.intellij.plugin.ui.utils.ModuleUtilsKt#getExpectedLanguageForTests and comment there).

Fixes #949

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manual Scenario

Repeated scenario from #949 -- works as expected.

Checklist (remove irrelevant options):

This is the author self-check list

  • 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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@volivan239
volivan239 force-pushed the volivan239/change_default_test_source_root_for_kotlin branch from 8d69150 to 49bf74b Compare October 5, 2022 15:23
@volivan239
volivan239 requested a review from Vassiliy-Kudryashov October 5, 2022 15:24
@volivan239
volivan239 marked this pull request as ready for review October 5, 2022 16:07
Vassiliy-Kudryashov
Vassiliy-Kudryashov reviewed Oct 7, 2022
View reviewed changes
Comment thread ...j/src/main/kotlin/org/utbot/intellij/plugin/ui/components/TestFolderComboWithBrowseButton.kt
val testRoots = with (testRootsByLanguage.entries) {
filter { it.key == model.codegenLanguage } + filter { it.key != model.codegenLanguage }
}.flatMap { it.value }.toMutableList()

@Vassiliy-Kudryashov Vassiliy-Kudryashov Oct 7, 2022

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use sorting instead of filtering

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
volivan239 added 2 commits October 10, 2022 10:04
@volivan239
Select Kotlin test src root by default when generating for Kotlin
e68a3c9
@volivan239
Move testsourceroot-choosing heuristics from ModuleUtils to TestFolde…
7c6ab37
…rCombo
@volivan239
volivan239 force-pushed the volivan239/change_default_test_source_root_for_kotlin branch from 49bf74b to 7c6ab37 Compare October 10, 2022 08:40
@volivan239
volivan239 requested a review from Vassiliy-Kudryashov October 10, 2022 08:40
Vassiliy-Kudryashov
Vassiliy-Kudryashov approved these changes Oct 10, 2022
View reviewed changes
@volivan239
volivan239 enabled auto-merge (squash) October 10, 2022 08:45
@volivan239
volivan239 merged commit 59f276d into main Oct 10, 2022
@volivan239
volivan239 deleted the volivan239/change_default_test_source_root_for_kotlin branch October 10, 2022 10:11
viktoriia-fomina pushed a commit that referenced this pull request Oct 12, 2022
@volivan239 @viktoriia-fomina
Select Kotlin test src root by default when generating for Kotlin #949 (
6a00141
#1074)
AbdullinAM pushed a commit to AbdullinAM/UTBotJava that referenced this pull request Oct 17, 2022
@volivan239 @AbdullinAM
Select Kotlin test src root by default when generating for Kotlin Uni…
df18efe
…tTestBot#949 (UnitTestBot#1074)
AbdullinAM pushed a commit to AbdullinAM/UTBotJava that referenced this pull request Oct 17, 2022
@volivan239 @AbdullinAM
Select Kotlin test src root by default when generating for Kotlin Uni…
166b393
…tTestBot#949 (UnitTestBot#1074)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Vassiliy-Kudryashov Vassiliy-Kudryashov Vassiliy-Kudryashov approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Change default test source root for Kotlin classes

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@volivan239 @Vassiliy-Kudryashov
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.