Skip to content

Commit 46dba30

Browse files
committed
added monitoring exporter test and utility to build and start it part 7
1 parent 5d93a80 commit 46dba30

File tree

2 files changed

+22
-31
lines changed

2 files changed

+22
-31
lines changed

integration-tests/USECASES.MD

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,23 @@ Configuration Overrides Usecases
9797
| --- | --- |
9898
| Discover a newly started server | Stop operator and apply the modified domain.yaml with replicas count increased, restart Operator and verify that the cluster is scaled up accordingly |
9999
| Discover dead weblogic servers | Stop Operator, kill admin server and all managed servers in the cluster, restart Operator and verify that it restarts all dead servers |
100-
100+
c
101101
| Sticky Session | Use Case |
102102
| --- | --- |
103103
| Server affinity | Use a web application deployed on Weblogic cluster to track HTTP session. Test server-affinity by sending two HTTP requests to Weblogic and verify that all requests are directed to same Weblogic server |
104-
| Session state isolation | Verify that values saved in a client session state are not visible to another client |
104+
| Session state isolation | Verify that values saved in a client session state are not visible to another client |
105+
106+
| Monitoring Exporter | Use Case |
107+
| --- | --- |
108+
| Check Metrics via Prometheus | build, deploy webapp for Monitoring Exporter, start Prometheus and verify the metrics was produced by using Prometheus APIs |
109+
| Replace Configuration via exporter console| Verify that configuration for monitoring exporter can be replaced during runtime, check applied metrics via Prometheus APIs|
110+
| Append Configuration via exporter console| Verify that configuration for monitoring exporter can be appended during runtime, check applied metrics via Prometheus APIs|
111+
| Append Configuration with varios combinations of attributes via exporter console| Append monitoring exporter configuration [a] to new config [a,b] and verify it was applied |
112+
| Replace Configuration with only one attribute as array via exporter console| Replace monitoring exporter configuration [a,b,c] attributes with new config [a] and verify it was applied |
113+
| Replace Configuration with empty config file via exporter console| Replace monitoring exporter configuration with empty config file, verify it was applied |
114+
| Replace Configuration with not existed config file via exporter console| Try to replace monitoring exporter configuration with not existed config file, verify configuration has not changed |
115+
| Replace Configuration with empty string for config file param via exporter console| Try to replace monitoring exporter configuration with empty string for config file param, verify configuration has not changed |
116+
| Replace/Append Configuration with config file written in non yml format via exporter console| Try to replace/append monitoring exporter configuration with config file written in non yml format, verify configuration has not changed |
117+
| Replace/Append Configuration with corrupted yml file via exporter console| Try to replace/append monitoring exporter configuration with config file written in corrupted yml format, verify configuration has not changed |
118+
| Replace/Append Configuration with dublicated values in the config file via exporter console| Try to replace/append monitoring exporter configuration with dublicated values in the config file, verify configuration has not changed |
119+
| Replace/Append Configuration with dublicated values in the config file via exporter console| Try to replace/append monitoring exporter configuration with varios combos for invalid credentials, verify configuration has not changed and `401 Unauthorized` exception was thrown |

integration-tests/src/test/java/oracle/kubernetes/operator/ITMonitoringExporter.java

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -505,38 +505,14 @@ public void test13_ReplaceMetricsNameSnakeCaseFalseConfiguration() throws Except
505505
logger.info("SUCCESS - " + testMethodName);
506506
}
507507

508-
/**
509-
* Try to append monitoring exporter configuration with NameSnakeCase=true to the original
510-
* configuration where NameSnakeCase=false will change NameSnakeCase=true
511-
*
512-
* @throws Exception
513-
*/
514-
@Test
515-
public void test14_AppendMetricsNameSnakeCaseTrueToSnakeCaseFalseConfiguration()
516-
throws Exception {
517-
Assume.assumeFalse(QUICKTEST);
518-
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
519-
logTestBegin(testMethodName);
520-
boolean testCompletedSuccessfully = false;
521-
522-
HtmlPage page =
523-
submitConfigureForm(exporterUrl, "append", configPath + "/rest_snakecasetrue.yml");
524-
assertNotNull(page);
525-
String searchKey =
526-
"weblogic_servlet_execution_time_average%7Bapp%3D%22testwsapp%22%7D%5B15s%5D";
527-
assertTrue(checkMetricsViaPrometheus(searchKey, "testwsapp"));
528-
testCompletedSuccessfully = true;
529-
logger.info("SUCCESS - " + testMethodName);
530-
}
531-
532508
/**
533509
* Try to change monitoring exporter configuration without authentication
534510
*
535511
* @throws Exception
536512
*/
537513
// verify that change configuration fails without authentication
538514
@Test
539-
public void test15_ChangeConfigNoCredentials() throws Exception {
515+
public void test14_ChangeConfigNoCredentials() throws Exception {
540516
Assume.assumeFalse(QUICKTEST);
541517
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
542518
logTestBegin(testMethodName);
@@ -561,7 +537,7 @@ public void test15_ChangeConfigNoCredentials() throws Exception {
561537
* @throws Exception
562538
*/
563539
@Test
564-
public void test16_ChangeConfigInvalidUser() throws Exception {
540+
public void test15_ChangeConfigInvalidUser() throws Exception {
565541
Assume.assumeFalse(QUICKTEST);
566542
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
567543
logTestBegin(testMethodName);
@@ -582,7 +558,7 @@ public void test16_ChangeConfigInvalidUser() throws Exception {
582558
* @throws Exception
583559
*/
584560
@Test
585-
public void test17_ChangeConfigInvalidPass() throws Exception {
561+
public void test16_ChangeConfigInvalidPass() throws Exception {
586562
Assume.assumeFalse(QUICKTEST);
587563
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
588564
logTestBegin(testMethodName);
@@ -601,7 +577,7 @@ public void test17_ChangeConfigInvalidPass() throws Exception {
601577
* @throws Exception
602578
*/
603579
@Test
604-
public void test18_ChangeConfigEmptyUser() throws Exception {
580+
public void test17_ChangeConfigEmptyUser() throws Exception {
605581
Assume.assumeFalse(QUICKTEST);
606582
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
607583
logTestBegin(testMethodName);
@@ -622,7 +598,7 @@ public void test18_ChangeConfigEmptyUser() throws Exception {
622598
* @throws Exception
623599
*/
624600
@Test
625-
public void test19_ChangeConfigEmptyPass() throws Exception {
601+
public void test18_ChangeConfigEmptyPass() throws Exception {
626602
Assume.assumeFalse(QUICKTEST);
627603
String testMethodName = new Object() {}.getClass().getEnclosingMethod().getName();
628604
logTestBegin(testMethodName);

0 commit comments

Comments
 (0)