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

Bugfix/224 all kinds of fixes #233

Merged
merged 31 commits into from
Feb 5, 2024
Merged

Bugfix/224 all kinds of fixes #233

merged 31 commits into from
Feb 5, 2024

Conversation

lheimbs
Copy link
Contributor

@lheimbs lheimbs commented Feb 3, 2024

Soooooooo...

this is a lot.
I'm sorry.

We'll have to see if we really want to accept this right before the final release.
Might also have to merge this afterwards.

Changes

Companion plugin

  1. add task to check for the other plugins

Intellij plugin

  1. PluginCheck: Check first if new task is available and then the task is executed before running a pitest task and the tasks output tells us if the pitest plugin is loaded.
  2. PluginCheck: Checks are only ever run when executing pitest. No other times.
  3. PluginCheck: Also error info is show in the tool window but other than that there is only a small tooltip when an error is detected. No disabling anything anymore.
  4. Removed all file listener and file parsing shenanigans
  5. Gradle can give us test folders when an intellij idea is used so added that to the testenv checker
  6. Fixed a bug where right click on the gutter icon caused an exception
  7. Slightly adjusted the annotations (IP wanted less intrusive killed display)
  8. Cleaned up the tool window factory.
  9. Allow users to add gradle cli options in settings. Also shows what is selected in settings better.

This fixes #213 #224 #228 and also most of the issues found by the IP.

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
also uses variables for versions as suggested by sonarlint

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
IPs didn't care about getting a warning on project boot.
So to simplify things we'll drop the listener and only analyze the plugins
when the user runs an action.

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
This lets us use this also in dynamically created actions which can't inherit from this.

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
To enable right clicking, the Gutter action will be created dynamically.
The hover action was not used for a long time.

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
This completely dumps any parsing of files in favor of a gradle task
registered by the compagnion plugin which existence signals the
presence of the compagnion. In turn the compagnion task check for the
solidsoft and driodsondriods plugins and prints then in json form
in the gradle task. If we then parse the output of that task
we get the presence of the pitest plugins.

The gradle task is also able to get the available android build types.
Sadly i still haven't found a way to get the currently set build type.
I think that information mainly lives in the intellij android plugin...

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Needed to dynamically create the action for that for some reason.
Has something to do with the ExecutorAction stuff from the docs but
honestly I didn't quite get it.

Anyways this was the reason for putting the action exection method in a non-action class

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
IP what they are doing and outright disabling them to do things is not nice.

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Killed/No Coverage wont result in a code annotation anymore.
Might still need adjusting based on users needs...

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Also changing of contents has been moved into tab specific utility funcitons

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Now applies then correctly to the command

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
As stated before, we are only checking for missing plugins here.
This simplifies things and gives users more freedom.
Also no more hard error message, only a nudge from the tool window tooltip that something is amiss.

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
This only queries gradle for build infos and updates the last found result.
All other file watching etc was dropped.

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Shoud be more robust with gradle projects.

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
happens when gradle is misconfigured and cannot build

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
@lheimbs lheimbs force-pushed the Bugfix/224-all-kinds-of-fixes branch from be8bfed to 8a273a1 Compare February 4, 2024 13:05
Copy link
Contributor

@nikomall34 nikomall34 left a comment

Choose a reason for hiding this comment

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

Two things that I noticed are that the HistoryTab is not getting updated and the when we run pitest for many classes. So the text in the targetClasses JBTextField is very large you cannot resize the window anymore. This is because of the Layout that the FormBuilder uses I guess. I am currently working on these issues and I think we shouldn't put them in this PR so you can merge it.

@@ -21,19 +23,17 @@ class SettingsEditor : SettingsEditor<RunConfiguration>() {
private val gradleTaskField: TextFieldWithHistory = TextFieldWithHistory()
private val gradleExecutableField: TextFieldWithBrowseButton = TextFieldWithBrowseButton()
private val targetClasses: JBTextField = JBTextField()
private val buildTypesField: JBTextField = JBTextField()
private val buildTypesField: TextFieldWithHistory = TextFieldWithHistory()
private val verboseCheckbox = JCheckBox("Enable Pitest verbose mode")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
private val verboseCheckbox = JCheckBox("Enable Pitest verbose mode")
private val verboseCheckbox = JBCheckBox("Enable Pitest verbose mode")

buildTypesField.text = runConfiguration.buildType
verboseCheckbox.isSelected = runConfiguration.verbose

runConfiguration.project.service<PluginCheckerService>().getBuildTypes().forEach { buildType ->
buildTypesField.history.add(buildType)
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you test this here with the history. Because for me it didn't work. Btw how did you trigger a reset?

var pitestPluginAvailable: Boolean = false
var companionPluginAvailable: Boolean = false
private fun getPitestPluginName(): List<String> {
val isAndroid = pluginCheckData?.androidPitestPluginApplied ?: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
val isAndroid = pluginCheckData?.androidPitestPluginApplied ?: false
val isAndroid = pluginCheckData?.androidPluginApplied ?: false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have applied that in 6a6e788
I also added some more doc string in the pluginchecker in an effort to make things clearer

Signed-off-by: Lennart Heimbs <lennart@heimbs.me>
@lheimbs lheimbs merged commit 8a28224 into main Feb 5, 2024
17 checks passed
@lheimbs lheimbs deleted the Bugfix/224-all-kinds-of-fixes branch February 5, 2024 12:36
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.

Slow operations are prohibited on EDT
2 participants