fix(测试跟踪): 修复测试计划内部执行场景用例时没有记录场景执行次数的缺陷
--bug=1015093 --user=宋天阳 【测试跟踪】首页-过去7天测试计划失败用例top10,用例/场景失败次数没增加 https://www.tapd.cn/55049933/s/1208658
This commit is contained in:
parent
71586e321e
commit
de0adca302
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue