Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Improve Test Coverage to 81% #258

Merged
merged 32 commits into from
Jan 8, 2021

Conversation

yu-sun-77
Copy link
Contributor

@yu-sun-77 yu-sun-77 commented Dec 18, 2020

Fixes #, if available:

Description of changes:

  1. Improve Test Coverage to 81%
  2. exclude ClusterSettingsManager.java for coverage, not able to write UT for more coverage due to java.net.ConnectException: Connection refused

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@codecov
Copy link

codecov bot commented Dec 18, 2020

Codecov Report

Merging #258 (1f0c24e) into master (1620c77) will increase coverage by 19.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##             master     #258       +/-   ##
=============================================
+ Coverage     62.12%   81.12%   +19.00%     
- Complexity      261      319       +58     
=============================================
  Files            39       39               
  Lines          1893     1770      -123     
  Branches        144      134       -10     
=============================================
+ Hits           1176     1436      +260     
+ Misses          637      232      -405     
- Partials         80      102       +22     
Impacted Files Coverage Δ Complexity Δ
...analyzer/collectors/MasterServiceEventMetrics.java 71.31% <ø> (+62.29%) 15.00 <0.00> (+13.00)
...llectors/NodeStatsFixedShardsMetricsCollector.java 90.98% <ø> (+15.47%) 10.00 <0.00> (ø)
...analyzer/config/PerformanceAnalyzerController.java 70.27% <ø> (+2.70%) 23.00 <0.00> (+2.00)
...nceanalyzer/http_action/whoami/WhoAmIResponse.java 100.00% <100.00%> (+100.00%) 3.00 <1.00> (+3.00)
...er/listener/PerformanceAnalyzerSearchListener.java 99.01% <100.00%> (+99.01%) 20.00 <1.00> (+20.00)
...nalyzer/config/setting/ClusterSettingsManager.java 6.25% <0.00%> (-15.31%) 0.00% <0.00%> (-7.00%)
...alyzer/action/PerformanceAnalyzerActionFilter.java 96.77% <0.00%> (+12.90%) 6.00% <0.00%> (+2.00%)
...manceanalyzer/http_action/whoami/WhoAmIAction.java 100.00% <0.00%> (+20.00%) 3.00% <0.00%> (+1.00%)
... and 10 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 1620c77...1f0c24e. Read the comment docs.

@yu-sun-77 yu-sun-77 changed the title Improve Test Coverage Improve Test Coverage to 81% Jan 4, 2021
@yu-sun-77 yu-sun-77 merged commit 8c04a7e into opendistro-for-elasticsearch:master Jan 8, 2021
yujias0706 added a commit that referenced this pull request Jan 15, 2021
commit d141dc1
Author: Ruizhen Guo <55893852+rguo-aws@users.noreply.github.com>
Date:   Tue Jan 12 10:36:50 2021 -0800

    Add integ tests for OS metrics(cpu, page fault) (#252)

    * Add integ tests for OS metrics(cpu, page fault)

commit 8c04a7e
Author: Yu Sun <11154022+yu-sun-77@users.noreply.github.com>
Date:   Fri Jan 8 10:14:30 2021 -0800

    Improve Test Coverage to 81% (#258)

    * pending tests to be tested on linuxOS only

    * add UT for MasterServiceEventMetricsTests

    * add UT for PerformanceAnalyzerSearchListenerTests

    * move linuxOS check to @BeforeClass

    * add UT for MasterServiceMetricsTests

    * add UT for NodeStatsSettingHandlerTests

    * add UT for WhoAmI package

    * remove unused PA reader tests

    * clean metricQueue before running every test

    * pending tests to be tested on linuxOS only

    * add UT for MasterServiceEventMetricsTests

    * add UT for PerformanceAnalyzerSearchListenerTests

    * move linuxOS check to @BeforeClass

    * add UT for MasterServiceMetricsTests

    * add UT for NodeStatsSettingHandlerTests

    * add UT for WhoAmI package

    * remove unused PA reader tests

    * clean metricQueue before running every test

    * add UT for PerformanceAnalyzerActionFilterTests

    * add UT for PerformanceAnalyzerActionListenerTests

    * add UT for PerformanceAnalyzerControllerTests

    * add UT for EventLogFileHandlerTests

    * exclude test for ClusterSettingsManager.java

    * code review changes

    Co-authored-by: Yu Sun <sunayu@dev-dsk-sunayu-2b-daf3bb41.us-west-2.amazon.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants