fix(测试跟踪): 修复测试计划内部执行场景用例时没有记录场景执行次数的缺陷

--bug=1015093 --user=宋天阳 【测试跟踪】首页-过去7天测试计划失败用例top10,用例/场景失败次数没增加
https://www.tapd.cn/55049933/s/1208658
This commit is contained in:
song-tianyang 2022-07-24 16:11:26 +08:00 committed by 建国
parent 71586e321e
commit de0adca302
2 changed files with 21 additions and 21 deletions

View File

@ -296,6 +296,7 @@ public class ApiScenarioReportService {
if (testPlanApiScenario != null) {
if (report != null) {
testPlanApiScenario.setLastResult(report.getStatus());
report.setScenarioId(testPlanApiScenario.getApiScenarioId());
} else {
testPlanApiScenario.setLastResult(status);
}

View File

@ -16,6 +16,7 @@ public class DateUtils {
SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_PATTERM);
return dateFormat.parse(dateString);
}
public static Date getTime(String timeString) throws Exception {
SimpleDateFormat dateFormat = new SimpleDateFormat(TIME_PATTERN);
return dateFormat.parse(timeString);
@ -45,6 +46,7 @@ public class DateUtils {
SimpleDateFormat dateFormat = new SimpleDateFormat(TIME_PATTERN);
return dateFormat.format(timeStamp);
}
public static String getDataStr(long timeStamp) {
SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_PATTERM);
return dateFormat.format(timeStamp);
@ -68,7 +70,7 @@ public class DateUtils {
}
/**
* 获取入参日期所在周的周一周末日期 日期对应的时间为当日的零点
* 获取入参日期所在周 日期对应的时间为当日的零点
*
* @return Map<String, String>(2); key取值范围firstTime/lastTime
*/
@ -76,13 +78,9 @@ public class DateUtils {
Map<String, Date> returnMap = new HashMap<>();
Calendar calendar = Calendar.getInstance();
//Calendar默认一周的开始是周日业务需求从周一开始算所以要"+1"
int weekDayAdd = 1;
try {
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, calendar.getActualMinimum(Calendar.DAY_OF_WEEK));
calendar.add(Calendar.DAY_OF_MONTH,weekDayAdd);
//第一天的时分秒是 00:00:00 这里直接取日期默认就是零点零分
Date thisWeekFirstTime = getDate(getDateString(calendar.getTime()));
@ -90,7 +88,6 @@ public class DateUtils {
calendar.clear();
calendar.setTime(date);
calendar.set(Calendar.DAY_OF_WEEK, calendar.getActualMaximum(Calendar.DAY_OF_WEEK));
calendar.add(Calendar.DAY_OF_MONTH,weekDayAdd);
//最后一天的时分秒应当是23:59:59 处理方式是增加一天计算日期再-1
calendar.add(Calendar.DAY_OF_MONTH, 1);
@ -108,6 +105,7 @@ public class DateUtils {
/**
* 获取当前时间或者当前时间+- 任意天数 时间的时间戳
*
* @param countDays
* @return
*/
@ -118,6 +116,7 @@ public class DateUtils {
/**
* 获取当天的起始时间Date
*
* @param time 指定日期 2020-12-13 06:12:42
* @return 当天起始时间 2020-12-13 00:00:00
* @throws Exception