mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
rerun failed: choose GlobalSearchScope if initial configuration was configured to run in project (IDEA-141481)
This commit is contained in:
@@ -34,6 +34,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.GlobalSearchScopesCore;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
@@ -46,6 +47,7 @@ class TestDirectory extends TestPackage {
|
||||
super(configuration, environment);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public SourceScope getSourceScope() {
|
||||
final String dirName = getConfiguration().getPersistentData().getDirName();
|
||||
|
||||
@@ -24,8 +24,11 @@ import com.intellij.execution.configurations.RunConfigurationModule;
|
||||
import com.intellij.execution.junit2.info.MethodLocation;
|
||||
import com.intellij.execution.runners.ExecutionEnvironment;
|
||||
import com.intellij.execution.testframework.AbstractTestProxy;
|
||||
import com.intellij.execution.testframework.SourceScope;
|
||||
import com.intellij.execution.testframework.TestSearchScope;
|
||||
import com.intellij.idea.ActionsBundle;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.PsiClass;
|
||||
@@ -57,7 +60,8 @@ public class TestMethods extends TestMethod {
|
||||
final JUnitConfiguration.Data data = getConfiguration().getPersistentData();
|
||||
RunConfigurationModule module = getConfiguration().getConfigurationModule();
|
||||
final Project project = module.getProject();
|
||||
final GlobalSearchScope searchScope = getConfiguration().getConfigurationModule().getSearchScope();
|
||||
final SourceScope scope = getSourceScope();
|
||||
final GlobalSearchScope searchScope = scope != null ? scope.getGlobalSearchScope() : GlobalSearchScope.allScope(project);
|
||||
addClassesListToJavaParameters(myFailedTests, new Function<AbstractTestProxy, String>() {
|
||||
@Override
|
||||
public String fun(AbstractTestProxy testInfo) {
|
||||
@@ -68,6 +72,11 @@ public class TestMethods extends TestMethod {
|
||||
return javaParameters;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean configureByModule(Module module) {
|
||||
return super.configureByModule(module) && getConfiguration().getPersistentData().getScope() != TestSearchScope.WHOLE_PROJECT;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getTestPresentation(AbstractTestProxy testInfo, Project project, GlobalSearchScope searchScope) {
|
||||
final Location location = testInfo.getLocation(project, searchScope);
|
||||
|
||||
@@ -59,6 +59,7 @@ import com.intellij.util.PathUtil;
|
||||
import jetbrains.buildServer.messages.serviceMessages.ServiceMessageTypes;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jps.model.serialization.PathMacroUtil;
|
||||
|
||||
import java.io.File;
|
||||
@@ -127,6 +128,7 @@ public abstract class TestObject extends JavaTestFrameworkRunnableState<JUnitCon
|
||||
getConfiguration().getConfigurationModule().getModule());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public SourceScope getSourceScope() {
|
||||
return SourceScope.modulesWithDependencies(getConfiguration().getModules());
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ public class TestPackage extends TestObject {
|
||||
super(configuration, environment);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public SourceScope getSourceScope() {
|
||||
final JUnitConfiguration.Data data = getConfiguration().getPersistentData();
|
||||
|
||||
Reference in New Issue
Block a user