RFR: 7903965: Fix Launching Tests from Context Menu [v6]
Oleksii Sylichenko
duke at openjdk.org
Tue Mar 11 19:58:57 UTC 2025
On Tue, 11 Mar 2025 17:39:32 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Oleksii Sylichenko has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Revert: prevent configuration creation when multiple files or directories are selected
>
> plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/producers/JTRegConfigurationProducer.java line 112:
>
>> 110: element = findExactRunElement(element);
>> 111:
>> 112: configuration.setQuery(getQuery(element));
>
> Suggestion:
>
> preventRunPriorityLoss(element, sourceElement);
> element = findExactRunElement(element);
> configuration.setQuery(getQuery(element));
done
> plugins/idea/src/main/java/com/oracle/plugin/jtreg/configuration/producers/JTRegConfigurationProducer.java line 127:
>
>> 125: * The class {@link com.intellij.execution.actions.PreferredProducerFind} sorts the applicable runners using
>> 126: * {@link com.intellij.execution.actions.ConfigurationFromContext#COMPARATOR},
>> 127: * removing more general ones and retaining more specific or equal configurations.
>
> The last line in this paragraph is a bit vague. The key issue here is that the IDE prefers config A over config B, if the `sourceElement` of A is nested somewhere inside B. So, we essentially use a hack here, by choosing one of the classes nested in the file that we are trying to run, so that we don't get beaten in the sorting order.
>
> Just wanted to mention this for posterity. Maybe this could be called out explicitly:
>
> Suggestion:
>
> * The class {@link com.intellij.execution.actions.PreferredProducerFind} sorts the applicable runners using
> * {@link com.intellij.execution.actions.ConfigurationFromContext#COMPARATOR}. This comparator prefers
> * configuration A over configuration B, when the source element of A is nested in B.
done
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/252#discussion_r1990036644
PR Review Comment: https://git.openjdk.org/jtreg/pull/252#discussion_r1990036941
More information about the jtreg-dev
mailing list