clear test environment before test
authorLiana Bakradze <liana.bakradze@jetbrains.com>
Tue, 23 Sep 2014 17:07:29 +0000 (21:07 +0400)
committerLiana Bakradze <liana.bakradze@jetbrains.com>
Tue, 23 Sep 2014 17:07:29 +0000 (21:07 +0400)
python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/CCRunTests.java
python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/actions/CCCreateCourseArchive.java
python/edu/course-creator/src/org/jetbrains/plugins/coursecreator/projectView/CCTreeStructureProvider.java

index ed2372cf8a487c6e47aff65c922892181810bc8e..77597ad12f644243e7a6f21d3cd19ca3fe74da6d 100644 (file)
@@ -99,6 +99,7 @@ public class CCRunTests extends AnAction {
         if (task == null) {
           return;
         }
+        clearTestEnvironment(taskDir, project);
         for (final Map.Entry<String, TaskFile> entry : task.getTaskFiles().entrySet()) {
           final String name = entry.getKey();
           createTestEnvironment(taskDir, name, entry.getValue(), project);
@@ -107,7 +108,6 @@ public class CCRunTests extends AnAction {
             return;
           }
           executeTests(project, virtualFile, taskDir, testFile);
-          clearTestEnvironment(taskDir, project);
         }
       }
     });
index 9aacf9ee9fdaa6e351d8839d9c6ac4a424a5578b..8fa9541c538bf3a68f6549b23b4c0c7d274cf314 100644 (file)
@@ -25,7 +25,9 @@ import org.jetbrains.plugins.coursecreator.format.*;
 import org.jetbrains.plugins.coursecreator.ui.CreateCourseArchiveDialog;
 
 import java.io.*;
-import java.util.*;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.zip.ZipOutputStream;
 
 public class CCCreateCourseArchive extends DumbAwareAction {
@@ -186,12 +188,11 @@ public class CCCreateCourseArchive extends DumbAwareAction {
       for (Map.Entry<String, Lesson> entry : lessons.entrySet()) {
         final VirtualFile lessonDir = baseDir.findChild(entry.getKey());
         if (lessonDir == null) continue;
-
         ZipUtil.addFileOrDirRecursively(zos, null, new File(lessonDir.getPath()), lessonDir.getName(), new FileFilter() {
           @Override
           public boolean accept(File pathname) {
             String name = pathname.getName();
-            return !name.contains(".answer") && !name.contains("__pycache__");
+            return !name.contains(".answer") && !name.contains("__pycache__") && !name.contains("_windows");
           }
         }, null);
       }
index b4fb50a96dc4fa81bb15f51d5e0ebbe32b082fd5..89d09f73c28cb9af0f2ccfb03fac45740770f1b7 100644 (file)
@@ -39,7 +39,8 @@ public class CCTreeStructureProvider implements TreeStructureProvider, DumbAware
           if (virtualFile == null) {
             continue;
           }
-          if (CCProjectService.getInstance(project).isTaskFile(virtualFile)) {
+          if (CCProjectService.getInstance(project).isTaskFile(virtualFile)
+              || virtualFile.getName().contains("_windows")) {
             continue;
           }
         }