Skip to content

Android Studio fixes (#634, #635) #639

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

Merged
merged 1 commit into from
Aug 9, 2022
Merged

Conversation

nikitavlaev
Copy link
Member

@nikitavlaev nikitavlaev commented Aug 1, 2022

Description

Multiple test modules supported.
Removed unused jdkVersion from model, added for convenience to JdkPathService.
Removed unnecessary classpath modification parts for Android.

Fixes #634, #635

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • Refactoring (typos and non-functional changes)

How Has This Been Tested?

Automated Testing

Not applicable.

Manual Scenario

  1. Launch Android Studio
  2. Install plugin
  3. Generate tests for any samples, everything generates without errors.

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

@nikitavlaev nikitavlaev force-pushed the nikitavlaev/android-studio branch from 98e0b54 to 121221d Compare August 1, 2022 17:16
@alisevych
Copy link
Member

alisevych commented Aug 3, 2022

Testing results

I've published the plugin as an archive, installed it on IDEA 2022.1.4 and checked how it works on different projects.
Checked Gradle + JDK 8, Maven + JDK 11, Maven + JDK 13 (checked error from UTBot and changed to JDK 11), IntelliJ + JDK 8.
Checked test generation into correct packages structure.
Checked test generation to a new test source root (Maven, IntelliJ). Blocked for Gradle if test root/roots is/are configured.
Checked test generation when there are several test roots in a project.

The following issue found:

Steps to reproduce:

  1. Create Gradle/Maven/IntelliJ project with JDK 8 / 11
  2. Add some classes to the source root
  3. Remove all Test source root (or unmark folders as Test source roots)
  4. Open UTBot dialog to Create tests

Expected result:

/src/test/utbot-tests is suggested to create as Test sources root

Actual result:

There is test "set test root" in the Test sources root, user needs to manually create the folder and mark it.
In Gradle project - button to manually select/create folders is disabled - so this issue can't be resolved from UTBot dialog.

image

Multiple test modules supported.
Removed unused jdkVersion from model, added for convenience to JdkPathService.
Removed unnecessary classpath modification parts for Android.
@nikitavlaev nikitavlaev force-pushed the nikitavlaev/android-studio branch from 121221d to ffc8bbf Compare August 8, 2022 15:18
@nikitavlaev nikitavlaev enabled auto-merge (rebase) August 9, 2022 05:42
@nikitavlaev nikitavlaev merged commit 540010c into main Aug 9, 2022
@nikitavlaev nikitavlaev deleted the nikitavlaev/android-studio branch August 9, 2022 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Android studio: test generation issues
3 participants