-
Notifications
You must be signed in to change notification settings - Fork 49
Improve Test coverage #251
Improve Test coverage #251
Conversation
Codecov Report
@@ Coverage Diff @@
## master #251 +/- ##
=============================================
+ Coverage 19.47% 31.77% +12.30%
- Complexity 80 116 +36
=============================================
Files 39 39
Lines 2008 2008
Branches 150 150
=============================================
+ Hits 391 638 +247
+ Misses 1598 1335 -263
- Partials 19 35 +16
Continue to review full report at Codecov.
|
a9d9667
to
7bbf006
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one comment around a missing negative test scenario, looks good otherwise!
...mazon/opendistro/elasticsearch/performanceanalyzer/collectors/NodeDetailsCollectorTests.java
Outdated
Show resolved
Hide resolved
...mazon/opendistro/elasticsearch/performanceanalyzer/collectors/NodeDetailsCollectorTests.java
Outdated
Show resolved
Hide resolved
.../elasticsearch/performanceanalyzer/collectors/NodeStatsFixedShardsMetricsCollectorTests.java
Outdated
Show resolved
Hide resolved
.../elasticsearch/performanceanalyzer/collectors/NodeStatsFixedShardsMetricsCollectorTests.java
Outdated
Show resolved
Hide resolved
ed2438c
to
7eea5eb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have minor non blocking comments. Approving this version, since those can be picked up in subsequent versions as well.
threadPool.shutdownNow(); | ||
super.tearDown(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add saveMetricsValues test here as well?
@Test | ||
public void testCollectMetrics() { | ||
createIndex(TEST_INDEX); | ||
Mockito.when(controller.getNodeStatsShardsPerCollection()).thenReturn(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a test to check if all the metrics for all the shards are populated in subsequent runs of this collector?
public void tearDown() throws Exception { | ||
super.tearDown(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add saveMetricsValues test here as well?
CacheMaxSizeStatus filedDataCache = metrics.get(0); | ||
CacheMaxSizeStatus shardRequestCache = metrics.get(1); | ||
assertEquals(CacheType.FIELD_DATA_CACHE.toString(), filedDataCache.getCacheType()); | ||
assertEquals(CacheType.SHARD_REQUEST_CACHE.toString(), shardRequestCache.getCacheType()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we assert values for Cache Sizes as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noticed that some files are missing copyright headers. Please create an issue to add them before merging this PR.
@@ -0,0 +1,66 @@ | |||
package com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Missing license header.
@@ -0,0 +1,80 @@ | |||
package com.amazon.opendistro.elasticsearch.performanceanalyzer.collectors; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missing license header
created #253 to track missing license headers for new files. |
Fixes #, if available:
Description of changes:
Improve Test coverage from 19% to 40%
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.