You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2020/08/19 12:25:28 UTC
[GitHub] [incubator-dolphinscheduler] yangyichao-mango opened a new issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
yangyichao-mango opened a new issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556
**Describe the question**
Improvement the TaskInstanceServiceTest test case for `TaskInstanceService` for full coverage.
Test case example: https://github.com/apache/incubator-dolphinscheduler/blob/dev/dolphinscheduler-api/src/test/java/org/apache/dolphinscheduler/api/service/ProcessDefinitionServiceTest.java
**Which version of DolphinScheduler:**
-[dev]
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] geosmart commented on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
geosmart commented on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-677658257
> Anyone who want to take it, welcome to leave a message~
I will take [Test-3556] to write the unittest to full coverage.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] CalvinKirs closed issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
CalvinKirs closed issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] SunJiFengPlus commented on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
SunJiFengPlus commented on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-677671574
..... 英文不好的我哭出声, 翻译后, 结果被人抢先了
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] CalvinKirs commented on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-782523483
close by #3563
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] SunJiFengPlus commented on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
SunJiFengPlus commented on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-677670233
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.
<img width="400" alt="截屏2020-08-20 21 00 08" src="https://user-images.githubusercontent.com/39667700/90773282-3d9b3400-e328-11ea-86c3-e82b087cfa29.png">
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:
1. param without stateType
2. param without startDate
3. param without endDate
4. param startDate with illegal format
5. param startDate with illegal format
6. both 4 and 5
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.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] yangyichao-mango commented on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
yangyichao-mango commented on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-677683684
> ..... 英文不好的我哭出声, 翻译后, 结果被人抢先了
Hi, i am sorry for that, but you can refer to #3557 , it also a api server module test case improve issue.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] geosmart commented on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
geosmart commented on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-677671084
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;
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] yangyichao-mango commented on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
yangyichao-mango commented on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-676350344
Anyone who want to take it, welcome to leave a message~
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] yangyichao-mango edited a comment on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
yangyichao-mango edited a comment on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-677683684
> ..... 英文不好的我哭出声, 翻译后, 结果被人抢先了
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~
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] CalvinKirs commented on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
CalvinKirs commented on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-677674712
> ..... 英文不好的我哭出声, 翻译后, 结果被人抢先了
Currently, our server module has some unit tests that need to be refactored, maybe you can try to participate in this
#3556
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] CalvinKirs edited a comment on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
CalvinKirs edited a comment on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-677674712
> ..... 英文不好的我哭出声, 翻译后, 结果被人抢先了
Currently, our server module has some unit tests that need to be refactored, maybe you can try to participate in this
#3512
You can refer to our unit test benchmarks, we will present a case, and hope that you can participate together
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-dolphinscheduler] CalvinKirs edited a comment on issue #3556: [Test][api] Improvement `TaskInstanceServiceTest`
Posted by GitBox <gi...@apache.org>.
CalvinKirs edited a comment on issue #3556:
URL: https://github.com/apache/incubator-dolphinscheduler/issues/3556#issuecomment-677674712
> ..... 英文不好的我哭出声, 翻译后, 结果被人抢先了
Currently, our server module has some unit tests that need to be refactored, maybe you can try to participate in this
#3512
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org