ввод флага для конфигураций, учитывать только группы
This commit is contained in:
2025-03-18 19:26:32 +03:00
parent afaaaba1e7
commit 3f4ef5f198
11 changed files with 77 additions and 26 deletions

16
.idea/workspace.xml generated
View File

@@ -7,17 +7,17 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DeleteRemoteWorkspace.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/SubscriberWorkspace/UI/SubscriberWorkspacesForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/SubscriberWorkspace/UI/SubscriberWorkspacesForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Tasks/TaskState.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/GlobalData/Tasks/TaskState.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/RepositoryServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMPackage/DVMPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMPackage/DVMPackage.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Utils.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/StartSelectedDVMConfigurations.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/StartSelectedDVMConfigurations.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ServerObjectsCache/ConfigurationCache.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ServerObjectsCache/ConfigurationCache.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Configuration/Configuration.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/Configuration/Configuration.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/Common/TestsDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMConfiguration/UI/DVMConfigurationDialog.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMConfiguration/UI/DVMConfigurationDialog.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMConfiguration/UI/DVMConfigurationFields.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMConfiguration/UI/DVMConfigurationFields.form" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMConfiguration/UI/DVMConfigurationFields.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMConfiguration/UI/DVMConfigurationFields.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMConfiguration/UI/DVMConfigurationsForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/TestingSystem/DVM/DVMConfiguration/UI/DVMConfigurationsForm.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -32,9 +32,9 @@
"CompleteRunEnvironments": true,
"CreateEthalonTasks": true,
"ErasePackageWorkspace": true,
"lastMachineId": 1,
"lastUserId": 17,
"lastCompilerId": 15,
"lastMachineId": 28,
"lastUserId": 36,
"lastCompilerId": 110,
"RegisterOn": false,
"SpacesOn": false,
"EmptyLinesOn": false,

View File

