ввел состояние пакета тестирования - выполнен с ошибками.
This commit is contained in:
@@ -7,6 +7,7 @@ import Common.Utils.Utils;
|
||||
import GlobalData.Account.Account;
|
||||
import ProjectData.LanguageName;
|
||||
import Repository.Component.Sapfor.Sapfor;
|
||||
import Repository.EmailMessage;
|
||||
import Repository.RepositoryRefuseException;
|
||||
import Repository.RepositoryServer;
|
||||
import Repository.Server.ServerCode;
|
||||
@@ -55,8 +56,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
+ "\nТест будет удален"
|
||||
);
|
||||
}
|
||||
}
|
||||
else if (object instanceof DVMPackage) {
|
||||
} else if (object instanceof DVMPackage) {
|
||||
DVMPackage dvmPackage = (DVMPackage) object;
|
||||
//--
|
||||
Utils.CheckAndCleanDirectory(dvmPackage.getLocalWorkspace());
|
||||
@@ -64,8 +64,7 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
dvmPackage.saveJson();
|
||||
dvmPackage.package_json = null; // объект больше не нужен.
|
||||
//--
|
||||
}
|
||||
else if (object instanceof SapforPackage) {
|
||||
} else if (object instanceof SapforPackage) {
|
||||
((SapforPackage) object).init();
|
||||
}
|
||||
}
|
||||
@@ -175,16 +174,13 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
TextLog Log = new TextLog();
|
||||
tryAutoSapforTesting(Log);
|
||||
response = new ServerExchangeUnit_2021(ServerCode.OK);
|
||||
if (!Log.isEmpty()){
|
||||
/*
|
||||
Vector<String> targets = new Vector<>(Arrays.asList(Global.admins_mails));
|
||||
if (!Log.isEmpty()) {
|
||||
EmailMessage message = new EmailMessage(
|
||||
"Выполнена сборка системы SAPFOR",
|
||||
"Версия: " + version_s + "\n" + "Статус: " + status,
|
||||
targets
|
||||
);
|
||||
Email(message);
|
||||
*/
|
||||
"Не удалось запустить автоматическое тестирование системы SAPFOR",
|
||||
Log.toString(),
|
||||
new Vector<>()
|
||||
);
|
||||
Email(message);
|
||||
}
|
||||
break;
|
||||
case DownloadTest:
|
||||
@@ -611,22 +607,22 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
void tryAutoSapforTesting(TextLog Log) throws Exception {
|
||||
//--
|
||||
Account account = new Account();
|
||||
account.name= "server";
|
||||
account.email= Constants.MailAddress;
|
||||
account.name = "server";
|
||||
account.email = Constants.MailAddress;
|
||||
//-
|
||||
int sapforId = Integer.parseInt(request.arg);
|
||||
if (!db.serverSapfors.containsKey(sapforId)){
|
||||
Log.Writeln_("Версия SAPFOR "+sapforId+" не существует.");
|
||||
if (!db.serverSapfors.containsKey(sapforId)) {
|
||||
Log.Writeln_("Версия SAPFOR " + sapforId + " не существует.");
|
||||
return;
|
||||
}
|
||||
ServerSapfor sapfor = db.serverSapfors.get(sapforId);
|
||||
if (!sapfor.state.equals(ServerSapforState.Done)){
|
||||
Log.Writeln_("Выбранная версия SAPFOR "+sapforId+" не собрана!");
|
||||
if (!sapfor.state.equals(ServerSapforState.Done)) {
|
||||
Log.Writeln_("Выбранная версия SAPFOR " + sapforId + " не собрана!");
|
||||
return;
|
||||
}
|
||||
Vector<SapforConfiguration> configurations= db.sapforConfigurations.getAutoConfigurations();
|
||||
if (configurations.isEmpty()){
|
||||
Log.Writeln_("Не найдено конфигурация для автоматического тестирования!");
|
||||
Vector<SapforConfiguration> configurations = db.sapforConfigurations.getAutoConfigurations();
|
||||
if (configurations.isEmpty()) {
|
||||
Log.Writeln_("Не найдено конфигураций для автоматического тестирования!");
|
||||
return;
|
||||
}
|
||||
SapforPackage target = new SapforPackage(account,
|
||||
@@ -635,6 +631,10 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
1,
|
||||
Log);
|
||||
//-
|
||||
if (target.tasksCount == 0) {
|
||||
Log.Writeln_("Не сформировано ни одной новой задачи.");
|
||||
return;
|
||||
}
|
||||
beforePublishAction(target);
|
||||
db.InsertS(target);
|
||||
afterPublishAction(target);
|
||||
|
||||
Reference in New Issue
Block a user