Исправление ключей у тестирования двм системы.
This commit is contained in:
@@ -3,6 +3,6 @@ import Common.UI.Menus_2023.DataMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class TasksPackagesMenuBar extends DataMenuBar {
|
||||
public TasksPackagesMenuBar() {
|
||||
super("пакеты задач", PassCode_2021.AbortSelectedPackages);
|
||||
super("пакеты задач", PassCode_2021.AbortTaskPackage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import Visual_DVM_2021.Passes.PassException;
|
||||
@@ -10,6 +11,7 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import javafx.util.Pair;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -28,6 +30,7 @@ import java.nio.file.*;
|
||||
import java.security.MessageDigest;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Semaphore;
|
||||
import java.util.regex.Matcher;
|
||||
@@ -1047,5 +1050,66 @@ public class Utils {
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
//--
|
||||
public static boolean isCrushedLine(String line) {
|
||||
return line.contains("RTS err")
|
||||
|| line.contains("RTS stack trace")
|
||||
|| line.contains("RTS fatal err")
|
||||
|| line.contains("SIGEGV")
|
||||
|| line.contains("There are not enough slots available in the system to satisfy the")
|
||||
|| line.contains("forrtl: severe")
|
||||
|| line.contains("invalid pointer")
|
||||
|| line.contains("forrtl: error");
|
||||
}
|
||||
public static boolean isCrushed(List<String> output_lines, List<String> errors_lines) {
|
||||
return output_lines.stream().anyMatch(Utils::isCrushedLine) || errors_lines.stream().anyMatch(Utils::isCrushedLine);
|
||||
}
|
||||
public static Pair<TaskState, Integer> analyzeCorrectness(List<String> lines) {
|
||||
int complete = 0;
|
||||
int errors = 0;
|
||||
int total = 0;
|
||||
for (String s : lines) {
|
||||
String line = s.toUpperCase();
|
||||
if (line.contains("COMPLETE")) {
|
||||
complete++;
|
||||
total++;
|
||||
} else if (line.contains("ERROR")) {
|
||||
errors++;
|
||||
total++;
|
||||
}
|
||||
}
|
||||
return new Pair<>(
|
||||
(errors > 0) ? TaskState.DoneWithErrors : ((complete > 0) ? TaskState.Done : TaskState.WrongTestFormat),
|
||||
(int) ((((double) complete) / total) * 100)
|
||||
);
|
||||
}
|
||||
public static Pair<TaskState, Integer> analyzePerformance(List<String> lines) {
|
||||
StringTemplate stringTemplate = new StringTemplate("Verification =", "");
|
||||
for (String line : lines) {
|
||||
String param = stringTemplate.check_and_get_param(line);
|
||||
if (param != null) {
|
||||
switch (param) {
|
||||
case "SUCCESSFUL":
|
||||
return new Pair<>(TaskState.Done, 100);
|
||||
case "UNSUCCESSFUL":
|
||||
return new Pair<>(TaskState.DoneWithErrors, 0);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Pair<>(TaskState.WrongTestFormat, 0);
|
||||
}
|
||||
public static double parseCleanTime(String output) {
|
||||
double res = 0.0;
|
||||
StringTemplate template = new StringTemplate("Time in seconds =", "");
|
||||
String p = template.check_and_get_param(output);
|
||||
try {
|
||||
if (p != null) res = Double.parseDouble(p);
|
||||
} catch (Exception ex) {
|
||||
Global.Log.PrintException(ex);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import GlobalData.Tasks.CompilationTask.CompilationTask;
|
||||
import GlobalData.Tasks.Task;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import TestingSystem.DVM.Tasks.TestRunTaskInterface;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
||||
@@ -96,7 +95,7 @@ public class RunTask extends Task {
|
||||
@Override
|
||||
public void AnalyzeOutFile(db_project_info project) throws Exception {
|
||||
List<String> lines = FileUtils.readLines(getOutputFile());
|
||||
if (lines.stream().anyMatch(TestRunTaskInterface::isCrushedLine)
|
||||
if (lines.stream().anyMatch(Utils::isCrushedLine)
|
||||
) {
|
||||
state = TaskState.Crushed;
|
||||
return;
|
||||
@@ -140,7 +139,7 @@ public class RunTask extends Task {
|
||||
@Override
|
||||
public void AnalyzeErrorsFile(db_project_info project) throws Exception {
|
||||
List<String> lines = FileUtils.readLines(getErrorsFile());
|
||||
if (lines.stream().anyMatch(TestRunTaskInterface::isCrushedLine))
|
||||
if (lines.stream().anyMatch(Utils::isCrushedLine))
|
||||
state = TaskState.Crushed;
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -2,12 +2,8 @@ package TestingSystem.Common;
|
||||
import Common.Constants;
|
||||
import Common.Database.SQLITE.SQLiteDatabase;
|
||||
import Common.Global;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import TestingSystem.SAPFOR.SapforTask.SapforTasksDBTable;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackagesDBTable;
|
||||
import TestingSystem.Common.TSetting.TSetting;
|
||||
import TestingSystem.Common.TSetting.TSettingsDBTable;
|
||||
import TestingSystem.Common.TasksPackageToKill.TasksPackageToKillDBTable;
|
||||
import TestingSystem.DVM.Tasks.TestCompilationTask;
|
||||
import TestingSystem.DVM.Tasks.TestCompilationTasksDBTable;
|
||||
import TestingSystem.DVM.Tasks.TestRunTask;
|
||||
@@ -15,7 +11,9 @@ import TestingSystem.DVM.Tasks.TestRunTasksDBTable;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackage;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageDBTable;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageState;
|
||||
import TestingSystem.Common.TasksPackageToKill.TasksPackageToKillDBTable;
|
||||
import TestingSystem.SAPFOR.SapforTask.SapforTasksDBTable;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackagesDBTable;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import javafx.util.Pair;
|
||||
|
||||
@@ -56,15 +54,6 @@ public class TasksDatabase extends SQLiteDatabase {
|
||||
addTable(sapforTasks = new SapforTasksDBTable());
|
||||
}
|
||||
@Override
|
||||
public void Init() throws Exception {
|
||||
if (!settings.containsKey(SettingName.Email))
|
||||
Insert(new TSetting(SettingName.Email, 0));
|
||||
if (!settings.containsKey(SettingName.Pause))
|
||||
Insert(new TSetting(SettingName.Pause, 0));
|
||||
if (!settings.containsKey(SettingName.Queue))
|
||||
Insert(new TSetting(SettingName.Queue, 0));
|
||||
}
|
||||
@Override
|
||||
public PassCode_2021 getSynchronizePassCode() {
|
||||
return PassCode_2021.SynchronizeTestsTasks;
|
||||
}
|
||||
@@ -81,9 +70,9 @@ public class TasksDatabase extends SQLiteDatabase {
|
||||
}
|
||||
super.disconnect();
|
||||
}
|
||||
public LinkedHashMap<Long, TestRunTask> getPackageRunTasks(String package_id) throws Exception {
|
||||
public LinkedHashMap<Long, TestRunTask> getPackageRunTasks(int package_id) throws Exception {
|
||||
LinkedHashMap<Long, TestRunTask> res = new LinkedHashMap<>();
|
||||
selectPackageRunTasks.setString(1, package_id);
|
||||
selectPackageRunTasks.setInt(1, package_id);
|
||||
resSet = selectPackageRunTasks.executeQuery();
|
||||
while (resSet.next()) {
|
||||
Pair<Long, TestRunTask> record = readRecord(testRunTasks);
|
||||
@@ -126,7 +115,7 @@ public class TasksDatabase extends SQLiteDatabase {
|
||||
if (tasksPackage == null) return null;
|
||||
LinkedHashMap<Long, TestCompilationTask> res = new LinkedHashMap<>();
|
||||
for (TestCompilationTask srcCompilationTask : testCompilationTasks.Data.values()) {
|
||||
if (srcCompilationTask.taskspackage_id.equals(tasksPackage.id)) {
|
||||
if (srcCompilationTask.taskspackage_id==tasksPackage.id) {
|
||||
TestCompilationTask dstCompilationTask = new TestCompilationTask(srcCompilationTask);
|
||||
dstCompilationTask.runTasks = new Vector<>();
|
||||
for (TestRunTask testRunTask : testRunTasks.Data.values())
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package TestingSystem.Common.TasksPackageToKill;
|
||||
import Common.Constants;
|
||||
import Common.Database.iDBObject;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public class TasksPackageToKill extends iDBObject {
|
||||
public String packageName = "";
|
||||
@Description("DEFAULT -1")
|
||||
public int packageId = Constants.Nan;
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
account_db.BeginTransaction();
|
||||
for (Object object : tasks) {
|
||||
SapforTask task = (SapforTask) object;
|
||||
task.id = db.IncMaxTaskId();
|
||||
task.id = db.IncSapforMaxTaskId();
|
||||
if (account_db.InsertWithCheck_(task) != null)
|
||||
PublishAction(task);
|
||||
}
|
||||
@@ -303,11 +303,11 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
break;
|
||||
case CheckPackageToKill:
|
||||
SetCurrentAccountDB(request.arg);
|
||||
String packageName = (String) request.object;
|
||||
int packageId = (int) request.object;
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
boolean res_ = false;
|
||||
for (TasksPackageToKill tasksPackageToKill : account_db.packagesToKill.Data.values()) {
|
||||
if (tasksPackageToKill.packageName.equals(packageName)) {
|
||||
if (tasksPackageToKill.packageId==packageId) {
|
||||
res_ = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public class TestsDatabase extends SQLiteDatabase {
|
||||
@Override
|
||||
public void Init() throws Exception {
|
||||
if (!settings.containsKey(SettingName.TaskMaxId))
|
||||
Insert(new TSetting(SettingName.TaskMaxId, 63128));
|
||||
Insert(new TSetting(SettingName.TaskMaxId, 0));
|
||||
if (!settings.containsKey(SettingName.SapforTaskMaxId))
|
||||
Insert(new TSetting(SettingName.SapforTaskMaxId, 0));
|
||||
}
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
package TestingSystem.DVM.Tasks;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Global;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import ProjectData.LanguageName;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.Configuration.Configuration;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.Vector;
|
||||
public class TestRunTask extends TestTask {
|
||||
//не факт что тут нужно переводить на полный интерфейс. достаточно убрать фильтрацию
|
||||
@Override
|
||||
public boolean isVisible() {
|
||||
return TestRunTaskInterface.isVisible(this);
|
||||
}
|
||||
//--
|
||||
public long testcompilationtask_id = Constants.Nan;
|
||||
public String matrix = "";
|
||||
@Description("DEFAULT ''")
|
||||
@@ -103,4 +100,18 @@ public class TestRunTask extends TestTask {
|
||||
res.add(String.valueOf(kernels_in)); //8
|
||||
return res;
|
||||
}
|
||||
//---
|
||||
public boolean isVisible() {
|
||||
return
|
||||
Current.HasTasksPackage() &&
|
||||
(taskspackage_id==Current.getTasksPackage().id) &&
|
||||
Global.testingServer.account_db.testRunTasks.applyFilters(this);
|
||||
}
|
||||
public String getEnvironments() {
|
||||
return environments.replace("\n", ";");
|
||||
}
|
||||
public String getUsrPar() {
|
||||
return usr_par.replace("\n", ";");
|
||||
}
|
||||
//--
|
||||
}
|
||||
|
||||
@@ -1,83 +0,0 @@
|
||||
package TestingSystem.DVM.Tasks;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.Utils.StringTemplate;
|
||||
import GlobalData.Tasks.TaskState;
|
||||
import javafx.util.Pair;
|
||||
|
||||
import java.util.List;
|
||||
public class TestRunTaskInterface {
|
||||
public static boolean isVisible(TestRunTask object) {
|
||||
return
|
||||
Current.HasTasksPackage() &&
|
||||
object.taskspackage_id.equals(Current.getTasksPackage().id) &&
|
||||
Global.testingServer.account_db.testRunTasks.applyFilters(object);
|
||||
}
|
||||
public static String getEnvironments(TestRunTask object) {
|
||||
return object.environments.replace("\n", ";");
|
||||
}
|
||||
public static String getUsrPar(TestRunTask object) {
|
||||
return object.usr_par.replace("\n", ";");
|
||||
}
|
||||
//--
|
||||
public static boolean isCrushedLine(String line) {
|
||||
return line.contains("RTS err")
|
||||
|| line.contains("RTS stack trace")
|
||||
|| line.contains("RTS fatal err")
|
||||
|| line.contains("SIGEGV")
|
||||
|| line.contains("There are not enough slots available in the system to satisfy the")
|
||||
|| line.contains("forrtl: severe")
|
||||
|| line.contains("invalid pointer")
|
||||
|| line.contains("forrtl: error");
|
||||
}
|
||||
public static boolean isCrushed(List<String> output_lines, List<String> errors_lines) {
|
||||
return output_lines.stream().anyMatch(TestRunTaskInterface::isCrushedLine) || errors_lines.stream().anyMatch(TestRunTaskInterface::isCrushedLine);
|
||||
}
|
||||
public static Pair<TaskState, Integer> analyzeCorrectness(List<String> lines) {
|
||||
int complete = 0;
|
||||
int errors = 0;
|
||||
int total = 0;
|
||||
for (String s : lines) {
|
||||
String line = s.toUpperCase();
|
||||
if (line.contains("COMPLETE")) {
|
||||
complete++;
|
||||
total++;
|
||||
} else if (line.contains("ERROR")) {
|
||||
errors++;
|
||||
total++;
|
||||
}
|
||||
}
|
||||
return new Pair<>(
|
||||
(errors > 0) ? TaskState.DoneWithErrors : ((complete > 0) ? TaskState.Done : TaskState.WrongTestFormat),
|
||||
(int) ((((double) complete) / total) * 100)
|
||||
);
|
||||
}
|
||||
public static Pair<TaskState, Integer> analyzePerformance(List<String> lines) {
|
||||
StringTemplate stringTemplate = new StringTemplate("Verification =", "");
|
||||
for (String line : lines) {
|
||||
String param = stringTemplate.check_and_get_param(line);
|
||||
if (param != null) {
|
||||
switch (param) {
|
||||
case "SUCCESSFUL":
|
||||
return new Pair<>(TaskState.Done, 100);
|
||||
case "UNSUCCESSFUL":
|
||||
return new Pair<>(TaskState.DoneWithErrors, 0);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return new Pair<>(TaskState.WrongTestFormat, 0);
|
||||
}
|
||||
public static double parseCleanTime(String output) {
|
||||
double res = 0.0;
|
||||
StringTemplate template = new StringTemplate("Time in seconds =", "");
|
||||
String p = template.check_and_get_param(output);
|
||||
try {
|
||||
if (p != null) res = Double.parseDouble(p);
|
||||
} catch (Exception ex) {
|
||||
Global.Log.PrintException(ex);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
@@ -152,9 +152,9 @@ public class TestRunTasksDBTable extends DBTable<Long, TestRunTask> {
|
||||
case 9:
|
||||
return object.matrix;
|
||||
case 10:
|
||||
return TestRunTaskInterface.getEnvironments(object);
|
||||
return object.getEnvironments();
|
||||
case 11:
|
||||
return TestRunTaskInterface.getUsrPar(object);
|
||||
return object.getUsrPar();
|
||||
case 12:
|
||||
return object.Time;
|
||||
case 13:
|
||||
|
||||
@@ -14,8 +14,8 @@ import java.util.Vector;
|
||||
public class TestTask extends DBObject {
|
||||
@Description("PRIMARY KEY, UNIQUE")
|
||||
public long id = Constants.Nan;
|
||||
@Description("DEFAULT ''")
|
||||
public String taskspackage_id = "";
|
||||
@Description("DEFAULT '-1'")
|
||||
public int taskspackage_id = Constants.Nan;
|
||||
@Description("DEFAULT -1")
|
||||
public int group_id = Constants.Nan;
|
||||
@Description("DEFAULT ''")
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package TestingSystem.DVM.TasksPackage;
|
||||
import Common.Database.DBObject;
|
||||
import Common.Database.nDBObject;
|
||||
import Common.Database.riDBObject;
|
||||
import GlobalData.Machine.MachineType;
|
||||
import TestingSystem.DVM.Tasks.TestCompilationTask;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class TasksPackage extends nDBObject {
|
||||
public class TasksPackage extends riDBObject {
|
||||
public String pid=""; //сишная часть.
|
||||
public String summary = "";
|
||||
//---
|
||||
|
||||
@@ -10,10 +10,10 @@ import java.util.LinkedHashMap;
|
||||
|
||||
import static Common.UI.Tables.TableRenderers.RendererDate;
|
||||
import static Common.UI.Tables.TableRenderers.RendererStatusEnum;
|
||||
public class TasksPackageDBTable extends DBTable<String, TasksPackage> {
|
||||
public class TasksPackageDBTable extends iDBTable<TasksPackage> {
|
||||
|
||||
public TasksPackageDBTable() {
|
||||
super(String.class, TasksPackage.class);
|
||||
super(TasksPackage.class);
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
@@ -36,7 +36,7 @@ public class TasksPackageDBTable extends DBTable<String, TasksPackage> {
|
||||
}
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
columns.get(0).setVisible(false);
|
||||
// columns.get(0).setVisible(false);
|
||||
columns.get(7).setRenderer(RendererDate);
|
||||
columns.get(8).setRenderer(RendererDate);
|
||||
columns.get(9).setRenderer(RendererStatusEnum);
|
||||
|
||||
@@ -7,7 +7,6 @@ import GlobalData.Tasks.TaskState;
|
||||
import Repository.Server.ServerCode;
|
||||
import TestingSystem.DVM.Tasks.TestCompilationTask;
|
||||
import TestingSystem.DVM.Tasks.TestRunTask;
|
||||
import TestingSystem.DVM.Tasks.TestRunTaskInterface;
|
||||
import TestingSystem.DVM.Tasks.TestTask;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackage;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackageState;
|
||||
@@ -39,8 +38,8 @@ public class TestsSupervisor_2022 {
|
||||
tasksPackage = tasksPackage_in;
|
||||
compilationTasks = tasks_in;
|
||||
planner.Print(getClass().getSimpleName() + ": найдено задач на компиляцию: " + compilationTasks.size());
|
||||
packageRemoteWorkspace = new RemoteFile(tasksPackage.user_workspace + "/tests", tasksPackage.id, true);
|
||||
packageLocalWorkspace = Paths.get(Global.PackagesDirectory.getAbsolutePath(), tasksPackage.id).toFile();
|
||||
packageRemoteWorkspace = new RemoteFile(tasksPackage.user_workspace + "/tests", String.valueOf(tasksPackage.id), true);
|
||||
packageLocalWorkspace = new File(Global.PackagesDirectory, String.valueOf(tasksPackage.id));
|
||||
}
|
||||
public boolean packageNeedsKill() throws Exception{
|
||||
return (boolean) planner.ServerCommand(ServerCode.CheckPackageToKill,tasksPackage.id);
|
||||
@@ -245,23 +244,23 @@ public class TestsSupervisor_2022 {
|
||||
List<String> output_lines = Arrays.asList(testRunTask.output.split("\n"));
|
||||
List<String> errors_lines = Arrays.asList(testRunTask.errors.split("\n"));
|
||||
//---
|
||||
if (TestRunTaskInterface.isCrushed(output_lines, errors_lines)) {
|
||||
if (Utils.isCrushed(output_lines, errors_lines)) {
|
||||
testRunTask.state = TaskState.Crushed;
|
||||
} else {
|
||||
Pair<TaskState, Integer> results = new Pair<>(TaskState.Done, 100);
|
||||
switch (testRunTask.test_type) {
|
||||
case Correctness:
|
||||
results = TestRunTaskInterface.analyzeCorrectness(output_lines);
|
||||
results = Utils.analyzeCorrectness(output_lines);
|
||||
break;
|
||||
case Performance:
|
||||
results = TestRunTaskInterface.analyzePerformance(output_lines);
|
||||
results = Utils.analyzePerformance(output_lines);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
testRunTask.state = results.getKey();
|
||||
testRunTask.progress = results.getValue();
|
||||
testRunTask.CleanTime = TestRunTaskInterface.parseCleanTime(testRunTask.output);
|
||||
testRunTask.CleanTime = Utils.parseCleanTime(testRunTask.output);
|
||||
}
|
||||
File local_sts_text = Utils.getTempFileName("sts_text");
|
||||
Vector<ChannelSftp.LsEntry> files = connection.sftpChannel.ls(testRunTask.remote_workspace);
|
||||
|
||||
@@ -133,7 +133,7 @@ public class SapforTasksPackageSupervisor {
|
||||
}
|
||||
//--
|
||||
public boolean packageNeedsKill() throws Exception {
|
||||
return (boolean) planner.ServerCommand(ServerCode.CheckPackageToKill, String.valueOf(sapforTasksPackage.id));
|
||||
return (boolean) planner.ServerCommand(ServerCode.CheckPackageToKill, sapforTasksPackage.id);
|
||||
}
|
||||
public void killPackage() throws Exception {
|
||||
//----
|
||||
|
||||
@@ -2,13 +2,11 @@ package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import TestingSystem.Common.TasksPackageToKill.TasksPackageToKill;
|
||||
import TestingSystem.SAPFOR.SapforTasksPackage.SapforTasksPackage;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
|
||||
import java.util.Vector;
|
||||
public class AbortSapforTaskPackage extends TestingSystemPass<SapforTasksPackage> {
|
||||
Vector<TasksPackageToKill> packagesToKill;
|
||||
TasksPackageToKill tasksPackageToKill = null;
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Ban.PNG";
|
||||
@@ -19,8 +17,8 @@ public class AbortSapforTaskPackage extends TestingSystemPass<SapforTasksPackage
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
tasksPackageToKill = null;
|
||||
if (Current.Check(Log, Current.SapforTasksPackage)) {
|
||||
packagesToKill = new Vector<>();
|
||||
target = Current.getSapforTasksPackage();
|
||||
switch (target.state) {
|
||||
case Done:
|
||||
@@ -28,9 +26,8 @@ public class AbortSapforTaskPackage extends TestingSystemPass<SapforTasksPackage
|
||||
Log.Writeln_("Пакет уже завершен.");
|
||||
break;
|
||||
default:
|
||||
TasksPackageToKill tasksPackageToKill = new TasksPackageToKill();
|
||||
tasksPackageToKill.packageName = String.valueOf(target.id);
|
||||
packagesToKill.add(tasksPackageToKill);
|
||||
tasksPackageToKill = new TasksPackageToKill();
|
||||
tasksPackageToKill.packageId = target.id;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -39,6 +36,6 @@ public class AbortSapforTaskPackage extends TestingSystemPass<SapforTasksPackage
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishAccountObjects, Current.getAccount().email, packagesToKill));
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishAccountAIObject, Current.getAccount().email, tasksPackageToKill));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackage;
|
||||
import TestingSystem.Common.TasksPackageToKill.TasksPackageToKill;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
|
||||
import java.util.Vector;
|
||||
public class AbortSelectedPackages extends TestingSystemPass<Vector<TasksPackage>> {
|
||||
Vector<TasksPackageToKill> packagesToKill;
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Ban.PNG";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = server.account_db.packages.getCheckedItems();
|
||||
packagesToKill = new Vector<>();
|
||||
for (TasksPackage tasksPackage : target) {
|
||||
switch (tasksPackage.state) {
|
||||
case Done:
|
||||
case Aborted:
|
||||
break;
|
||||
default:
|
||||
TasksPackageToKill tasksPackageToKill = new TasksPackageToKill();
|
||||
tasksPackageToKill.packageName = tasksPackage.id;
|
||||
packagesToKill.add(tasksPackageToKill);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (packagesToKill.isEmpty()) {
|
||||
Log.Writeln_("Не отмечено ни одного активного пакета для удаления");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishAccountObjects, Current.getAccount().email, packagesToKill));
|
||||
}
|
||||
}
|
||||
42
src/Visual_DVM_2021/Passes/All/AbortTaskPackage.java
Normal file
42
src/Visual_DVM_2021/Passes/All/AbortTaskPackage.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Common.TasksPackageToKill.TasksPackageToKill;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackage;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
public class AbortTaskPackage extends TestingSystemPass<TasksPackage> {
|
||||
TasksPackageToKill tasksPackageToKill = null;
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/icons/Ban.PNG";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
tasksPackageToKill = null;
|
||||
if (Current.Check(Log, Current.TasksPackage)) {
|
||||
target = Current.getTasksPackage();
|
||||
switch (target.state) {
|
||||
case Done:
|
||||
case Aborted:
|
||||
Log.Writeln_("Пакет уже завершен.");
|
||||
break;
|
||||
default:
|
||||
tasksPackageToKill = new TasksPackageToKill();
|
||||
tasksPackageToKill.packageId = target.id;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
;
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishAccountAIObject, Current.getAccount().email, tasksPackageToKill));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,20 +5,21 @@ import Common.UI.UI;
|
||||
import GlobalData.Compiler.CompilerType;
|
||||
import GlobalData.Machine.MachineType;
|
||||
import GlobalData.User.UserState;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.DVM.Tasks.TestCompilationTask;
|
||||
import TestingSystem.DVM.Tasks.TestRunTask;
|
||||
import TestingSystem.DVM.TasksPackage.TasksPackage;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
import Visual_DVM_2021.Passes.Server.PublishServerAccountObject;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
public class StartTests extends TestingSystemPass<TasksPackage> {
|
||||
public class StartTests extends PublishServerAccountObject<TasksPackage> {
|
||||
public StartTests() {
|
||||
super(TasksPackage.class);
|
||||
}
|
||||
@Override
|
||||
protected int getTimeout() {
|
||||
return 0;
|
||||
@@ -28,10 +29,6 @@ public class StartTests extends TestingSystemPass<TasksPackage> {
|
||||
return "/icons/Start.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (!Current.getAccount().CheckRegistered(Log)) {
|
||||
return false;
|
||||
@@ -201,31 +198,4 @@ public class StartTests extends TestingSystemPass<TasksPackage> {
|
||||
target.needsEmail = Global.properties.EmailOnTestingProgress ? 1 : 0;
|
||||
return !tasks.isEmpty();
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
target.genName();
|
||||
Vector<TasksPackage> packages = new Vector<>();
|
||||
packages.add(target);
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.PublishAccountObjects, Current.getAccount().email, packages));
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
passes.get(PassCode_2021.SynchronizeTestsTasks).Do();
|
||||
/*
|
||||
if (!TestingServer.checkTasks)
|
||||
TestingServer.TimerOn();
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
server.account_db.packages.ui_.Select(target.id);
|
||||
// UI.getMainWindow().getTestingWindow().ShowAutoActualizeTestsState();
|
||||
}
|
||||
@Override
|
||||
protected void FocusResult() {
|
||||
UI.getMainWindow().getTestingWindow().FocusTestingTasks();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Current;
|
||||
import GlobalData.Settings.SettingName;
|
||||
import Repository.Server.ServerCode;
|
||||
import Repository.Server.ServerExchangeUnit_2021;
|
||||
import TestingSystem.Common.TSetting.TSetting;
|
||||
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
|
||||
public class SwitchTestingEmail extends TestingSystemPass<TSetting> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
if (Current.getAccount().CheckRegistered(Log)) {
|
||||
target = server.account_db.settings.get(SettingName.Email);
|
||||
target.value = ((boolean) (args[0]))?1:0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void ServerAction() throws Exception {
|
||||
Command(new ServerExchangeUnit_2021(ServerCode.EditAccountObject, Current.getAccount().email, target));
|
||||
}
|
||||
}
|
||||
@@ -256,12 +256,10 @@ public enum PassCode_2021 {
|
||||
EditConfiguration,
|
||||
//-
|
||||
StartTests,
|
||||
SwitchTestingEmail,
|
||||
//-
|
||||
DownloadTaskTest,
|
||||
//-
|
||||
GetTestsQueueSize,
|
||||
AbortSelectedPackages,
|
||||
ApplyCurrentFunction,
|
||||
//->
|
||||
// GetRemoteUserHome,
|
||||
@@ -300,12 +298,15 @@ public enum PassCode_2021 {
|
||||
PublishTestProject,
|
||||
DeleteTest,
|
||||
DeleteConfiguration,
|
||||
AbortTaskPackage,
|
||||
//->
|
||||
TestPass;
|
||||
public String getDescription() {
|
||||
switch (this) {
|
||||
case Undefined:
|
||||
return "?";
|
||||
case AbortTaskPackage:
|
||||
return "Прерывать пакет тестирования DVM";
|
||||
case DeleteConfiguration:
|
||||
return "Удалить конфигурацию";
|
||||
case DeleteTest:
|
||||
@@ -430,14 +431,10 @@ public enum PassCode_2021 {
|
||||
return "Публикация удалённой рабочей папки";
|
||||
case ApplyCurrentFunction:
|
||||
return "Назначить текущую функцию по имени";
|
||||
case AbortSelectedPackages:
|
||||
return "Прерывать отмеченные пакеты задач";
|
||||
case GetTestsQueueSize:
|
||||
return "Очередь перед текущим пакетом";
|
||||
case DownloadTaskTest:
|
||||
return "Загрузить тест текущей задачи";
|
||||
case SwitchTestingEmail:
|
||||
return "Настроить отправку оповещений тестирования";
|
||||
case StartTests:
|
||||
return "Запуск тестов";
|
||||
case PublishConfiguration:
|
||||
|
||||
Reference in New Issue
Block a user