fix
This commit is contained in:
8
.idea/workspace.xml
generated
8
.idea/workspace.xml
generated
@@ -7,11 +7,13 @@
|
|||||||
</component>
|
</component>
|
||||||
<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 afterPath="$PROJECT_DIR$/src/SapforTestingSystem/PackageModeSupervisor/PackageModeSupervisor.java" afterDir="false" />
|
|
||||||
<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/Common/Global.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Global.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Common/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Constants.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/PackageModeSupervisor/PackageModeSupervisor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/PackageModeSupervisor/PackageModeSupervisor.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackageSupervisor/SapforTasksPackageSupervisor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackageSupervisor/SapforTasksPackageSupervisor.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackageSupervisor/SapforTasksPackageSupervisor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackageSupervisor/SapforTasksPackageSupervisor.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/SapforTestingSystem/SapforTasksPackage_info.java" beforeDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/TestingSystem/TestingServer.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/Passes/All/StartSapforTests.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" />
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ public class Constants {
|
|||||||
public static final String DVM_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/dvm";
|
public static final String DVM_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/dvm";
|
||||||
public static final String SAPFOR_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/sapfor";
|
public static final String SAPFOR_REPOSITORY = "http://svn.dvm-system.org/svn/dvmhrepo/sapfor";
|
||||||
//--
|
//--
|
||||||
public static final String LOADED = "LOADED";
|
|
||||||
//-файлы-признаки
|
//-файлы-признаки
|
||||||
|
public static final String LOADED = "LOADED";
|
||||||
|
public static final String STARTED = "STARTED";
|
||||||
public static final String ABORTED = "ABORTED";
|
public static final String ABORTED = "ABORTED";
|
||||||
public static final String INTERRUPT = "INTERRUPT"; //файл признак прерывания.
|
public static final String INTERRUPT = "INTERRUPT"; //файл признак прерывания.
|
||||||
public final static String DONE = "DONE";
|
public final static String DONE = "DONE";
|
||||||
@@ -28,6 +29,7 @@ public class Constants {
|
|||||||
public static final String MailAddress = "sapfor.tracker@internet.ru";
|
public static final String MailAddress = "sapfor.tracker@internet.ru";
|
||||||
// public static final String MailPassword = "3s4w9e5fs3c1a89AA"; основной пароль.
|
// public static final String MailPassword = "3s4w9e5fs3c1a89AA"; основной пароль.
|
||||||
public static final String MailPassword = "knKn2PpfrC348ZxHtMnT"; //пароль для сапфора как внешнего приложения.
|
public static final String MailPassword = "knKn2PpfrC348ZxHtMnT"; //пароль для сапфора как внешнего приложения.
|
||||||
|
|
||||||
//--
|
//--
|
||||||
//https://losst.ru/komandy-terminala-linux
|
//https://losst.ru/komandy-terminala-linux
|
||||||
public static String[] linux_system_commands = new String[]{
|
public static String[] linux_system_commands = new String[]{
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ import Common.Constants;
|
|||||||
import Common.Global;
|
import Common.Global;
|
||||||
import Common.Utils.Utils;
|
import Common.Utils.Utils;
|
||||||
import SapforTestingSystem.Json.SapforConfiguration_json;
|
import SapforTestingSystem.Json.SapforConfiguration_json;
|
||||||
import SapforTestingSystem.Json.SapforTasksResults_json;
|
|
||||||
import SapforTestingSystem.Json.SapforTasksPackage_json;
|
import SapforTestingSystem.Json.SapforTasksPackage_json;
|
||||||
|
import SapforTestingSystem.Json.SapforTasksResults_json;
|
||||||
import SapforTestingSystem.PerformSapforTask;
|
import SapforTestingSystem.PerformSapforTask;
|
||||||
import SapforTestingSystem.SapforTask.SapforTask;
|
import SapforTestingSystem.SapforTask.SapforTask;
|
||||||
import SapforTestingSystem.ThreadsPlanner.ThreadsPlanner;
|
import SapforTestingSystem.ThreadsPlanner.ThreadsPlanner;
|
||||||
@@ -18,7 +18,10 @@ public class PackageModeSupervisor extends ThreadsPlanner {
|
|||||||
public PackageModeSupervisor() throws Exception {
|
public PackageModeSupervisor() throws Exception {
|
||||||
super(2000);
|
super(2000);
|
||||||
package_json = (SapforTasksPackage_json) Utils.jsonFromFile(new File(Global.Home, "package_json"), SapforTasksPackage_json.class);
|
package_json = (SapforTasksPackage_json) Utils.jsonFromFile(new File(Global.Home, "package_json"), SapforTasksPackage_json.class);
|
||||||
results_json.StartDate = new Date().getTime();
|
Date startDate = new Date();
|
||||||
|
results_json.StartDate = startDate.getTime();
|
||||||
|
File started = new File(Constants.STARTED);
|
||||||
|
FileUtils.writeStringToFile(started, String.valueOf(startDate));
|
||||||
//формирование списка задач.
|
//формирование списка задач.
|
||||||
File sapfor_drv = new File(Global.Home, package_json.sapfor_drv);
|
File sapfor_drv = new File(Global.Home, package_json.sapfor_drv);
|
||||||
setMaxKernels(package_json.kernels);
|
setMaxKernels(package_json.kernels);
|
||||||
@@ -48,24 +51,21 @@ public class PackageModeSupervisor extends ThreadsPlanner {
|
|||||||
killer.waitFor();
|
killer.waitFor();
|
||||||
System.out.println("done!");
|
System.out.println("done!");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//todo для надежности сделать еще один kill с внешнего процесса.
|
//todo для надежности сделать еще один kill с внешнего процесса.
|
||||||
// может быть гонка, что нить успеет запустить процесс уже после интеррупта.
|
// может быть гонка, что нить успеет запустить процесс уже после интеррупта.
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
protected void finalize() {
|
protected void finalize() {
|
||||||
results_json.EndDate = new Date().getTime();
|
results_json.EndDate = new Date().getTime();
|
||||||
|
|
||||||
//записать результаты всех задач.
|
//записать результаты всех задач.
|
||||||
try {
|
try {
|
||||||
Utils.jsonToFile(results_json, new File(Global.Home, "results_json"));
|
Utils.jsonToFile(results_json, new File(Global.Home, "results_json"));
|
||||||
//тут же и строить версии.
|
//тут же и строить версии.
|
||||||
Utils.deleteFilesByExtensions(new File(Global.Home),"proj","dep"); //Потом txt тоже добавить.
|
Utils.deleteFilesByExtensions(new File(Global.Home), "proj", "dep"); //Потом txt тоже добавить.
|
||||||
FileUtils.writeStringToFile(new File(Constants.DONE), "");
|
FileUtils.writeStringToFile(new File(Constants.DONE), "");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Global.Log.PrintException(e);
|
Global.Log.PrintException(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package SapforTestingSystem.SapforTasksPackageSupervisor;
|
package SapforTestingSystem.SapforTasksPackageSupervisor;
|
||||||
|
import Common.Constants;
|
||||||
import Common.Current;
|
import Common.Current;
|
||||||
import Common.Global;
|
import Common.Global;
|
||||||
import Common.GlobalProperties;
|
import Common.GlobalProperties;
|
||||||
@@ -94,35 +95,41 @@ public class SapforTasksPackageSupervisor {
|
|||||||
Utils.createScript(packageWorkspace, packageWorkspace, "start", "java -jar VisualSapfor.jar");
|
Utils.createScript(packageWorkspace, packageWorkspace, "start", "java -jar VisualSapfor.jar");
|
||||||
//--
|
//--
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
void SapforPackageStart() throws Exception {
|
void PackageStart() 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());
|
||||||
procBuilder.directory(workspace);
|
procBuilder.directory(workspace);
|
||||||
procBuilder.start();
|
procBuilder.start();
|
||||||
|
//--->>
|
||||||
|
File started = new File(sapforTasksPackage.workspace, Constants.STARTED);
|
||||||
|
while (!started.exists()){
|
||||||
|
System.out.println("waiting for package start...");
|
||||||
|
Utils.sleep(1000);
|
||||||
|
}
|
||||||
|
//-->>
|
||||||
sapforTasksPackage.state = TasksPackageState.RunningExecution;
|
sapforTasksPackage.state = TasksPackageState.RunningExecution;
|
||||||
UpdateSapforPackage(sapforTasksPackage);
|
planner.UpdateSapforPackage(sapforTasksPackage);
|
||||||
System.out.println("done");
|
System.out.println("done");
|
||||||
}
|
}
|
||||||
void CheckSapforPackageState() throws Exception {
|
void CheckPackageState() 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()) {
|
||||||
sapforTasksPackage.state = TasksPackageState.Done;
|
sapforTasksPackage.state = TasksPackageState.Done;
|
||||||
UpdateSapforPackage(sapforTasksPackage);
|
planner.UpdateSapforPackage(sapforTasksPackage);
|
||||||
System.out.println("package done");
|
System.out.println("package done");
|
||||||
} else if (aborted.exists()) {
|
} else if (aborted.exists()) {
|
||||||
sapforTasksPackage.state = TasksPackageState.Aborted;
|
sapforTasksPackage.state = TasksPackageState.Aborted;
|
||||||
UpdateSapforPackage(sapforTasksPackage);
|
planner.UpdateSapforPackage(sapforTasksPackage);
|
||||||
System.out.println("package aborted");
|
System.out.println("package aborted");
|
||||||
} else {
|
} else {
|
||||||
System.out.println("package running");
|
System.out.println("package running");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
//--
|
//--
|
||||||
public void Perform() throws Exception {
|
public void Perform() throws Exception {
|
||||||
switch (sapforTasksPackage.state) {
|
switch (sapforTasksPackage.state) {
|
||||||
@@ -131,14 +138,12 @@ public class SapforTasksPackageSupervisor {
|
|||||||
sapforTasksPackage.state = TasksPackageState.RunningPreparation;
|
sapforTasksPackage.state = TasksPackageState.RunningPreparation;
|
||||||
planner.UpdateSapforPackage(sapforTasksPackage);
|
planner.UpdateSapforPackage(sapforTasksPackage);
|
||||||
break;
|
break;
|
||||||
/*
|
|
||||||
case RunningPreparation:
|
case RunningPreparation:
|
||||||
SapforPackageStart();
|
PackageStart();
|
||||||
break;
|
break;
|
||||||
case RunningExecution:
|
case RunningExecution:
|
||||||
CheckSapforPackageState();
|
CheckPackageState();
|
||||||
break;
|
break;
|
||||||
*/
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
package SapforTestingSystem;
|
|
||||||
import Common.Constants;
|
|
||||||
import com.google.gson.annotations.Expose;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Vector;
|
|
||||||
public class SapforTasksPackage_info implements Serializable {
|
|
||||||
@Expose
|
|
||||||
public String email = "";
|
|
||||||
@Expose
|
|
||||||
public int sapforId = Constants.Nan; //файл с сапфором
|
|
||||||
@Expose
|
|
||||||
public int kernels = 1;
|
|
||||||
@Expose
|
|
||||||
public List<String> testsIds = new Vector<>();
|
|
||||||
@Expose
|
|
||||||
public List<String> configurationsIds = new Vector<>();
|
|
||||||
}
|
|
||||||
@@ -14,7 +14,6 @@ import Repository.RepositoryServer;
|
|||||||
import Repository.Server.ServerCode;
|
import Repository.Server.ServerCode;
|
||||||
import Repository.Server.ServerExchangeUnit_2021;
|
import Repository.Server.ServerExchangeUnit_2021;
|
||||||
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
|
||||||
import SapforTestingSystem.SapforTasksPackage_info;
|
|
||||||
import SapforTestingSystem.ServerSapfor.ServerSapfor;
|
import SapforTestingSystem.ServerSapfor.ServerSapfor;
|
||||||
import TestingSystem.Group.Group;
|
import TestingSystem.Group.Group;
|
||||||
import TestingSystem.Group.GroupInterface;
|
import TestingSystem.Group.GroupInterface;
|
||||||
@@ -315,7 +314,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
|||||||
@Override
|
@Override
|
||||||
protected void Session() throws Exception {
|
protected void Session() throws Exception {
|
||||||
DBObject dbObject = null;
|
DBObject dbObject = null;
|
||||||
SapforTasksPackage_info scenario = null;
|
|
||||||
Test test = null;
|
Test test = null;
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case SynchronizeTests:
|
case SynchronizeTests:
|
||||||
|
|||||||
@@ -212,4 +212,9 @@ public class StartSapforTests extends TestingSystemPass<SapforTasksPackage> {
|
|||||||
if (!TestingServer.checkTasks)
|
if (!TestingServer.checkTasks)
|
||||||
TestingServer.TimerOn();
|
TestingServer.TimerOn();
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
|
protected void showDone() throws Exception {
|
||||||
|
server.account_db.sapforTasksPackages.ui_.Select(target.id);
|
||||||
|
UI.getMainWindow().getTestingWindow().ShowAutoActualizeTestsState();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user