исправление анализа вывода тестов. если число линий содержащих start и end одинаковое, то число завершенных тестов может быть нулевым, иначе неверный формат.

This commit is contained in:
2023-12-08 01:17:45 +03:00
parent 25d5c4b7f0
commit fc20f95457
2 changed files with 20 additions and 6 deletions

5
.idea/workspace.xml generated
View File

@@ -6,7 +6,10 @@
</artifacts-to-build> </artifacts-to-build>
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="" /> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Utils/Utils.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Utils/Utils.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />

View File

@@ -1074,6 +1074,8 @@ public class Utils {
int complete = 0; int complete = 0;
int errors = 0; int errors = 0;
int total = 0; int total = 0;
int starts = 0;
int ends = 0;
for (String s : lines) { for (String s : lines) {
String line = s.toUpperCase(); String line = s.toUpperCase();
if (line.contains("COMPLETE")) { if (line.contains("COMPLETE")) {
@@ -1082,12 +1084,21 @@ public class Utils {
} else if (line.contains("ERROR")) { } else if (line.contains("ERROR")) {
errors++; errors++;
total++; total++;
} else if (line.contains("START")) {
starts++;
} else if (line.contains("END")) {
ends++;
} }
} }
return new Pair<>( TaskState state = TaskState.Finished;
(errors > 0) ? TaskState.DoneWithErrors : ((complete > 0) ? TaskState.Done : TaskState.WrongTestFormat), if (starts != ends) {
(int) ((((double) complete) / total) * 100) state = TaskState.WrongTestFormat;
); } else if (errors > 0) {
state = TaskState.DoneWithErrors;
}else {
state = TaskState.Done;
}
return new Pair<>( state, (int) ((((double) complete) / total) * 100));
} }
public static Pair<TaskState, Integer> analyzePerformance(List<String> lines) { public static Pair<TaskState, Integer> analyzePerformance(List<String> lines) {
StringTemplate stringTemplate = new StringTemplate("Verification =", ""); StringTemplate stringTemplate = new StringTemplate("Verification =", "");