[CI/CD]Add unit test
See original GitHub issuefollow the root issue: #1460 Notice:
- The ut coverage is required to reach 60%
- UT only use junit and mockito, we worried about license issues after other library is introduced
- UT cannot include performance testing operations, blocking operations (time-consuming), and cannot rely on third-party libs. If you want to rely on testing, you can use mockito to mock.
The directory listing which will write ut is as following(if you want to contribute, you may reply "java.org.apache.dolphinscheduler.api.utils, i want to implement it, avoid everyone writing UT repeatedly):
βββ java
βΒ Β βββ org
βΒ Β βββ apache
βΒ Β βββ dolphinscheduler
βΒ Β βββ api
βΒ Β βββ ApiApplicationServer.java
βΒ Β βββ CombinedApplicationServer.java
βΒ Β βββ configuration
βΒ Β βββ controller
βΒ Β βββ dto
βΒ Β βββ enums
βΒ Β βββ interceptor
βΒ Β βββ log
βΒ Β βββ service
βΒ Β βββ utils
βββ java
βΒ Β βββ org
βΒ Β βββ apache
βΒ Β βββ dolphinscheduler
βΒ Β βββ common
βΒ Β βββ Constants.java
βΒ Β βββ IStoppable.java
βΒ Β βββ enums
βΒ Β βββ graph
βΒ Β βββ job
βΒ Β βββ model
βΒ Β βββ process
βΒ Β βββ queue
βΒ Β βββ shell
βΒ Β βββ task
βΒ Β βββ thread
βΒ Β βββ utils
βΒ Β βββ zk
βββ java
βΒ Β βββ org
βΒ Β βββ apache
βΒ Β βββ dolphinscheduler
βΒ Β βββ alert
βΒ Β βββ AlertServer.java
βΒ Β βββ manager
βΒ Β βββ runner
βΒ Β βββ utils
If you had finished the ut, you should modify the pom.xml file, and add the include files like this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
<configuration>
<includes>
<include>**/common/graph/*.java</include><!--run test classes-->
</includes>
<!-- <skip>true</skip> -->
</configuration>
</plugin>
Note: Now, ci has support db, if you develop mapper/dao ut, you can use it, and it had config in dolphinscheduler-dao/src/main/resources/application-dao.properties
Issue Analytics
- State:
- Created 4 years ago
- Comments:23 (23 by maintainers)
Top Results From Across the Web
Cicada: An integration testing framework for Docker and ...
Writing integration tests with the Cicada integration testing framework. ... You can write unit tests, but these are for testing small,Β ...
Read more >Cicada Distributed
Cicada tests and all their necessary machinery are written in Python and resemble familiar unit testing tools like Pytest. This makes Cicada very...
Read more >Test Tones - Cicada Audio
Here are test tones we use everyday for audio system testing. ... we cut thru all the BS on knowing where your head...
Read more >Module 4 Quiz - CICADA Platform
Unit 1: Introduction to Multiple Intelligences theory and the concept of wellbeing. 2 Topics | 1 Quiz. Topic 1: Foundations of Multiple Intelligences...
Read more >CICADAGreenBankSpectrometer...
Introduction Β· Engineering Tests (Anish) Β· Ripple Tests (Amanda) Β· Astronomical Tests (Richard, Sam, Adam). RRL tests; Continuum Tests; Deep integration tests.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I want to implements org.apache.dolphinscheduler.api.service.SessionService org.apache.dolphinscheduler.api.service.UsersService org.apache.dolphinscheduler.api.service.TenantService org.apache.dolphinscheduler.api.service.WorkerGroupService org.apache.dolphinscheduler.api.service.UdfFuncService org.apache.dolphinscheduler.api.service.AlertGroupService org.apache.dolphinscheduler.api.service.ProjectService
I found there is a shell UT in βimplement org.apache.dolphinscheduler.common.shellβ.
So Iβd like to implement org.apache.dolphinscheduler.alert.utils