++
временне исправление эталонов тестирования сапфор
This commit is contained in:
@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
|
||||
|
||||
import java.util.Vector;
|
||||
public class Constants {
|
||||
public static final int version = 1221;
|
||||
public static final int version = 1222;
|
||||
public static final int planner_version = 24;
|
||||
public static final int testingMaxKernels = 64;
|
||||
//--
|
||||
|
||||
@@ -258,11 +258,11 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
checkExistense(sapforId, ServerSapfor.class);
|
||||
ServerSapfor sapfor = db.serverSapfors.get(sapforId);
|
||||
TextLog Log = new TextLog();
|
||||
SapforPackage autoPackage = tryAutoSapforTesting(sapfor, Log);
|
||||
tryAutoSapforTesting(sapfor, Log);
|
||||
EmailMessage message = Log.isEmpty() ?
|
||||
new EmailMessage(
|
||||
"Запущено автоматическое тестирование версии " + sapfor.version + " системы SAPFOR",
|
||||
"Пакет " + Utils_.Brackets(autoPackage.id)) :
|
||||
("Запущено автоматическое тестирование версии " + sapfor.version + " системы SAPFOR"),
|
||||
Log.toString()) :
|
||||
new EmailMessage(
|
||||
"Не удалось запустить автоматическое тестирование версии " + sapfor.version + " системы SAPFOR",
|
||||
Log.toString()
|
||||
@@ -540,7 +540,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
}
|
||||
response.object = serverSapfor;
|
||||
}
|
||||
SapforPackage tryAutoSapforTesting(ServerSapfor sapfor, TextLog Log) throws Exception {
|
||||
void tryAutoSapforTesting(ServerSapfor sapfor, TextLog Log) throws Exception {
|
||||
//--
|
||||
UserAccount account = new UserAccount();
|
||||
account.name = "server";
|
||||
@@ -549,28 +549,29 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
//-
|
||||
if (!sapfor.state.equals(ServerSapforState.Done)) {
|
||||
Log.Writeln_("Выбранная версия SAPFOR " + sapfor.version + " не собрана!");
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
Vector<SapforConfiguration> configurations = db.sapforConfigurations.getAutoConfigurations();
|
||||
if (configurations.isEmpty()) {
|
||||
Log.Writeln_("Не найдено конфигураций для автоматического тестирования!");
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
SapforPackage target = new SapforPackage(account,
|
||||
sapfor,
|
||||
configurations,
|
||||
1,
|
||||
Log);
|
||||
//-
|
||||
if (target.tasksCount == 0) {
|
||||
Log.Writeln_("Не сформировано ни одной новой задачи.");
|
||||
return null;
|
||||
Vector<SapforPackage> sapforPackages = new Vector<>();
|
||||
for (SapforConfiguration sapforConfiguration : configurations) {
|
||||
SapforPackage sapforPackage = new SapforPackage(account, sapfor,new Vector_<>(sapforConfiguration), 1, Log);
|
||||
if (sapforPackage.tasksCount > 0) {
|
||||
sapforPackages.add(sapforPackage);
|
||||
}
|
||||
}
|
||||
if (sapforPackages.isEmpty()){
|
||||
Log.Writeln_("Не сформировано ни одного пакета");
|
||||
return;
|
||||
}
|
||||
for (SapforPackage sapforPackage: sapforPackages){
|
||||
beforePublishAction(sapforPackage);
|
||||
db.InsertS(sapforPackage);
|
||||
afterPublishAction(sapforPackage);
|
||||
}
|
||||
beforePublishAction(target);
|
||||
db.InsertS(target);
|
||||
afterPublishAction(target);
|
||||
//--
|
||||
return target;
|
||||
}
|
||||
Vector<String> getSapforTaskResults(SapforTask task) throws Exception {
|
||||
Vector<String> res = new Vector<>();
|
||||
|
||||
@@ -103,6 +103,7 @@ public class SapforPackage extends TestingPackage<SapforPackage_json> {
|
||||
bad++;
|
||||
else good++;
|
||||
}
|
||||
bad+=mismatchesCount;
|
||||
state = (bad > 0) ? TasksPackageState.DoneWithErrors : TasksPackageState.Done;
|
||||
double percent = (((double) (good)) / tasksCount) * 100.0;
|
||||
description = "Выполнено на " + ((int) percent) + "%\n" +
|
||||
|
||||
Reference in New Issue
Block a user