DolphinScheduler/dolphinscheduler-api-test
Aaron Wang 08335b1032
[Improvement][Task] Improved way to collect yarn job's appIds (#12197)
* Provide aop way as an optional way to collect yarn job's applicationId, and import new module `dolphinscheduler-aop` to place the aop code.
* Add user property `appId.collect` for user to decide how to collect applicationId.
* Add new environment configuration for each type of yarn tasks to support aop in `dolphinscheduler_env.sh`
* Update docs to declare how to use aop way.
* Update `LogUtils` to support fetch applicationId in different ways based on the user property.

Co-authored-by: gabrywu <gabrywu@apache.com>
2022-10-31 16:52:53 +08:00
..
dolphinscheduler-api-test-case [Improvement][Task] Improved way to collect yarn job's appIds (#12197) 2022-10-31 16:52:53 +08:00
dolphinscheduler-api-test-core [API-Test] [Checkstyle] Reformat api-test code and enable checkstyle (#10805) 2022-07-06 14:24:13 +08:00
lombok.config [Feature-10411] Add tenant api test (#10442) 2022-06-15 16:29:36 +08:00
pom.xml [Feature][style] Add spotless maven plugin for automatic style fix. (#11272) 2022-08-06 19:29:23 +08:00
README.md [Doc][Style] Fix doc format once for all (#12006) 2022-09-17 11:33:32 +08:00

DolphinScheduler Backend API Test

Page Object Model

DolphinScheduler API test respects the Page Object Model (POM) design pattern. Every page of DolphinScheduler's api is abstracted into a class for better maintainability.

Example

The login page's api is abstracted as LoginPage , with the following fields,

public HttpResponse login(String username, String password) {
    Map<String, Object> params = new HashMap<>();

    params.put("userName", username);
    params.put("userPassword", password);

    RequestClient requestClient = new RequestClient();

    return requestClient.post("/login", null, params);
}

where userName, userPassword are the main elements on UI that we are interested in.

Test Environment Setup

DolphinScheduler API test uses testcontainers to set up the testing environment, with docker compose.

Typically, every test case needs one or more docker-compose.yaml files to set up all needed components, and expose the DolphinScheduler UI port for testing. You can use @DolphinScheduler(composeFiles = "") and pass the docker-compose.yaml files to automatically set up the environment in the test class.


@DolphinScheduler(composeFiles = "docker/tenant/docker-compose.yaml")
class TenantAPITest {
}