Skip to content

Commit 9d81bd6

Browse files
authored
Add additional logs for Integration Tests (#182)
* Add logs for IT Signed-off-by: sruti1312 <[email protected]> * Update version and add additional logs for time integration tests Signed-off-by: sruti1312 <[email protected]>
1 parent 69598fb commit 9d81bd6

File tree

9 files changed

+41
-17
lines changed

9 files changed

+41
-17
lines changed

.github/workflows/gradle.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
java:
1616
- 11
1717
- 17
18+
fail-fast: false
1819
runs-on: [ubuntu-latest]
1920
name: Building PA package
2021
steps:

build.gradle

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,10 @@ task buildRca() {
377377
exec {
378378
workingDir("$rcaProjectDir")
379379
if (buildVersionQualifier == null || buildVersionQualifier == '' || buildVersionQualifier == 'null') {
380-
commandLine './gradlew', 'build', '-x', 'test', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}"
380+
commandLine './gradlew', 'build', '-x', 'test', '-x', 'jacocoTestCoverageVerification', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}"
381381
}
382382
else {
383-
commandLine './gradlew', 'build', '-x', 'test', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}", "-Dbuild.version_qualifier=${buildVersionQualifier}"
383+
commandLine './gradlew', 'build', '-x', 'test', '-x', 'jacocoTestCoverageVerification', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}", "-Dbuild.version_qualifier=${buildVersionQualifier}"
384384
}
385385
}
386386
exec {
@@ -674,10 +674,7 @@ task bwcTestSuite(type: StandaloneRestIntegTestTask) {
674674
exclude '**/*Test*'
675675
exclude '**/*IT*'
676676
dependsOn tasks.named("${baseName}#mixedClusterTask")
677-
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
678-
// Only running this for > jdk8 versions as of now.
679-
dependsOn tasks.named("${baseName}#rollingUpgradeClusterTask")
680-
}
677+
dependsOn tasks.named("${baseName}#rollingUpgradeClusterTask")
681678
dependsOn tasks.named("${baseName}#fullRestartClusterTask")
682679
}
683680

licenses/performanceanalyzer-rca-1.3.0.0-SNAPSHOT.jar.sha1

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
7461afd1624f81989227c761f45d07ded9d7a326

src/main/resources/plugin-descriptor.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
description=Performance Analyzer Plugin
2828
#
2929
# 'version': plugin's version
30-
version=1.3.0.0
30+
version=2.0.0.0-alpha1
3131
#
3232
# 'name': the plugin name
3333
name=performance-analyzer
@@ -42,4 +42,4 @@ classname=org.opensearch.performanceanalyzer.PerformanceAnalyzerPlugin
4242
java.version=1.8
4343
#
4444
# 'opensearch.version' version of opensearch compiled against
45-
opensearch.version=1.3.0
45+
opensearch.version=2.0.0-alpha1

src/test/java/org/opensearch/performanceanalyzer/integ_test/CpuMetricsIT.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
import java.util.List;
10+
import org.apache.logging.log4j.LogManager;
11+
import org.apache.logging.log4j.Logger;
1012
import org.junit.Assert;
1113
import org.junit.Before;
1214
import org.junit.Test;
@@ -17,6 +19,7 @@
1719
import org.opensearch.performanceanalyzer.metrics.AllMetrics.OSMetrics;
1820

