Describe the question
Improvement the TaskInstanceServiceTest test case for TaskInstanceService for full coverage (100% method coverage).
Test case specifications
https://dolphinscheduler.apache.org/zh-cn/docs/development/unit-test.html
Important: Need to improvement the test case according to the specifications
Which version of DolphinScheduler:
-[dev]
Anyone who want to take it, welcome to leave a message~
Anyone who want to take it, welcome to leave a message~
I will take [Test-3556] to write the unittest to full coverage.
I will be willing to do this. Before i am doing this, I want you to confirm the unit test cases I need to write.

I use the following test case to cover the yellow(current unit test case not all hit) and red(current unit test case not hit) lines:
May be i can use only one unit test case to cover this, I'm not sure which one is better.
Finally I have a question, Why put so many unit test cases into one method? As i am concerned, i'd like to place each unit test in one method., then named the method with "given_xxx_when_xxx_then_xxx" or comment with "given xxx when xxx then xxx". When [regression testing | CI] running fail, i can locate cause of unit test case instead of method name.
I just remove the try catch, no need to catch ,
the parse will return null rather than throw exception
/**
* convert string to date and time
*
* @param date date
* @param format format
* @return date
*/
public static Date parse(String date, String format) {
try {
LocalDateTime ldt = LocalDateTime.parse(date, DateTimeFormatter.ofPattern(format));
return localDateTime2Date(ldt);
} catch (Exception e) {
logger.error("error while parse date:" + date, e);
}
return null;
}
..... 英文不好的我哭出声, 翻译后, 结果被人抢先了
..... 英文不好的我哭出声, 翻译后, 结果被人抢先了
Currently, our server module has some unit tests that need to be refactored, maybe you can try to participate in this
You can refer to our unit test benchmarks, we will present a case, and hope that you can participate together
..... 英文不好的我哭出声, 翻译后, 结果被人抢先了
Hi, i am sorry for that, but you can refer to #3557 , it also a api server module test case improve issue.
Remember leave a message before you implement it~
close by #3563
Most helpful comment
..... 英文不好的我哭出声, 翻译后, 结果被人抢先了