рефакторинг определения размерности тестов на сервере.
This commit is contained in:
@@ -107,6 +107,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
+ "\nТест будет удален"
|
||||
);
|
||||
}
|
||||
db.DetectTestMinMaxDim(db.serverSapfors.getLastDoneVersion(), db.groups.get(test.group_id), test);
|
||||
} else if (object instanceof DVMPackage) {
|
||||
DVMPackage dvmPackage = (DVMPackage) object;
|
||||
//--
|
||||
@@ -287,6 +288,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
protected void startAdditionalThreads() {
|
||||
testingThread.start();
|
||||
}
|
||||
|
||||
void PerformAutoSapforTesting() throws Exception {
|
||||
TextLog Log = new TextLog();
|
||||
SapforPackage autoPackage = tryAutoSapforTesting(Log);
|
||||
@@ -337,7 +339,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
return new Pair<>(object, groupFiles);
|
||||
}
|
||||
void RefreshDVMTests() throws Exception {
|
||||
UserAccount account = new UserAccount("server", Constants.MailAddress);
|
||||
UserAccount account = new UserAccount("server", Constants.MailAddress);
|
||||
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
||||
DownloadRepository downloadRepository = new DownloadRepository();
|
||||
if (!downloadRepository.Do())
|
||||
@@ -379,8 +381,6 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
}
|
||||
}
|
||||
groups.sort(Comparator.comparing(o -> o.getKey().description));
|
||||
//-теперь создать тесты.
|
||||
//--
|
||||
for (Pair<Group, Vector<File>> p : groups)
|
||||
db.RefreshGroup(account, serverSapfor, p);
|
||||
}
|
||||
@@ -682,6 +682,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
}
|
||||
ZipFolderPass zip = new ZipFolderPass();
|
||||
//создание тестов.
|
||||
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
||||
Vector<Test> tests = new Vector<>();
|
||||
for (String name : versions.keySet()) {
|
||||
File src = versions.get(name);
|
||||
@@ -716,27 +717,9 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
throw new RepositoryRefuseException("Не удалось переписать архив проекта");
|
||||
}
|
||||
tests.add(test);
|
||||
db.DetectTestMinMaxDim(serverSapfor, group, test);
|
||||
}
|
||||
}
|
||||
//определение размерности тестов
|
||||
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
||||
if (serverSapfor != null) {
|
||||
File sapfor_copy = Sapfor.getTempCopy(new File(serverSapfor.call_command));
|
||||
for (Test test : tests) {
|
||||
try {
|
||||
Sapfor.getMinMaxDim(sapfor_copy, test.getServerPath(), test);
|
||||
db.Update(test);
|
||||
Utils.deleteFilesByExtensions(test.getServerPath(),
|
||||
"proj", "dep", "jar"
|
||||
);
|
||||
File visualiser_data = new File(test.getServerPath(), Constants.data);
|
||||
FileUtils.forceDelete(visualiser_data);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
//-"sh"
|
||||
}
|
||||
void ReplaceDVMPackageJson() throws Exception {
|
||||
Pair<DVMPackage, byte[]> p = (Pair<DVMPackage, byte[]>) request.object;
|
||||
@@ -756,27 +739,11 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
if (!db.tests.containsKey(key))
|
||||
throw new RepositoryRefuseException("не существует пакета с ключом " + key);
|
||||
}
|
||||
//определение размерности тестов
|
||||
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
||||
if (serverSapfor != null) {
|
||||
File sapfor_copy = Sapfor.getTempCopy(new File(serverSapfor.call_command));
|
||||
for (Object key : keys) {
|
||||
Test test = db.tests.get(key);
|
||||
Group group = db.groups.get(test.group_id);
|
||||
if (group.language.equals(LanguageName.fortran)) {
|
||||
try {
|
||||
Sapfor.getMinMaxDim(sapfor_copy, test.getServerPath(), test);
|
||||
db.Update(test);
|
||||
Utils.deleteFilesByExtensions(test.getServerPath(),
|
||||
"proj", "dep", "jar"
|
||||
);
|
||||
File visualiser_data = new File(test.getServerPath(), Constants.data);
|
||||
FileUtils.forceDelete(visualiser_data);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
for (Object key : keys) {
|
||||
Test test = db.tests.get(key);
|
||||
Group group = db.groups.get(test.group_id);
|
||||
db.DetectTestMinMaxDim(serverSapfor, group, test);
|
||||
}
|
||||
}
|
||||
void GetDVMPackageCredentials() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user