From f74f6cd32cb6390c7707319f60d0edc6d4cc5dc6 Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Wed, 7 Dec 2022 21:50:34 +0300 Subject: [PATCH 1/2] Add settings design doc (draft version) --- docs/SettingsProperties.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 docs/SettingsProperties.md diff --git a/docs/SettingsProperties.md b/docs/SettingsProperties.md new file mode 100644 index 0000000000..550f87cf60 --- /dev/null +++ b/docs/SettingsProperties.md @@ -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.) \ No newline at end of file From 271b327ef9dafeb3e5617e0e70641c111052d587 Mon Sep 17 00:00:00 2001 From: "Vassiliy.Kudryashov" Date: Thu, 8 Dec 2022 11:22:15 +0300 Subject: [PATCH 2/2] Remove empty "How to test" ending --- docs/SettingsProperties.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/SettingsProperties.md b/docs/SettingsProperties.md index 550f87cf60..29f3ad7cc4 100644 --- a/docs/SettingsProperties.md +++ b/docs/SettingsProperties.md @@ -29,8 +29,4 @@ Upon IntelliJ IDEA start, the UnitTestBot plugin loads its settings and checks w 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.) \ No newline at end of file +* UnitTestBot does not re-write `settings.properties` if the file exists and has already been customized. \ No newline at end of file