no message
This commit is contained in:
@@ -6,8 +6,9 @@ public class DVMPackagesBar extends DataMenuBar {
|
||||
super("пакеты задач DVM", PassCode_2021.AddDVMPackage,
|
||||
PassCode_2021.AddTasksToDVMPackage,
|
||||
PassCode_2021.StartDVMPackage,
|
||||
PassCode_2021.AbortDVMPackage,
|
||||
PassCode_2021.DeleteDVMPackage
|
||||
// PassCode_2021.ExportTasksPackageToExcel,PassCode_2021.AbortTaskPackage, PassCode_2021.DeleteTasksPackage
|
||||
// PassCode_2021.ExportTasksPackageToExcel,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ public class TestingPackage extends riDBObject {
|
||||
public String drv = ""; //пусть к исполняемому файлы тестируемого объекта
|
||||
//--
|
||||
public int progress = 0; //прогресс выполнения
|
||||
public long StartDate= 0;
|
||||
public long ChangeDate =0;
|
||||
public long StartDate = 0;
|
||||
public long ChangeDate = 0;
|
||||
public TasksPackageState state = TasksPackageState.Draft;
|
||||
//--
|
||||
@Override
|
||||
@@ -27,7 +27,15 @@ public class TestingPackage extends riDBObject {
|
||||
drv = tasksPackage.drv;
|
||||
kernels = tasksPackage.kernels;
|
||||
progress = tasksPackage.progress;
|
||||
StartDate = tasksPackage.StartDate;
|
||||
ChangeDate = tasksPackage.ChangeDate;
|
||||
state = tasksPackage.state;
|
||||
}
|
||||
public void destructor(){}
|
||||
public TestingPackage(TestingPackage p) {
|
||||
SynchronizeFields(p);
|
||||
}
|
||||
public TestingPackage() {
|
||||
}
|
||||
public void destructor() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,9 @@ public abstract class TestingPlanner<P extends TestingPackage> {
|
||||
protected void Disconnect() {
|
||||
}
|
||||
//---
|
||||
protected void CheckExecutionStates() throws Exception{
|
||||
|
||||
}
|
||||
//жизненный цикл планировщика
|
||||
protected void Session() throws Exception {
|
||||
switch (testingPackage.state) {
|
||||
@@ -105,6 +108,8 @@ public abstract class TestingPlanner<P extends TestingPackage> {
|
||||
case PackageStart:
|
||||
PackageStart();
|
||||
EmailPackage();
|
||||
testingPackage.StartDate = new Date().getTime();
|
||||
testingPackage.progress = 0;
|
||||
UpdatePackageState(getStateAfterStart());
|
||||
break;
|
||||
case CompilationWorkspacesCreation:
|
||||
|
||||
@@ -22,6 +22,11 @@ public class DVMPackage extends TestingPackage {
|
||||
//---
|
||||
@Description("IGNORE")
|
||||
public DVMPackage_json package_json = null;
|
||||
public DVMPackage(){}
|
||||
public DVMPackage(DVMPackage p) {
|
||||
super(p);
|
||||
this.SynchronizeFields(p);
|
||||
}
|
||||
//---
|
||||
@Override
|
||||
public void destructor() {
|
||||
|
||||
@@ -177,14 +177,14 @@ public class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
LinkedHashMap<Integer, File> tests = getTestsFromJson();
|
||||
//синхронизировать их.
|
||||
for (int test_id : tests.keySet()) {
|
||||
// Print("testId="+test_id);
|
||||
// Print("testId="+test_id);
|
||||
File test = tests.get(test_id);
|
||||
RemoteFile test_dst = new RemoteFile(testingPackage.user_workspace + "/projects/" + test_id, true);
|
||||
// Print("src="+test.getAbsolutePath());
|
||||
// Print("dst="+test_dst.full_name);
|
||||
// Print("src="+test.getAbsolutePath());
|
||||
// Print("dst="+test_dst.full_name);
|
||||
user.connection.MKDIR(test_dst);
|
||||
user.connection.SynchronizeSubDirsR(test, test_dst);
|
||||
// Print("done");
|
||||
// Print("done");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
@@ -236,6 +236,22 @@ public class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
}
|
||||
@Override
|
||||
protected boolean CheckNextState() throws Exception {
|
||||
boolean progress_changed = false;
|
||||
boolean state_changed = false;
|
||||
|
||||
RemoteFile progress = new RemoteFile(packageRemoteWorkspace, "progress");
|
||||
if (user.connection.Exists(progress)) {
|
||||
String s = user.connection.readFromFile(progress).replace("\r", "").replace("\n", "");
|
||||
int current_progress = Integer.parseInt(s);
|
||||
System.out.println("current_progress="+current_progress);
|
||||
System.out.println("old_progress="+testingPackage.progress);
|
||||
/*
|
||||
if (current_progress != testingPackage.progress) {
|
||||
testingPackage.progress = current_progress;
|
||||
progress_changed = true;
|
||||
}
|
||||
*/
|
||||
}
|
||||
RemoteFile stateDir = new RemoteFile(packageRemoteWorkspace, "state");
|
||||
//состояния пакета могут меняться только по возрастанию. ищем, появилось ли такое.
|
||||
Vector<TasksPackageState> higherStates = testingPackage.state.getHigherStates();
|
||||
@@ -245,10 +261,11 @@ public class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
if (user.connection.Exists(file)) {
|
||||
Print("found new state: " + file.name);
|
||||
testingPackage.state = state;
|
||||
return true;
|
||||
state_changed = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return progress_changed || state_changed;
|
||||
}
|
||||
@Override
|
||||
protected void DownloadResults() throws Exception {
|
||||
@@ -330,9 +347,9 @@ public class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
}
|
||||
}
|
||||
}
|
||||
testingPackage.progress = 100;
|
||||
testingPackage.saveJson(); //запись обновленных результатов пакета в json!
|
||||
Print("analysis done, ct_count=" + ct_count + " rt count=" + rt_count);
|
||||
//--
|
||||
}
|
||||
@Override
|
||||
protected void Kill() throws Exception {
|
||||
@@ -354,7 +371,7 @@ public class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
packageRemoteWorkspace = new RemoteFile(user.workspace + "/tests", String.valueOf(testingPackage.id), true);
|
||||
packageLocalWorkspace = new File(Global.PackagesDirectory, String.valueOf(testingPackage.id));
|
||||
//-
|
||||
Print("packageremoteWorkspace="+Utils.Brackets(packageRemoteWorkspace.full_name));
|
||||
Print("packageremoteWorkspace=" + Utils.Brackets(packageRemoteWorkspace.full_name));
|
||||
}
|
||||
@Override
|
||||
protected boolean Connect() {
|
||||
|
||||
Reference in New Issue
Block a user