@@ -3,7 +3,7 @@ import Common.Utils.Vector_;
import java.util.Vector;
public class Constants {
public static final int version = 1217;
public static final int version = 1218;
public static final int planner_version = 24;
public static final int testingMaxKernels = 64;
//--

View File

@@ -66,6 +66,12 @@ public class StartSelectedDVMConfigurations extends PublishServerObject<TestingS
return false;
}
Vector<DVMConfiguration> configurations = Global.testingServer.db.dvmConfigurations.getUI().getSelectedOrCurrent();
// for (DVMConfiguration configuration:configurations){
// Global.testingServer.db.actualizeConfigurationGroups(configuration);
// }
//---
//проверить конфигурации на соответствие группам.
//если конфигурации количество тестов 0, но есть группы.проверить на пустоту этих групп,и заполнить заново всеми их тестами.
//---
target = new DVMPackage(
Global.mainModule.getAccount(),
@@ -84,6 +90,10 @@ public class StartSelectedDVMConfigurations extends PublishServerObject<TestingS
return UI.Question("Будет запущено " + target.tasksCount + " задач. Продолжить");
}
@Override
protected void showPreparation() throws Exception {
getDb().getTable(DVMConfiguration.class).ShowUI();
}
@Override
protected void ServerAction() throws Exception {
Command(new SafeServerExchangeUnit(ServerCode.PublishObject, user.password, target));
pk = server_response.object;

View File

@@ -14,13 +14,16 @@ import _VisualDVM.TestingSystem.Common.Test.Test;
import java.util.LinkedHashMap;
import java.util.Vector;
public class ConfigurationCache extends VisualCache {
public GroupsJson groupsJson = null;
public TestsJson testsJson = null;
public int groupsOnly = 0;
public SettingsArrayJson settingsJson = null;
public String settingsSummary = null;
public Vector<String> groupsSummary = null;
//--
public ConfigurationCache(Configuration configuration) {
groupsOnly = configuration.groupsOnly;
if (configuration.packedGroupsJson.isEmpty())
groupsJson = new GroupsJson(); //просто пустой
else
@@ -57,7 +60,9 @@ public class ConfigurationCache extends VisualCache {
settingsSummary = String.join(";", settingsDescriptionsVector);
}
public int getTestsCount() {
return testsJson.array.size();
return getTests().size();
// testsJson.array.size(); временно, до обновления БД.
}
public Vector<Group> getGroups() {
Vector<Group> groups = new Vector<>();
@@ -69,20 +74,30 @@ public class ConfigurationCache extends VisualCache {
}
public Vector<Test> getTests() {
Vector<Test> tests = new Vector<>();
for (TestJson testJson : testsJson.array) {
if (Global.testingServer.db.tests.containsKey(testJson.id))
tests.add(Global.testingServer.db.tests.get(testJson.id));
if (groupsOnly==0) {
for (TestJson testJson : testsJson.array) {
if (Global.testingServer.db.tests.containsKey(testJson.id))
tests.add(Global.testingServer.db.tests.get(testJson.id));
}
}else {
for (Group group: getGroups()){
tests.addAll(Global.testingServer.db.getVectorByFK(group,Test.class));
}
}
return tests;
}
public Vector<Test> getGroupTests(Group group) {
Vector<Test> tests = new Vector<>();
for (TestJson testJson : testsJson.array) {
if (Global.testingServer.db.tests.containsKey(testJson.id)) {
Test test = Global.testingServer.db.tests.get(testJson.id);
if (test.group_id == group.id)
tests.add(test);
if (groupsOnly==0) {
for (TestJson testJson : testsJson.array) {
if (Global.testingServer.db.tests.containsKey(testJson.id)) {
Test test = Global.testingServer.db.tests.get(testJson.id);
if (test.group_id == group.id)
tests.add(test);
}
}
}else {
return Global.testingServer.db.getVectorByFK(group, Test.class);
}
return tests;
}

View File

@@ -40,10 +40,16 @@ public class Configuration extends riDBObject {
@Description("DEFAULT ''")
public String packedSettingsJson = "";
@Description("DEFAULT -1")
public int ethalon_id = CommonConstants.Nan; //пакет-эталон
public int ethalon_id = CommonConstants.Nan; //пакет-эталон ( в двм тестировании не нужен.)
@Description("DEFAULT 0")
public int groupsOnly = 0;
//если флаг выставлен, то при формировании пакета берутся все тесты из участвущих групп. тесты конфигурации игнорируются.
//----
public String printAuto() {
return autoTesting > 0 ? "Да" : "Нет";
return autoTesting != 0 ? "Да" : "Нет";
}
public String printGroupsOnly() {
return groupsOnly !=0 ? "Да" : "Нет";
}
public String printEthalon() {
return (ethalon_id == CommonConstants.Nan) ? "" : String.valueOf(ethalon_id);
@@ -74,6 +80,7 @@ public class Configuration extends riDBObject {
maxtime = c.maxtime;
autoTesting = c.autoTesting;
kernels = c.kernels;
groupsOnly = c.groupsOnly;
//-
packedGroupsJson = c.packedGroupsJson;
packedTestsJson = c.packedTestsJson;

View File

@@ -8,7 +8,9 @@ import _VisualDVM.Constants;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.ProjectData.Files.ProjectFile;
import _VisualDVM.ServerObjectsCache.ConfigurationCache;
import _VisualDVM.ServerObjectsCache.VisualCaches;
import _VisualDVM.TestingSystem.Common.Configuration.Configuration;
import _VisualDVM.TestingSystem.Common.Group.Group;
import _VisualDVM.TestingSystem.Common.Group.GroupsDBTable;
import _VisualDVM.TestingSystem.Common.Test.Json.TestFileJson;

View File

@@ -20,6 +20,7 @@ public class DVMConfigurationDialog extends DBObjectDialog<DVMConfiguration, DVM
fields.sCompilationMaxtime.setValue(Result.c_maxtime);
fields.sRunMaxtime.setValue(Result.maxtime);
fields.sKernels.setValue(Result.kernels);
fields.cbGroupsOnly.setSelected(Result.groupsOnly != 0);
}
@Override
public void ProcessResult() {
@@ -27,6 +28,7 @@ public class DVMConfigurationDialog extends DBObjectDialog<DVMConfiguration, DVM
Result.c_maxtime = (int) fields.sCompilationMaxtime.getValue();
Result.maxtime = (int) fields.sRunMaxtime.getValue();
Result.kernels = (int) fields.sKernels.getValue();
Result.groupsOnly = fields.cbGroupsOnly.isSelected() ? 1 : 0;
}
@Override
public void SetReadonly() {

View File

@@ -3,12 +3,12 @@
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="467" height="163"/>
<xy x="20" y="20" width="467" height="195"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="5bf8c" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="5bf8c" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
@@ -27,7 +27,7 @@
</component>
<vspacer id="68a9">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="fdaa3" class="javax.swing.JTextField" binding="tfName" custom-create="true">
@@ -98,6 +98,19 @@
</constraints>
<properties/>
</component>
<component id="89323" class="javax.swing.JCheckBox" binding="cbGroupsOnly">
<constraints>
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<horizontalAlignment value="0"/>
<icon value="Common/icons/NotPick.png"/>
<selectedIcon value="Common/icons/Pick.png"/>
<text value="учитывать только группы"/>
<toolTipText value="При формировании пакета, брать все тест из входящих групп"/>
</properties>
</component>
</children>
</grid>
</children>

View File

@@ -12,6 +12,7 @@ public class DVMConfigurationFields implements DialogFields {
public JSpinner sKernels;
//-
private JPanel content;
public JCheckBox cbGroupsOnly;
public DVMConfigurationFields() {
sCompilationMaxtime.setModel(new SpinnerNumberModel(40,
5, 3600, 1

View File

@@ -57,6 +57,7 @@ public class DVMConfigurationsForm extends RDataSetControlForm<DVMConfiguration>
return RendererMultiline.class;
}
},
new ColumnInfo<DVMConfiguration>("тестов") {
@Override
public Object getFieldAt(DVMConfiguration object) {