Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select Kotlin test src root by default when generating for Kotlin #949 #1074

Merged

Conversation

volivan239
Copy link
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

@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 marked this pull request as ready for review October 5, 2022 16:07
val testRoots = with (testRootsByLanguage.entries) {
filter { it.key == model.codegenLanguage } + filter { it.key != model.codegenLanguage }
}.flatMap { it.value }.toMutableList()

Copy link
Member

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

@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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change default test source root for Kotlin classes
2 participants