no message
This commit is contained in:
4
.idea/workspace.xml
generated
4
.idea/workspace.xml
generated
@@ -8,11 +8,7 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackage.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/ServerSapforTestingPlanner/ServerSapforTestingPlanner.java" beforeDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TasksDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TasksDatabase.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestingPlanner.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestingPlanner.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestingPlanner.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -36,5 +36,6 @@ public class SapforTasksPackage extends nDBObject {
|
|||||||
tasksCount = p.tasksCount;
|
tasksCount = p.tasksCount;
|
||||||
StartDate = p.StartDate;
|
StartDate = p.StartDate;
|
||||||
ChangeDate = p.ChangeDate;
|
ChangeDate = p.ChangeDate;
|
||||||
|
state = p.state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,16 +100,16 @@ public class TestingPlanner {
|
|||||||
//каждый раз соединяемся по новой. из за проблем с Exists.
|
//каждый раз соединяемся по новой. из за проблем с Exists.
|
||||||
// к тому же, теперь задачи гоняет модуль, тут только проверка
|
// к тому же, теперь задачи гоняет модуль, тут только проверка
|
||||||
//так что время на разрыв уже не критично.
|
//так что время на разрыв уже не критично.
|
||||||
try {
|
try {
|
||||||
user.connection= null;
|
user.connection = null;
|
||||||
user.connection = new UserConnection(machine, user);
|
user.connection = new UserConnection(machine, user);
|
||||||
Print("Соединение c " + machine.getURL() + " " + user.login + " успешно установлено.");
|
Print("Соединение c " + machine.getURL() + " " + user.login + " успешно установлено.");
|
||||||
user.connection.ShellCommand("ulimit -s unlimited"); // нужно, для запуска сишной части.
|
user.connection.ShellCommand("ulimit -s unlimited"); // нужно, для запуска сишной части.
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Global.Log.PrintException(ex);
|
Global.Log.PrintException(ex);
|
||||||
user.connection = null;
|
user.connection = null;
|
||||||
Print("Не удалось установить соединение.");
|
Print("Не удалось установить соединение.");
|
||||||
}
|
}
|
||||||
return user.connection != null;
|
return user.connection != null;
|
||||||
}
|
}
|
||||||
//-
|
//-
|
||||||
@@ -149,53 +149,53 @@ public class TestingPlanner {
|
|||||||
void emailPass(String email_in) {
|
void emailPass(String email_in) {
|
||||||
email = email_in;
|
email = email_in;
|
||||||
try {
|
try {
|
||||||
// System.out.println(email+" testing planner starts...");
|
// System.out.println(email+" testing planner starts...");
|
||||||
Pair<TasksPackage, LinkedHashMap<Long, TestCompilationTask>> p = (Pair<TasksPackage, LinkedHashMap<Long, TestCompilationTask>>) ServerCommand(ServerCode.GetFirstActiveAccountPackage);
|
Pair<TasksPackage, LinkedHashMap<Long, TestCompilationTask>> p = (Pair<TasksPackage, LinkedHashMap<Long, TestCompilationTask>>) ServerCommand(ServerCode.GetFirstActiveAccountPackage);
|
||||||
sapforTasksPackage = (SapforTasksPackage) ServerCommand(ServerCode.GetFirstActiveSapforTasksPackage);
|
sapforTasksPackage = (SapforTasksPackage) ServerCommand(ServerCode.GetFirstActiveSapforTasksPackage);
|
||||||
tasksPackage = null;
|
tasksPackage = null;
|
||||||
packageTasks = null;
|
packageTasks = null;
|
||||||
tasksPackage = p.getKey();
|
tasksPackage = p.getKey();
|
||||||
packageTasks = p.getValue();
|
packageTasks = p.getValue();
|
||||||
if (tasksPackage != null) {
|
if (tasksPackage != null) {
|
||||||
// System.out.println("found dvm package: "+sapforTasksPackage.id);
|
// System.out.println("found dvm package: "+sapforTasksPackage.id);
|
||||||
String machine_url = tasksPackage.machine_address + ":" + tasksPackage.machine_port;
|
String machine_url = tasksPackage.machine_address + ":" + tasksPackage.machine_port;
|
||||||
if (!machines.containsKey(machine_url))
|
if (!machines.containsKey(machine_url))
|
||||||
machines.put(machine_url, new Machine(
|
machines.put(machine_url, new Machine(
|
||||||
tasksPackage.machine_name,
|
tasksPackage.machine_name,
|
||||||
tasksPackage.machine_address,
|
tasksPackage.machine_address,
|
||||||
tasksPackage.machine_port,
|
tasksPackage.machine_port,
|
||||||
tasksPackage.machine_type));
|
tasksPackage.machine_type));
|
||||||
if (!users.containsKey(tasksPackage.user_name))
|
if (!users.containsKey(tasksPackage.user_name))
|
||||||
users.put(tasksPackage.user_name,
|
users.put(tasksPackage.user_name,
|
||||||
new User(tasksPackage.user_name, tasksPackage.user_password, tasksPackage.user_workspace));
|
new User(tasksPackage.user_name, tasksPackage.user_password, tasksPackage.user_workspace));
|
||||||
machine = machines.get(machine_url);
|
machine = machines.get(machine_url);
|
||||||
//-->>
|
//-->>
|
||||||
maxKernels = (MachineMaxKernels) ServerCommand(ServerCode.GetObjectCopyByPK, "", new Pair<>(MachineMaxKernels.class, machine_url));
|
maxKernels = (MachineMaxKernels) ServerCommand(ServerCode.GetObjectCopyByPK, "", new Pair<>(MachineMaxKernels.class, machine_url));
|
||||||
//-->>
|
//-->>
|
||||||
user = users.get(tasksPackage.user_name);
|
user = users.get(tasksPackage.user_name);
|
||||||
if (CheckConnection(machine, user)) {
|
if (CheckConnection(machine, user)) {
|
||||||
try {
|
try {
|
||||||
supervisor = new TestsSupervisor_2022(this, user.connection, tasksPackage,new Vector<>(packageTasks.values()) );
|
supervisor = new TestsSupervisor_2022(this, user.connection, tasksPackage, new Vector<>(packageTasks.values()));
|
||||||
supervisor.Perform();
|
supervisor.Perform();
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Print("Ошибка сеанса, соединение будет разорвано.");
|
Print("Ошибка сеанса, соединение будет разорвано.");
|
||||||
Print(ex.getMessage());
|
Print(ex.getMessage());
|
||||||
if (user.connection != null) {
|
if (user.connection != null) {
|
||||||
user.connection.Disconnect();
|
user.connection.Disconnect();
|
||||||
user.connection = null;
|
user.connection = null;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else
|
|
||||||
if (sapforTasksPackage!=null){
|
|
||||||
System.out.println("found sapfor package: "+sapforTasksPackage.id+" state = "+sapforTasksPackage.state);
|
|
||||||
try {
|
|
||||||
PerformSapforPackage();
|
|
||||||
} catch (Exception ex) {
|
|
||||||
Print("Исключение при тестировании SAPROR");
|
|
||||||
Print(ex.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (sapforTasksPackage != null) {
|
||||||
|
System.out.println("found sapfor package: " + sapforTasksPackage.id + " state = " + sapforTasksPackage.state);
|
||||||
|
try {
|
||||||
|
PerformSapforPackage();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
Print("Исключение при тестировании SAPROR");
|
||||||
|
Print(ex.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Global.Log.PrintException(ex);
|
Global.Log.PrintException(ex);
|
||||||
}
|
}
|
||||||
@@ -213,21 +213,10 @@ public class TestingPlanner {
|
|||||||
void UpdateSapforPackage(SapforTasksPackage package_in) throws Exception {
|
void UpdateSapforPackage(SapforTasksPackage package_in) throws Exception {
|
||||||
package_in.ChangeDate = new Date().getTime();
|
package_in.ChangeDate = new Date().getTime();
|
||||||
ServerCommand(ServerCode.EditAccountObject, package_in);
|
ServerCommand(ServerCode.EditAccountObject, package_in);
|
||||||
//---------------
|
|
||||||
/*
|
|
||||||
if ((package_in.needsEmail == 1) &&
|
|
||||||
(package_in.state.equals(TasksPackageState.PackageStart) ||
|
|
||||||
(package_in.state.equals(TasksPackageState.Done)))) {
|
|
||||||
EmailMessage message = new EmailMessage();
|
|
||||||
message.subject = "Состояние пакета задач " + Utils.Brackets(package_in.id) + " изменилось на " + Utils.Brackets(package_in.state.getDescription());
|
|
||||||
message.text = package_in.summary;
|
|
||||||
message.targets.add(email);
|
|
||||||
ServerCommand(ServerCode.Email, message);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
void SapforPackageStart() throws Exception {
|
void SapforPackageStart() throws Exception {
|
||||||
System.out.println("start sapfor package "+sapforTasksPackage.id);
|
System.out.println("start sapfor package " + sapforTasksPackage.id);
|
||||||
|
|
||||||
File workspace = new File(sapforTasksPackage.workspace);
|
File workspace = new File(sapforTasksPackage.workspace);
|
||||||
File script = new File(sapforTasksPackage.workspace, "start");
|
File script = new File(sapforTasksPackage.workspace, "start");
|
||||||
ProcessBuilder procBuilder = new ProcessBuilder(script.getAbsolutePath());
|
ProcessBuilder procBuilder = new ProcessBuilder(script.getAbsolutePath());
|
||||||
@@ -238,7 +227,7 @@ public class TestingPlanner {
|
|||||||
System.out.println("done");
|
System.out.println("done");
|
||||||
}
|
}
|
||||||
void CheckSapforPackageState() throws Exception {
|
void CheckSapforPackageState() throws Exception {
|
||||||
System.out.println("check sapfor package "+sapforTasksPackage.id);
|
System.out.println("check sapfor package " + sapforTasksPackage.id);
|
||||||
File done = new File(sapforTasksPackage.workspace, Constants.DONE);
|
File done = new File(sapforTasksPackage.workspace, Constants.DONE);
|
||||||
File aborted = new File(sapforTasksPackage.workspace, Constants.ABORTED);
|
File aborted = new File(sapforTasksPackage.workspace, Constants.ABORTED);
|
||||||
if (done.exists()) {
|
if (done.exists()) {
|
||||||
@@ -249,7 +238,7 @@ public class TestingPlanner {
|
|||||||
sapforTasksPackage.state = TasksPackageState.Aborted;
|
sapforTasksPackage.state = TasksPackageState.Aborted;
|
||||||
UpdateSapforPackage(sapforTasksPackage);
|
UpdateSapforPackage(sapforTasksPackage);
|
||||||
System.out.println("package aborted");
|
System.out.println("package aborted");
|
||||||
}else {
|
} else {
|
||||||
System.out.println("package running");
|
System.out.println("package running");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user