-
Notifications
You must be signed in to change notification settings - Fork 45
Add settings design doc (draft version) #1492
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
Vassiliy-Kudryashov
merged 3 commits into
main
from
Vassiliy-Kudryashov/settings_design_doc
Dec 8, 2022
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # Configuring UnitTestBot with auto-generated `settings.properties` | ||
|
|
||
| Common users usually change UnitTestBot settings via UI: | ||
| * in the **Generate Tests with UnitTestBot** dialog, | ||
| * through **File** > **Settings** > **Tools** > **UnitTestBot**. | ||
|
|
||
| Advanced users and contributors require advanced settings. | ||
|
|
||
| ## How to configure advanced settings: motivation to improve | ||
|
|
||
| Advanced settings were not visible in UnitTestBot UI and were configurable only via `settings.properties`. | ||
| UnitTestBot did not provide this file by default, so you had to create it manually in your `{home}/.utbot` directory. | ||
| You could configure advanced settings here if you knew available options — they are listed in UnitTestBot source code, | ||
| namely, `UtSettings.kt`. As UnitTestBot is a developing product, it often gets new features and new settings | ||
| that UnitTestBot users sometimes are not aware of. | ||
|
|
||
| ## Implemented `settings.properties` improvements | ||
|
|
||
| Currently, UnitTestBot generates a template `settings.properties` file with the up-to-date list of available setting | ||
| options, corresponding default values, and explicit descriptions for each option. | ||
|
|
||
| This template file is auto-generated on the basis of `UtSettings.kt` doc comments. It consists of | ||
| the commented lines, so you can uncomment the line to enable the setting or easily get back to defaults. | ||
|
|
||
| Generating `settings.properties` is a part of a Gradle task in IntelliJ IDEA. The `settings.properties` file is | ||
| bundled with the published UnitTestBot plugin as a top-level entry inside the `utbot-intellij-{version}.jar` file. | ||
|
|
||
| Upon IntelliJ IDEA start, the UnitTestBot plugin loads its settings and checks whether the template setting file exists | ||
| in the local file system as `{home}/.utbot/settings.properties`: | ||
| * If there is no such file, it is created (along with the hidden `{home}/.utbot` directory if needed). | ||
| * An existing file is updated with new settings and corresponding info if necessary. | ||
| * UnitTestBot does not re-write `settings.properties` if the file exists and has already been customized. | ||
|
|
||
| ## How to test `settings.properties` auto-generation | ||
|
|
||
| [//]: # (For testing scenarios, please refer to #TODO.) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.