question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CI/CD]Add unit test

See original GitHub issue

follow 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:closed
  • Created 4 years ago
  • Comments:23 (23 by maintainers)

github_iconTop GitHub Comments

1reaction
samz406commented, Dec 18, 2019

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

1reaction
nauucommented, Dec 17, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found