Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature-11473][Task]Support test task #11670

Merged
merged 71 commits into from
Sep 17, 2022
Merged

Conversation

insist777
Copy link
Contributor

Purpose of the pull request

close #11473

Brief change log

support test tasks: The front-end shows. The back-end API module mainly modifies some interfaces. The master module mainly replaces the test data source for inspection. The worker module mainly verifies whether the test data source is replaced successfully

Verify this pull request

This pull request is code cleanup without any test coverage.

wen-hemin
wen-hemin previously approved these changes Sep 16, 2022
Copy link
Contributor

@wen-hemin wen-hemin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@sonarcloud
Copy link

sonarcloud bot commented Sep 17, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

41.1% 41.1% Coverage
0.0% 0.0% Duplication

Copy link
Contributor

@wen-hemin wen-hemin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@wen-hemin wen-hemin merged commit 5b384f3 into apache:dev Sep 17, 2022
Copy link
Member

@SbloodyS SbloodyS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wen-hemin Hi, I think this PR has some problems to solve. It should not be merged so quickly. cc @caishunfeng @ruanwenjun @zhongjiajie

Comment on lines +858 to +859
public static final int TEST_FLAG_NO = 0;
public static final int TEST_FLAG_YES = 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to create enumeration for it instead of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, some constants in this class can also be changed to enumeration.

@@ -17,6 +17,7 @@

package org.apache.dolphinscheduler.dao.entity;

import com.baomidou.mybatisplus.annotation.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be avoided. cc @EricGao888

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SbloodyS That's pretty wired. We have a step in Spotless to check and block wildcard imports. Usually CI would detect it and block this PR. The reason why it didn't block it may be our current setting for ratchet.

dolphinscheduler/pom.xml

Lines 660 to 664 in e1b55db

<replaceRegex>
<name>Remove wildcard imports</name>
<searchRegex>import\s+[^\*\s]+\*;(\r\n|\r|\n)</searchRegex>
<replacement>$1</replacement>
</replaceRegex>

For details, see: #11412

Comment on lines +189 to +192
Map<String, Object> taskDefinitionParams = JSONUtils.parseObject(taskInstance.getTaskDefine().getTaskParams(), new TypeReference<Map<String, Object>>() {
});
Map<String, Object> taskInstanceParams = JSONUtils.parseObject(taskInstance.getTaskParams(), new TypeReference<Map<String, Object>>() {
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid using map here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Map can access data more easily.

xdu-chenrj pushed a commit to xdu-chenrj/dolphinscheduler that referenced this pull request Sep 17, 2022
* [improve] support test tasks

* [improve] support test tasks

* [improve] support test tasks

* [improve] support test tasks

* [improve] support test tasks

* Update TaskExecuteThread.java

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* Update DataSource.java

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* Update messages_zh_CN.properties

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* Update messages.properties

* Update messages_en_US.properties

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks
})
@GetMapping(value = "/list")
@ResponseStatus(HttpStatus.OK)
@ApiException(QUERY_DATASOURCE_ERROR)
@AccessLogAnnotation(ignoreRequestArgs = "loginUser")
public Result queryDataSourceList(@ApiIgnore @RequestAttribute(value = Constants.SESSION_USER) User loginUser,
@RequestParam("type") DbType type) {
Map<String, Object> result = dataSourceService.queryDataSourceList(loginUser, type.ordinal());
@RequestParam("type") DbType type,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another interesting thing here is this PR add a new parameter testFlag to /datasources/list but didn't update the corresponding UT and the CI somehow passed. After I upgraded jUnit locally, this UT case failed. cc @SbloodyS @kezhenxu94

@ParameterizedTest
@CsvSource({
"type, MYSQL"
})
public void testQueryDataSourceList(String key, String dbType) throws Exception {
MultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap.add(key,dbType);
MvcResult mvcResult = mockMvc.perform(get("/datasources/list")
.header("sessionId", sessionId)
.params(paramsMap))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
.andReturn();
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(),result.getCode().intValue());
logger.info(mvcResult.getResponse().getContentAsString());
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caishunfeng
Copy link
Contributor

@insist777 please take a look.

xdu-chenrj pushed a commit to xdu-chenrj/dolphinscheduler that referenced this pull request Oct 13, 2022
* [improve] support test tasks

* [improve] support test tasks

* [improve] support test tasks

* [improve] support test tasks

* [improve] support test tasks

* Update TaskExecuteThread.java

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* try solve e2e q

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* Update DataSource.java

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* Update messages_zh_CN.properties

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* Update messages.properties

* Update messages_en_US.properties

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks

* [Feature] support test tasks
@qingwli
Copy link
Member

qingwli commented Dec 13, 2022

Hi, do we have a plan about which version will public this pr?

@SbloodyS SbloodyS modified the milestones: 4.0.0-alpha, 3.2.0 Dec 13, 2022
@SbloodyS SbloodyS added the 3.2.0 for 3.2.0 version label Dec 13, 2022
@SbloodyS
Copy link
Member

Hi, do we have a plan about which version will public this pr?

3.2.0

@qingwli
Copy link
Member

qingwli commented Dec 13, 2022

Hi, do we have a plan about which version will public this pr?

3.2.0

Thx

zhongjiajie added a commit to zhongjiajie/dolphinscheduler that referenced this pull request Jun 20, 2023
We should keep our step as less as possible, for now we have to
test datasource and binding it to prod datasource, I think is will
make our users do not thing to use datasource, so I do like to revert
it and keep step as less as possible

related to apache#11670
zhongjiajie added a commit that referenced this pull request Jun 27, 2023
We should keep our step as less as possible, for now, we have to
test datasource and binding it to the prod datasource, I think it will
make our users do not thing to use datasource, so I do like to revert
it and keep step as less as possible

related to #11670
IT-Kwj pushed a commit to IT-Kwj/dolphinscheduler that referenced this pull request Jul 14, 2023
We should keep our step as less as possible, for now, we have to
test datasource and binding it to the prod datasource, I think it will
make our users do not thing to use datasource, so I do like to revert
it and keep step as less as possible

related to apache#11670
zhongjiajie added a commit that referenced this pull request Jul 20, 2023
We should keep our step as less as possible, for now, we have to
test datasource and binding it to the prod datasource, I think it will
make our users do not thing to use datasource, so I do like to revert
it and keep step as less as possible

related to #11670

(cherry picked from commit 221df4a)
biaoma-ty pushed a commit to Kasma-Inc/dolphinscheduler that referenced this pull request Aug 17, 2023
We should keep our step as less as possible, for now, we have to
test datasource and binding it to the prod datasource, I think it will
make our users do not thing to use datasource, so I do like to revert
it and keep step as less as possible

related to apache#11670
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2.0 for 3.2.0 version backend e2e e2e test UI ui and front end related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature][Task] Support test tasks
10 participants