++
перевод тестов на гит, рефакторинг проходов загрузки репозитория
This commit is contained in:
@@ -12,7 +12,7 @@ import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
||||
import _VisualDVM.Constants;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.Tasks.TaskState;
|
||||
import _VisualDVM.Passes.All.DownloadDvmRepository;
|
||||
import _VisualDVM.Passes.All.DownloadDvmTestsRepository;
|
||||
import _VisualDVM.Passes.All.ZipFolderPass;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.ProjectData.Files.ProjectFile;
|
||||
@@ -295,14 +295,19 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
}).start();
|
||||
}
|
||||
void PerformAutoSapforTesting() throws Exception {
|
||||
int sapforId = Integer.parseInt(request.arg);
|
||||
if (!db.serverSapfors.containsKey(sapforId)) {
|
||||
throw new RepositoryRefuseException("Версия SAPFOR " + sapforId + " не существует.");
|
||||
}
|
||||
ServerSapfor sapfor = db.serverSapfors.get(sapforId);
|
||||
TextLog Log = new TextLog();
|
||||
SapforPackage autoPackage = tryAutoSapforTesting(Log);
|
||||
SapforPackage autoPackage = tryAutoSapforTesting(sapfor,Log);
|
||||
EmailMessage message = Log.isEmpty() ?
|
||||
new EmailMessage(
|
||||
"Запущено автоматическое тестирование версии " + request.arg + " системы SAPFOR",
|
||||
"Запущено автоматическое тестирование версии " + sapfor.version + " системы SAPFOR",
|
||||
"Пакет " + Utils_.Brackets(autoPackage.id)) :
|
||||
new EmailMessage(
|
||||
"Не удалось запустить автоматическое тестирование версии " + request.arg + " системы SAPFOR",
|
||||
"Не удалось запустить автоматическое тестирование версии " + sapfor.version + " системы SAPFOR",
|
||||
Log.toString()
|
||||
);
|
||||
for (String address : Constants.admins_mails)
|
||||
@@ -350,14 +355,14 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
void RefreshDVMTests() throws Exception {
|
||||
UserAccount account = new UserAccount("server", Constants.MailAddress);
|
||||
ServerSapfor serverSapfor = db.serverSapfors.getLastDoneVersion();
|
||||
DownloadDvmRepository downloadRepository = new DownloadDvmRepository();
|
||||
DownloadDvmTestsRepository downloadRepository = new DownloadDvmTestsRepository();
|
||||
if (!downloadRepository.Do())
|
||||
throw new RepositoryRefuseException("Не удалось обновить репозиторий");
|
||||
//-->>
|
||||
Vector<Pair<Group, Vector<File>>> groups = new Vector<>();
|
||||
File testsSrc = Paths.get(
|
||||
Global.RepoDirectory.getAbsolutePath(),
|
||||
"dvm", "tools", "tester", "trunk", "test-suite").toFile();
|
||||
"dvm-auto-test", "test-suite").toFile();
|
||||
LanguageName[] supportedLanguages = new LanguageName[]{LanguageName.fortran, LanguageName.c};
|
||||
for (LanguageName languageName : supportedLanguages) {
|
||||
for (TestType testType : TestType.values()) {
|
||||
@@ -606,21 +611,15 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
|
||||
}
|
||||
response.object = serverSapfor;
|
||||
}
|
||||
SapforPackage tryAutoSapforTesting(TextLog Log) throws Exception {
|
||||
SapforPackage tryAutoSapforTesting(ServerSapfor sapfor, TextLog Log) throws Exception {
|
||||
//--
|
||||
UserAccount account = new UserAccount();
|
||||
account.name = "server";
|
||||
account.email = Constants.MailAddress;
|
||||
account.role = AccountRole.Admin;
|
||||
//-
|
||||
int sapforId = Integer.parseInt(request.arg);
|
||||
if (!db.serverSapfors.containsKey(sapforId)) {
|
||||
Log.Writeln_("Версия SAPFOR " + sapforId + " не существует.");
|
||||
return null;
|
||||
}
|
||||
ServerSapfor sapfor = db.serverSapfors.get(sapforId);
|
||||
if (!sapfor.state.equals(ServerSapforState.Done)) {
|
||||
Log.Writeln_("Выбранная версия SAPFOR " + sapforId + " не собрана!");
|
||||
Log.Writeln_("Выбранная версия SAPFOR " + sapfor.version + " не собрана!");
|
||||
return null;
|
||||
}
|
||||
Vector<SapforConfiguration> configurations = db.sapforConfigurations.getAutoConfigurations();
|
||||
|
||||
@@ -4,6 +4,7 @@ import Common.Utils.TextLog;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.ComponentsServer.Component.Sapfor.Sapfor;
|
||||
import _VisualDVM.*;
|
||||
import _VisualDVM.Passes.All.DownloadSapforRepository;
|
||||
import _VisualDVM.ProjectData.LanguageName;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
@@ -233,14 +234,6 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
sapfor.state = state_in;
|
||||
ServerCommand(ServerCode.EditObject, sapfor);
|
||||
}
|
||||
void SyncronizeRepository() throws Exception {
|
||||
UpdateSapforState(ServerSapforState.SAPFORRepositorySynchronization);
|
||||
Utils.CleanDirectory(repo);
|
||||
Utils.startScript(repo, repo, "git_clone",
|
||||
"git clone " + Constants.SAPFOR_REPOSITORY + " " + Utils_.DQuotes(repo_sapfor) + " 1>spf_out.txt 2>spf_err.txt\n" +
|
||||
"cd " + Utils_.DQuotes(repo_sapfor) + "\n"+
|
||||
"GIT_SSL_NO_VERIFY=true git submodule update --init\n").waitFor();
|
||||
}
|
||||
void CompileSapfor() throws Exception {
|
||||
UpdateSapforState(ServerSapforState.Compilation);
|
||||
//-
|
||||
@@ -263,7 +256,10 @@ public class SapforTestingPlanner extends TestingPlanner<SapforPackage> {
|
||||
max_version = CommonConstants.Nan;
|
||||
current_version = CommonConstants.Nan;
|
||||
//--
|
||||
SyncronizeRepository();
|
||||
UpdateSapforState(ServerSapforState.SAPFORRepositorySynchronization);
|
||||
DownloadSapforRepository pass = new DownloadSapforRepository();
|
||||
pass.Do();
|
||||
//-
|
||||
max_version = (int) ServerCommand(ServerCode.GetMaxSapforVersion);
|
||||
current_version = Sapfor.readVersionFromCode(Paths.get(repo.getAbsolutePath(),
|
||||
"/SAPFOR/src/Utils/version.h").toFile());
|
||||
|
||||
Reference in New Issue
Block a user