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

[ISSUE #9415]update setExternalStorage logic,support more db check,add 8 count unit test #9470

Merged
merged 2 commits into from
Nov 7, 2022
Merged

[ISSUE #9415]update setExternalStorage logic,support more db check,add 8 count unit test #9470

merged 2 commits into from
Nov 7, 2022

Conversation

wuchubuzai2018
Copy link
Contributor

What is the purpose of the change

#9415
重写提交代码,合并冲突
Nacos多数据源通用适配改造点优化建议: 修改外置存储代码判断为通用反向逻辑
增加8个单元测试代码在2个类里面:
指定单例,未指定数据库,UseExternalDB是false
指定单例,指定数据库derby,UseExternalDB是false
指定单例,指定数据库为mysql, UseExternalDB是true
指定单例,指定数据库为其他, UseExternalDB是true
指定集群,未指定数据库,UseExternalDB是true,数据库类型是mysql
指定集群,指定数据库mysql,UseExternalDB是true,数据库类型是mysql
指定集群,指定数据库derby,UseExternalDB是false,数据库类型是derby
指定集群,指定数据库其他,UseExternalDB是true,数据库类型是其他

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean package apache-rat:check findbugs:findbugs -Dmaven.test.skip=true to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.

@codecov-commenter
Copy link

Codecov Report

Merging #9470 (e4fb973) into develop (5ea747b) will increase coverage by 0.14%.
The diff coverage is 33.33%.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #9470      +/-   ##
=============================================
+ Coverage      47.51%   47.65%   +0.14%     
- Complexity      4568     4570       +2     
=============================================
  Files            856      856              
  Lines          28354    28355       +1     
  Branches        3195     3197       +2     
=============================================
+ Hits           13471    13512      +41     
+ Misses         13655    13615      -40     
  Partials        1228     1228              
Impacted Files Coverage Δ
...cos/core/listener/StartingApplicationListener.java 47.42% <33.33%> (-1.54%) ⬇️
.../core/v2/event/publisher/NamingEventPublisher.java 76.25% <0.00%> (+1.25%) ⬆️
...cos/core/cluster/remote/ClusterRpcClientProxy.java 74.28% <0.00%> (+1.42%) ⬆️
...m/alibaba/nacos/core/remote/ConnectionManager.java 45.85% <0.00%> (+1.47%) ⬆️
...alibaba/nacos/client/config/impl/ClientWorker.java 55.40% <0.00%> (+4.63%) ⬆️
...m/alibaba/nacos/naming/misc/HttpClientManager.java 83.33% <0.00%> (+14.28%) ⬆️
...a/com/alibaba/nacos/core/remote/BaseRpcServer.java 89.47% <0.00%> (+26.31%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ea747b...e4fb973. Read the comment docs.


@Test
public void test005WithClusterAndNullDatabase() {
// 模拟设置环境05:指定集群,未指定数据库,UseExternalDB是true,数据库类型是mysql
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
// 模拟设置环境05:指定集群,未指定数据库,UseExternalDB是true,数据库类型是mysql
// 模拟设置环境05:指定集群,未指定数据库,UseExternalDB是true,数据库类型为""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants