mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EDU-608 Execute "tests.py" action doesn't create Run Study Tests configuration
This commit is contained in:
+8
@@ -14,6 +14,8 @@ import com.jetbrains.edu.learning.courseFormat.Task;
|
||||
import com.jetbrains.edu.learning.courseFormat.TaskFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class CCVirtualFileListener extends VirtualFileAdapter {
|
||||
|
||||
@Override
|
||||
@@ -33,6 +35,12 @@ public class CCVirtualFileListener extends VirtualFileAdapter {
|
||||
}
|
||||
|
||||
String name = createdFile.getName();
|
||||
|
||||
CCLanguageManager manager = CCUtils.getStudyLanguageManager(course);
|
||||
if (manager != null && manager.doNotPackFile(new File(createdFile.getPath()))) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (CCUtils.isTestsFile(project, createdFile)
|
||||
|| StudyUtils.isTaskDescriptionFile(name)
|
||||
|| name.contains(EduNames.WINDOW_POSTFIX)
|
||||
|
||||
+6
-3
@@ -26,6 +26,8 @@ import com.jetbrains.python.run.CommandLinePatcher;
|
||||
import com.jetbrains.python.run.PythonCommandLineState;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class PyCCCommandLineState extends PythonCommandLineState {
|
||||
private final PyCCRunTestConfiguration myRunConfiguration;
|
||||
private final VirtualFile myTaskDir;
|
||||
@@ -54,7 +56,7 @@ public class PyCCCommandLineState extends PythonCommandLineState {
|
||||
assert course != null;
|
||||
|
||||
group.addParameter(myRunConfiguration.getPathToTest());
|
||||
group.addParameter(course.getCourseDirectory());
|
||||
group.addParameter(new File(course.getCourseDirectory()).getPath());
|
||||
|
||||
group.addParameter(getFirstTaskFilePath());
|
||||
}
|
||||
@@ -62,9 +64,10 @@ public class PyCCCommandLineState extends PythonCommandLineState {
|
||||
@NotNull
|
||||
private String getFirstTaskFilePath() {
|
||||
String firstTaskFileName = StudyUtils.getFirst(myTask.getTaskFiles().keySet());
|
||||
String taskDirPath = FileUtil.toSystemDependentName(myTaskDir.getPath());
|
||||
return myTaskDir.findChild(EduNames.SRC) != null ?
|
||||
FileUtil.join(myTaskDir.getPath(), EduNames.SRC, firstTaskFileName) :
|
||||
FileUtil.join(myTaskDir.getPath(), firstTaskFileName);
|
||||
FileUtil.join(taskDirPath, EduNames.SRC, firstTaskFileName) :
|
||||
FileUtil.join(taskDirPath, firstTaskFileName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-2
@@ -77,9 +77,10 @@ public class PyCCRunTestsConfigurationProducer extends RunConfigurationProducer<
|
||||
return null;
|
||||
}
|
||||
|
||||
String taskDirPath = FileUtil.toSystemDependentName(taskDir.getPath());
|
||||
String testsPath = taskDir.findChild(EduNames.SRC) != null ?
|
||||
FileUtil.join(taskDir.getPath(), EduNames.SRC, EduNames.TESTS_FILE) :
|
||||
FileUtil.join(taskDir.getPath(), EduNames.TESTS_FILE);
|
||||
FileUtil.join(taskDirPath, EduNames.SRC, EduNames.TESTS_FILE) :
|
||||
FileUtil.join(taskDirPath, EduNames.TESTS_FILE);
|
||||
return file.getPath().equals(testsPath) ? testsPath : null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user