1921
public class CpuMetricsIT extends MetricCollectorIntegTestBase {
22+
private static final Logger LOG = LogManager.getLogger(CpuMetricsIT.class);
2023

2124
@Before
2225
public void init() throws Exception {
@@ -36,13 +39,13 @@ public void checkLegacyCPUUtilization() throws Exception {
3639
public void checkCPUUtilization(String paBaseUri) throws Exception {
3740
// read metric from local node
3841
List<JsonResponseNode> responseNodeList =
39-
readMetric(paBaseUri + "/metrics/?metrics=CPU_Utilization&agg=sum");
42+
readMetric(paBaseUri + "/metrics?metrics=CPU_Utilization&agg=sum");
4043
Assert.assertEquals(1, responseNodeList.size());
4144
validatePerNodeCPUMetric(responseNodeList.get(0));
4245

4346
// read metric from all nodes in cluster
4447
responseNodeList =
45-
readMetric(paBaseUri + "/metrics/?metrics=CPU_Utilization&agg=sum&nodes=all");
48+
readMetric(paBaseUri + "/metrics?metrics=CPU_Utilization&agg=sum&nodes=all");
4649
int nodeNum = getNodeIDs().size();
4750
Assert.assertEquals(nodeNum, responseNodeList.size());
4851
for (int i = 0; i < nodeNum; i++) {
@@ -58,6 +61,7 @@ public void checkCPUUtilization(String paBaseUri) throws Exception {
5861
private void validatePerNodeCPUMetric(JsonResponseNode responseNode) throws Exception {
5962
Assert.assertTrue(responseNode.getTimestamp() > 0);
6063
JsonResponseData responseData = responseNode.getData();
64+
LOG.info(responseData.toString());
6165
Assert.assertEquals(1, responseData.getFieldDimensionSize());
6266
Assert.assertEquals(
6367
OSMetrics.CPU_UTILIZATION.toString(), responseData.getField(0).getName());

src/test/java/org/opensearch/performanceanalyzer/integ_test/PageFaultMetricsIT.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88

99
import java.util.List;
10+
import org.apache.logging.log4j.LogManager;
11+
import org.apache.logging.log4j.Logger;
1012
import org.junit.Assert;
1113
import org.junit.Before;
1214
import org.junit.Test;
@@ -17,6 +19,7 @@
1719
import org.opensearch.performanceanalyzer.metrics.AllMetrics.OSMetrics;
1820

1921
public class PageFaultMetricsIT extends MetricCollectorIntegTestBase {
22+
private static final Logger LOG = LogManager.getLogger(PageFaultMetricsIT.class);
2023

2124
@Before
2225
public void init() throws Exception {
@@ -36,13 +39,13 @@ public void checkLegacyPaging_MajfltRate() throws Exception {
3639
public void checkPaging_MajfltRate(String paBaseUri) throws Exception {
3740
// read metric from local node
3841
List<JsonResponseNode> responseNodeList =
39-
readMetric(paBaseUri + "/metrics/?metrics=Paging_MajfltRate&agg=max");
42+
readMetric(paBaseUri + "/metrics?metrics=Paging_MajfltRate&agg=max");
4043
Assert.assertEquals(1, responseNodeList.size());
4144
validateMajorPageFaultMetric(responseNodeList.get(0));
4245

4346
// read metric from all nodes in cluster
4447
responseNodeList =
45-
readMetric(paBaseUri + "/metrics/?metrics=Paging_MajfltRate&agg=max&nodes=all");
48+
readMetric(paBaseUri + "/metrics?metrics=Paging_MajfltRate&agg=max&nodes=all");
4649
int nodeNum = getNodeIDs().size();
4750
Assert.assertEquals(nodeNum, responseNodeList.size());
4851
for (int i = 0; i < nodeNum; i++) {
@@ -63,13 +66,13 @@ public void checkLegacyPaging_MinfltRate() throws Exception {
6366
public void checkPaging_MinfltRate(String paBaseUri) throws Exception {
6467
// read metric from local node
6568
List<JsonResponseNode> responseNodeList =
66-
readMetric(paBaseUri + "/metrics/?metrics=Paging_MinfltRate&agg=max");
69+
readMetric(paBaseUri + "/metrics?metrics=Paging_MinfltRate&agg=max");
6770
Assert.assertEquals(1, responseNodeList.size());
6871
validateMinorPageFaultMetric(responseNodeList.get(0));
6972

7073
// read metric from all nodes in cluster
7174
responseNodeList =
72-
readMetric(paBaseUri + "/metrics/?metrics=Paging_MinfltRate&agg=max&nodes=all");
75+
readMetric(paBaseUri + "/metrics?metrics=Paging_MinfltRate&agg=max&nodes=all");
7376
int nodeNum = getNodeIDs().size();
7477
Assert.assertEquals(nodeNum, responseNodeList.size());
7578
for (int i = 0; i < nodeNum; i++) {
@@ -90,12 +93,12 @@ public void checkLegacyPaging_RSS() throws Exception {
9093
public void checkPaging_RSS(String paBaseUri) throws Exception {
9194
// read metric from local node
9295
List<JsonResponseNode> responseNodeList =
93-
readMetric(paBaseUri + "/metrics/?metrics=Paging_RSS&agg=max");
96+
readMetric(paBaseUri + "/metrics?metrics=Paging_RSS&agg=max");
9497
Assert.assertEquals(1, responseNodeList.size());
9598
validatePagingRSSMetric(responseNodeList.get(0));
9699

97100
// read metric from all nodes in cluster
98-
responseNodeList = readMetric(paBaseUri + "/metrics/?metrics=Paging_RSS&agg=max&nodes=all");
101+
responseNodeList = readMetric(paBaseUri + "/metrics?metrics=Paging_RSS&agg=max&nodes=all");
99102
int nodeNum = getNodeIDs().size();
100103
Assert.assertEquals(nodeNum, responseNodeList.size());
101104
for (int i = 0; i < nodeNum; i++) {
@@ -114,6 +117,7 @@ public void checkPaging_RSS(String paBaseUri) throws Exception {
114117
private void validateMajorPageFaultMetric(JsonResponseNode responseNode) throws Exception {
115118
Assert.assertTrue(responseNode.getTimestamp() > 0);
116119
JsonResponseData responseData = responseNode.getData();
120+
LOG.info(responseData.toString());
117121
Assert.assertEquals(1, responseData.getFieldDimensionSize());
118122
Assert.assertEquals(
119123
OSMetrics.PAGING_MAJ_FLT_RATE.toString(), responseData.getField(0).getName());
@@ -131,6 +135,7 @@ private void validateMajorPageFaultMetric(JsonResponseNode responseNode) throws
131135
private void validateMinorPageFaultMetric(JsonResponseNode responseNode) throws Exception {
132136
Assert.assertTrue(responseNode.getTimestamp() > 0);
133137
JsonResponseData responseData = responseNode.getData();
138+
LOG.info(responseData.toString());
134139
Assert.assertEquals(1, responseData.getFieldDimensionSize());
135140
Assert.assertEquals(
136141
OSMetrics.PAGING_MIN_FLT_RATE.toString(), responseData.getField(0).getName());
@@ -149,6 +154,7 @@ private void validateMinorPageFaultMetric(JsonResponseNode responseNode) throws
149154
private void validatePagingRSSMetric(JsonResponseNode responseNode) throws Exception {
150155
Assert.assertTrue(responseNode.getTimestamp() > 0);
151156
JsonResponseData responseData = responseNode.getData();
157+
LOG.info(responseData.toString());
152158
Assert.assertEquals(1, responseData.getFieldDimensionSize());
153159
Assert.assertEquals(OSMetrics.PAGING_RSS.toString(), responseData.getField(0).getName());
154160
Assert.assertEquals(

src/test/java/org/opensearch/performanceanalyzer/integ_test/json/JsonResponseData.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88

99
import com.google.gson.annotations.SerializedName;
10+
import java.util.Arrays;
1011

1112
/**
1213
* spotless:off
@@ -71,4 +72,14 @@ public Double getRecordAsDouble(int index, String fieldName) throws Exception {
7172
}
7273
return Double.parseDouble(recordStr);
7374
}
75+
76+
@Override
77+
public String toString() {
78+
return "data:{"
79+
+ "fields="
80+
+ Arrays.toString(fields)
81+
+ ", records="
82+
+ Arrays.toString(records)
83+
+ '}';
84+
}
7485
}

src/test/java/org/opensearch/performanceanalyzer/integ_test/json/JsonResponseField.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public String getType() {
3232
return this.type;
3333
}
3434

35+
@Override
36+
public String toString() {
37+
return "JsonResponseField{" + "name='" + name + '\'' + ", type='" + type + '\'' + '}';
38+
}
39+
3540
// SQLite data type
3641
public enum Type {
3742
VARCHAR(Constants.VARCHAR),

0 commit comments

Comments
 (0)