You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by "EricGao888 (via GitHub)" <gi...@apache.org> on 2023/04/17 06:39:13 UTC
[GitHub] [dolphinscheduler] EricGao888 opened a new pull request, #13936: [Improvement][API Test] Add API tests worker group related APIs
EricGao888 opened a new pull request, #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936
<!--Thanks very much for contributing to Apache DolphinScheduler. Please review https://dolphinscheduler.apache.org/en-us/community/development/pull-request.html before opening a pull request.-->
## Purpose of the pull request
* Add API tests for `worker group` related APIs
* This PR closes: #13859
## Brief change log
<!--*(for example:)*
- *Add maven-checkstyle-plugin to root pom.xml*
-->
## Verify this pull request
<!--*(Please pick either of the following options)*-->
This pull request is code cleanup without any test coverage.
*(or)*
This pull request is already covered by existing tests, such as *(please describe tests)*.
(or)
This change added tests and can be verified as follows:
<!--*(example:)*
- *Added dolphinscheduler-dao tests for end-to-end.*
- *Added CronUtilsTest to verify the change.*
- *Manually verified the change by testing locally.* -->
(or)
If your pull request contain incompatible change, you should also add it to `docs/docs/en/guide/upgrede/incompatible.md`
--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #13936: [Improvement][API Test] Add API tests for worker group related APIs
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936#issuecomment-1510868031
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=13936)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13936&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13936&metric=duplicated_lines_density&view=list) No Duplication information
--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #13936: [Improvement][API Test] Add API tests for worker group related APIs
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936#issuecomment-1522736055
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=13936)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13936&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13936&metric=duplicated_lines_density&view=list) No Duplication information
--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] SbloodyS merged pull request #13936: [Improvement][API Test] Add API tests for worker group related APIs
Posted by "SbloodyS (via GitHub)" <gi...@apache.org>.
SbloodyS merged PR #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936
--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #13936: [Improvement][API Test] Add API tests for worker group related APIs
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936#issuecomment-1522737171
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=13936)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13936&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13936&metric=duplicated_lines_density&view=list) No Duplication information
--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] codecov-commenter commented on pull request #13936: [Improvement][API Test] Add API tests for worker group related APIs
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936#issuecomment-1522732856
## [Codecov](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#13936](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5cdb138) into [dev](https://codecov.io/gh/apache/dolphinscheduler/commit/119f08d2bafd7d280dd9d323dae21ead2e08147f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (119f08d) will **decrease** coverage by `0.66%`.
> The diff coverage is `11.14%`.
> :exclamation: Current head 5cdb138 differs from pull request most recent head 506afdd. Consider uploading reports for the commit 506afdd to get more accurate results
```diff
@@ Coverage Diff @@
## dev #13936 +/- ##
============================================
- Coverage 38.86% 38.20% -0.66%
+ Complexity 4455 4433 -22
============================================
Files 1158 1220 +62
Lines 42439 42650 +211
Branches 4780 4700 -80
============================================
- Hits 16494 16295 -199
- Misses 24123 24552 +429
+ Partials 1822 1803 -19
```
| [Impacted Files](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...inscheduler/api/controller/ExecutorController.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2NvbnRyb2xsZXIvRXhlY3V0b3JDb250cm9sbGVyLmphdmE=) | `17.94% <0.00%> (ø)` | |
| [...er/api/controller/ProcessDefinitionController.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2NvbnRyb2xsZXIvUHJvY2Vzc0RlZmluaXRpb25Db250cm9sbGVyLmphdmE=) | `58.62% <ø> (ø)` | |
| [...uler/api/controller/ProcessInstanceController.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2NvbnRyb2xsZXIvUHJvY2Vzc0luc3RhbmNlQ29udHJvbGxlci5qYXZh) | `69.56% <ø> (ø)` | |
| [...nscheduler/api/controller/SchedulerController.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2NvbnRyb2xsZXIvU2NoZWR1bGVyQ29udHJvbGxlci5qYXZh) | `82.60% <ø> (ø)` | |
| [...eduler/api/dto/workflow/WorkflowCreateRequest.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2R0by93b3JrZmxvdy9Xb3JrZmxvd0NyZWF0ZVJlcXVlc3QuamF2YQ==) | `100.00% <ø> (ø)` | |
| [...eduler/api/dto/workflow/WorkflowUpdateRequest.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL2R0by93b3JrZmxvdy9Xb3JrZmxvd1VwZGF0ZVJlcXVlc3QuamF2YQ==) | `36.36% <ø> (-5.31%)` | :arrow_down: |
| [...che/dolphinscheduler/api/python/PythonGateway.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3B5dGhvbi9QeXRob25HYXRld2F5LmphdmE=) | `16.94% <0.00%> (-0.30%)` | :arrow_down: |
| [...eduler/api/service/impl/DataSourceServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9EYXRhU291cmNlU2VydmljZUltcGwuamF2YQ==) | `49.40% <ø> (ø)` | |
| [...r/api/service/impl/WorkFlowLineageServiceImpl.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3NlcnZpY2UvaW1wbC9Xb3JrRmxvd0xpbmVhZ2VTZXJ2aWNlSW1wbC5qYXZh) | `29.28% <0.00%> (-0.22%)` | :arrow_down: |
| [...org/apache/dolphinscheduler/api/vo/ScheduleVo.java](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZG9scGhpbnNjaGVkdWxlci1hcGkvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2RvbHBoaW5zY2hlZHVsZXIvYXBpL3ZvL1NjaGVkdWxlVm8uamF2YQ==) | `0.00% <0.00%> (ø)` | |
| ... and [150 more](https://codecov.io/gh/apache/dolphinscheduler/pull/13936?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
... and [55 files with indirect coverage changes](https://codecov.io/gh/apache/dolphinscheduler/pull/13936/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #13936: [Improvement][API Test] Add API tests for worker group related APIs
Posted by "EricGao888 (via GitHub)" <gi...@apache.org>.
EricGao888 commented on code in PR #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936#discussion_r1169421793
##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/resources/docker/basic/docker-compose.yaml:
##########
@@ -26,12 +26,18 @@ services:
ports:
- "12345:12345"
networks:
- - api-test
+ network:
+ ipv4_address: 10.5.0.5
healthcheck:
test: [ "CMD", "curl", "http://localhost:12345/actuator/health" ]
interval: 5s
timeout: 60s
retries: 120
networks:
- api-test:
+ network:
+ driver: bridge
+ ipam:
+ config:
+ - subnet: 10.5.0.0/16
+ gateway: 10.5.0.1
Review Comment:
We need to know the worker ip address when calling `saveWorkerGroup`. If we use a random ip, it would figure out there is no such worker and lead to failure.

--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #13936: [Improvement][API Test] Add API tests for worker group related APIs
Posted by "EricGao888 (via GitHub)" <gi...@apache.org>.
EricGao888 commented on code in PR #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936#discussion_r1169420676
##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkerGroupAPITest.java:
##########
@@ -0,0 +1,134 @@
+/*
+ * Licensed to Apache Software Foundation (ASF) under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Apache Software Foundation (ASF) licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.dolphinscheduler.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;;
+import org.apache.dolphinscheduler.api.test.pages.security.WorkerGroupPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.common.enums.UserType;
+import org.apache.dolphinscheduler.dao.entity.User;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkerGroupAPITest {
+
+ private static final String username = "admin";
+
+ private static final String password = "dolphinscheduler123";
+
+ private static String sessionId;
+
+ private static User loginUser;
+
+ private static WorkerGroupPage workerGroupPage;
+
+ @BeforeAll
+ public static void setup() {
+ LoginPage loginPage = new LoginPage();
+ HttpResponse loginHttpResponse = loginPage.login(username, password);
+ sessionId = JSONUtils.convertValue(loginHttpResponse.getBody().getData(), LoginResponseData.class).getSessionId();
+ workerGroupPage = new WorkerGroupPage(sessionId);
+ loginUser = new User();
+ loginUser.setId(123);
+ loginUser.setUserType(UserType.GENERAL_USER);
+ }
+
+ @AfterAll
+ public static void cleanup() {
+ log.info("success cleanup");
+ }
+
+ @Test
+ @Order(1)
+ public void testSaveWorkerGroup() {
+ HttpResponse saveWorkerGroupHttpResponse = workerGroupPage
+ .saveWorkerGroup(loginUser, 1, "test_worker_group", "10.5.0.5:1234", "test", null);
+ Assertions.assertTrue(saveWorkerGroupHttpResponse.getBody().getSuccess());
+
+ HttpResponse queryAllWorkerGroupsResponse = workerGroupPage.queryAllWorkerGroups(loginUser);
+ List<String> workerGroupsList = (List<String>) queryAllWorkerGroupsResponse.getBody().getData();
+ Set<String> workerGroupsActual = new HashSet<>(workerGroupsList);
+ Set<String> workerGroupsExpected = new HashSet<>(Arrays.asList("test_worker_group", "default"));
+ Assertions.assertEquals(workerGroupsExpected, workerGroupsActual);
+ }
+
+ @Test
+ @Order(2)
+ public void testQueryAllWorkerGroupsPaging() {
+ HttpResponse queryAllWorkerGroupsPagingResponse = workerGroupPage.queryAllWorkerGroupsPaging(loginUser, 1, 2, null);
+ Assertions.assertTrue(queryAllWorkerGroupsPagingResponse.getBody().getSuccess());
+ log.info("[debug111] " + queryAllWorkerGroupsPagingResponse);
+ String workerGroupPageInfoData = queryAllWorkerGroupsPagingResponse.getBody().getData().toString();
+ Assertions.assertTrue(workerGroupPageInfoData.contains("test_worker_group"));
+ }
+
+ @Test
+ @Order(3)
+ public void testQueryAllWorkerGroups() {
+ HttpResponse queryAllWorkerGroupsResponse = workerGroupPage.queryAllWorkerGroups(loginUser);
+ Assertions.assertTrue(queryAllWorkerGroupsResponse.getBody().getSuccess());
+
+ String workerGroupPageInfoData = queryAllWorkerGroupsResponse.getBody().getData().toString();
+ Assertions.assertTrue(workerGroupPageInfoData.contains("test_worker_group"));
+ }
+
+ @Test
+ @Order(4)
+ public void queryWorkerAddressList() {
+ HttpResponse queryWorkerAddressListResponse = workerGroupPage.queryWorkerAddressList(loginUser);
+ Assertions.assertTrue(queryWorkerAddressListResponse.getBody().getSuccess());
+ Assertions.assertTrue(queryWorkerAddressListResponse.getBody().getData().toString().contains("10.5.0.5:1234"));
+ }
+
+ @Test
+ @Order(5)
+ public void testDeleteWorkerGroupById() {
+ HttpResponse queryAllWorkerGroupsResponse = workerGroupPage.queryAllWorkerGroups(loginUser);
+ String workerGroupsBeforeDelete = queryAllWorkerGroupsResponse.getBody().getData().toString();
+ log.info("[debug111] " + workerGroupsBeforeDelete);
Review Comment:
need to remove this debugging log
##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/WorkerGroupAPITest.java:
##########
@@ -0,0 +1,134 @@
+/*
+ * Licensed to Apache Software Foundation (ASF) under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Apache Software Foundation (ASF) licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.dolphinscheduler.api.test.cases;
+
+import org.apache.dolphinscheduler.api.test.core.DolphinScheduler;
+import org.apache.dolphinscheduler.api.test.entity.HttpResponse;
+import org.apache.dolphinscheduler.api.test.entity.LoginResponseData;
+import org.apache.dolphinscheduler.api.test.pages.LoginPage;;
+import org.apache.dolphinscheduler.api.test.pages.security.WorkerGroupPage;
+import org.apache.dolphinscheduler.api.test.utils.JSONUtils;
+import org.apache.dolphinscheduler.common.enums.UserType;
+import org.apache.dolphinscheduler.dao.entity.User;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+
+import lombok.extern.slf4j.Slf4j;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@DolphinScheduler(composeFiles = "docker/basic/docker-compose.yaml")
+@Slf4j
+public class WorkerGroupAPITest {
+
+ private static final String username = "admin";
+
+ private static final String password = "dolphinscheduler123";
+
+ private static String sessionId;
+
+ private static User loginUser;
+
+ private static WorkerGroupPage workerGroupPage;
+
+ @BeforeAll
+ public static void setup() {
+ LoginPage loginPage = new LoginPage();
+ HttpResponse loginHttpResponse = loginPage.login(username, password);
+ sessionId = JSONUtils.convertValue(loginHttpResponse.getBody().getData(), LoginResponseData.class).getSessionId();
+ workerGroupPage = new WorkerGroupPage(sessionId);
+ loginUser = new User();
+ loginUser.setId(123);
+ loginUser.setUserType(UserType.GENERAL_USER);
+ }
+
+ @AfterAll
+ public static void cleanup() {
+ log.info("success cleanup");
+ }
+
+ @Test
+ @Order(1)
+ public void testSaveWorkerGroup() {
+ HttpResponse saveWorkerGroupHttpResponse = workerGroupPage
+ .saveWorkerGroup(loginUser, 1, "test_worker_group", "10.5.0.5:1234", "test", null);
+ Assertions.assertTrue(saveWorkerGroupHttpResponse.getBody().getSuccess());
+
+ HttpResponse queryAllWorkerGroupsResponse = workerGroupPage.queryAllWorkerGroups(loginUser);
+ List<String> workerGroupsList = (List<String>) queryAllWorkerGroupsResponse.getBody().getData();
+ Set<String> workerGroupsActual = new HashSet<>(workerGroupsList);
+ Set<String> workerGroupsExpected = new HashSet<>(Arrays.asList("test_worker_group", "default"));
+ Assertions.assertEquals(workerGroupsExpected, workerGroupsActual);
+ }
+
+ @Test
+ @Order(2)
+ public void testQueryAllWorkerGroupsPaging() {
+ HttpResponse queryAllWorkerGroupsPagingResponse = workerGroupPage.queryAllWorkerGroupsPaging(loginUser, 1, 2, null);
+ Assertions.assertTrue(queryAllWorkerGroupsPagingResponse.getBody().getSuccess());
+ log.info("[debug111] " + queryAllWorkerGroupsPagingResponse);
Review Comment:
Remove this.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] EricGao888 commented on a diff in pull request #13936: [Improvement][API Test] Add API tests for worker group related APIs
Posted by "EricGao888 (via GitHub)" <gi...@apache.org>.
EricGao888 commented on code in PR #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936#discussion_r1169422336
##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/TenantAPITest.java:
##########
@@ -79,7 +79,7 @@ public void testDuplicateCreateTenant() {
HttpResponse createTenantHttpResponse = tenantPage.createTenant(sessionId, tenant, 1, "");
- Assertions.assertFalse(createTenantHttpResponse.body().success());
+ Assertions.assertFalse(createTenantHttpResponse.getBody().getSuccess());
Review Comment:
`body()` is neater maybe. It seems the configurations of `lombok` are different in `api test` and `e2e` module from those in other modules. I want them to be consistent.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] kezhenxu94 commented on a diff in pull request #13936: [Improvement][API Test] Add API tests for worker group related APIs
Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 commented on code in PR #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936#discussion_r1169388341
##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/resources/docker/basic/docker-compose.yaml:
##########
@@ -26,12 +26,18 @@ services:
ports:
- "12345:12345"
networks:
- - api-test
+ network:
+ ipv4_address: 10.5.0.5
healthcheck:
test: [ "CMD", "curl", "http://localhost:12345/actuator/health" ]
interval: 5s
timeout: 60s
retries: 120
networks:
- api-test:
+ network:
+ driver: bridge
+ ipam:
+ config:
+ - subnet: 10.5.0.0/16
+ gateway: 10.5.0.1
Review Comment:
Why do we need this?
##########
dolphinscheduler-api-test/dolphinscheduler-api-test-case/src/test/java/org/apache/dolphinscheduler/api.test/cases/TenantAPITest.java:
##########
@@ -79,7 +79,7 @@ public void testDuplicateCreateTenant() {
HttpResponse createTenantHttpResponse = tenantPage.createTenant(sessionId, tenant, 1, "");
- Assertions.assertFalse(createTenantHttpResponse.body().success());
+ Assertions.assertFalse(createTenantHttpResponse.getBody().getSuccess());
Review Comment:
Do you think `getBody()` is neater than `body()` 😉
--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [dolphinscheduler] sonarcloud[bot] commented on pull request #13936: [Improvement][API Test] Add API tests for worker group related APIs
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #13936:
URL: https://github.com/apache/dolphinscheduler/pull/13936#issuecomment-1510868233
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache-dolphinscheduler&pullRequest=13936)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache-dolphinscheduler&pullRequest=13936&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13936&metric=coverage&view=list) No Coverage information
[](https://sonarcloud.io/component_measures?id=apache-dolphinscheduler&pullRequest=13936&metric=duplicated_lines_density&view=list) No Duplication information
--
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.
To unsubscribe, e-mail: commits-unsubscribe@dolphinscheduler.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org