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 #22] improving codeCov of mqtt.ds #96

Merged
merged 2 commits into from
May 20, 2022
Merged

[ISSUE #22] improving codeCov of mqtt.ds #96

merged 2 commits into from
May 20, 2022

Conversation

YxAc
Copy link
Contributor

@YxAc YxAc commented May 15, 2022

continuously fix #22

@@ -82,6 +82,11 @@ public void init() throws MQClientException {
}, 0, 5, TimeUnit.SECONDS);
}

public void initMQAdminExt() throws MQClientException {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

take it out for ut

@@ -108,6 +113,9 @@ public void checkFirstTopicIfCreated(String firstTopic) {
}

private void updateTopicRoute(String firstTopic) {
if (StringUtils.isBlank(firstTopic)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

bug of blank judgment

@codecov-commenter
Copy link

codecov-commenter commented May 15, 2022

Codecov Report

Merging #96 (04f720f) into main (ac90d5c) will increase coverage by 3.61%.
The diff coverage is 91.89%.

@@            Coverage Diff             @@
##             main      #96      +/-   ##
==========================================
+ Coverage   44.04%   47.66%   +3.61%     
==========================================
  Files          98       98              
  Lines        4200     4192       -8     
  Branches      656      655       -1     
==========================================
+ Hits         1850     1998     +148     
+ Misses       2016     1856     -160     
- Partials      334      338       +4     
Impacted Files Coverage Δ
...q/mqtt/ds/upstream/processor/ConnectProcessor.java 0.00% <ø> (ø)
...pache/rocketmq/mqtt/ds/meta/FirstTopicManager.java 71.42% <50.00%> (+24.85%) ⬆️
...e/rocketmq/mqtt/ds/config/ServiceConfListener.java 90.90% <100.00%> (+90.90%) ⬆️
...n/java/org/apache/rocketmq/mqtt/ds/mq/MqAdmin.java 66.66% <100.00%> (+66.66%) ⬆️
...ava/org/apache/rocketmq/mqtt/ds/mq/MqConsumer.java 54.83% <100.00%> (+54.83%) ⬆️
...java/org/apache/rocketmq/mqtt/ds/mq/MqFactory.java 96.29% <100.00%> (+96.29%) ⬆️
...ava/org/apache/rocketmq/mqtt/ds/mq/MqProducer.java 72.22% <100.00%> (+72.22%) ⬆️
...org/apache/rocketmq/mqtt/ds/mq/MqPullConsumer.java 59.09% <100.00%> (+59.09%) ⬆️
...he/rocketmq/mqtt/ds/notify/NotifyRetryManager.java 26.92% <0.00%> (+26.92%) ⬆️
... and 8 more

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 ac90d5c...04f720f. Read the comment docs.

@@ -28,9 +28,13 @@ public class MqAdmin {
private DefaultMQAdminExt defaultMQAdminExt;

public MqAdmin(Properties properties) {
this(properties.getProperty("NAMESRV_ADDR"));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add this constructor for optimizing MqFactory to reuse the same code block

defaultMQPushConsumer.registerMessageListener((MessageListenerConcurrently) messageListener);
}
return defaultMQPushConsumer;
MqConsumer mqConsumer = new MqConsumer(properties, nameSrv);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

reusing the same code block

@RunWith(MockitoJUnitRunner.class)
public class TestOffsetStoreManager {
public class TestLmqOffsetStoreManager {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

renaming

@pingww pingww merged commit 735e302 into apache:main May 20, 2022
@YxAc YxAc deleted the codeCov_for_mqtt_ds branch May 20, 2022 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

codeCov is not very optimistic, need to increase code coverage
4 participants