Skip to content

Commit 1b90dff

Browse files
committed
Updates on `openmetadata-integration-tests
Recover lost profiles configuration Add cleanup steps and opensearch configuration needed in test suite bootstrap Make tag recognizer tests retryable
1 parent e6269ba commit 1b90dff

File tree

3 files changed

+98
-24
lines changed

3 files changed

+98
-24
lines changed

openmetadata-integration-tests/pom.xml

Lines changed: 76 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@
147147
<version>5.0.0</version>
148148
<scope>test</scope>
149149
</dependency>
150+
<!-- Source: https://mvnrepository.com/artifact/org.junit-pioneer/junit-pioneer -->
151+
<dependency>
152+
<groupId>org.junit-pioneer</groupId>
153+
<artifactId>junit-pioneer</artifactId>
154+
<version>2.3.0</version>
155+
<scope>test</scope>
156+
</dependency>
150157
</dependencies>
151158
<profiles>
152159
<!-- MySQL + Elasticsearch (default) -->
@@ -162,9 +169,9 @@
162169
<artifactId>maven-failsafe-plugin</artifactId>
163170
<version>${maven.failsafe.version}</version>
164171
<executions>
165-
<!-- Phase 1: Run TagRecognizerFeedbackIT sequentially in integration-test phase -->
172+
<!-- Run sequential tests -->
166173
<execution>
167-
<id>sequential-test</id>
174+
<id>sequential-tests</id>
168175
<goals>
169176
<goal>integration-test</goal>
170177
</goals>
@@ -176,6 +183,11 @@
176183
<include>**/TagRecognizerFeedbackIT.java</include>
177184
</includes>
178185
<systemPropertyVariables>
186+
<databaseType>mysql</databaseType>
187+
<databaseImage>mysql:8.3.0</databaseImage>
188+
<searchType>elasticsearch</searchType>
189+
<searchImage>docker.elastic.co/elasticsearch/elasticsearch:8.11.4</searchImage>
190+
179191
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
180192
<junit.jupiter.execution.parallel.enabled>false</junit.jupiter.execution.parallel.enabled>
181193
</systemPropertyVariables>
@@ -184,7 +196,7 @@
184196
<useFile>true</useFile>
185197
</configuration>
186198
</execution>
187-
<!-- Phase 2: Run all other tests in parallel in integration-test phase -->
199+
<!-- Run parallel tests -->
188200
<execution>
189201
<id>parallel-tests</id>
190202
<goals>
@@ -202,6 +214,11 @@
202214
<exclude>**/TagRecognizerFeedbackIT.java</exclude>
203215
</excludes>
204216
<systemPropertyVariables>
217+
<databaseType>mysql</databaseType>
218+
<databaseImage>mysql:8.3.0</databaseImage>
219+
<searchType>elasticsearch</searchType>
220+
<searchImage>docker.elastic.co/elasticsearch/elasticsearch:8.11.4</searchImage>
221+
205222
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
206223
<junit.jupiter.execution.parallel.enabled>true</junit.jupiter.execution.parallel.enabled>
207224
</systemPropertyVariables>
@@ -232,9 +249,9 @@
232249
<artifactId>maven-failsafe-plugin</artifactId>
233250
<version>${maven.failsafe.version}</version>
234251
<executions>
235-
<!-- Phase 1: Run TagRecognizerFeedbackIT sequentially in integration-test phase -->
252+
<!-- Run sequential tests -->
236253
<execution>
237-
<id>sequential-test</id>
254+
<id>sequential-tests</id>
238255
<goals>
239256
<goal>integration-test</goal>
240257
</goals>
@@ -246,6 +263,11 @@
246263
<include>**/TagRecognizerFeedbackIT.java</include>
247264
</includes>
248265
<systemPropertyVariables>
266+
<databaseType>postgres</databaseType>
267+
<databaseImage>postgres:15</databaseImage>
268+
<searchType>opensearch</searchType>
269+
<searchImage>opensearchproject/opensearch:2.6.0</searchImage>
270+
249271
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
250272
<junit.jupiter.execution.parallel.enabled>false</junit.jupiter.execution.parallel.enabled>
251273
</systemPropertyVariables>
@@ -254,7 +276,7 @@
254276
<useFile>true</useFile>
255277
</configuration>
256278
</execution>
257-
<!-- Phase 2: Run all other tests in parallel in integration-test phase -->
279+
<!-- Run parallel tests -->
258280
<execution>
259281
<id>parallel-tests</id>
260282
<goals>
@@ -272,6 +294,11 @@
272294
<exclude>**/TagRecognizerFeedbackIT.java</exclude>
273295
</excludes>
274296
<systemPropertyVariables>
297+
<databaseType>postgres</databaseType>
298+
<databaseImage>postgres:15</databaseImage>
299+
<searchType>opensearch</searchType>
300+
<searchImage>opensearchproject/opensearch:2.6.0</searchImage>
301+
275302
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
276303
<junit.jupiter.execution.parallel.enabled>true</junit.jupiter.execution.parallel.enabled>
277304
</systemPropertyVariables>
@@ -302,9 +329,9 @@
302329
<artifactId>maven-failsafe-plugin</artifactId>
303330
<version>${maven.failsafe.version}</version>
304331
<executions>
305-
<!-- Phase 1: Run TagRecognizerFeedbackIT sequentially in integration-test phase -->
332+
<!-- Run sequential tests -->
306333
<execution>
307-
<id>sequential-test</id>
334+
<id>sequential-tests</id>
308335
<goals>
309336
<goal>integration-test</goal>
310337
</goals>
@@ -316,6 +343,11 @@
316343
<include>**/TagRecognizerFeedbackIT.java</include>
317344
</includes>
318345
<systemPropertyVariables>
346+
<databaseType>postgres</databaseType>
347+
<databaseImage>postgres:15</databaseImage>
348+
<searchType>elasticsearch</searchType>
349+
<searchImage>docker.elastic.co/elasticsearch/elasticsearch:8.11.4</searchImage>
350+
319351
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
320352
<junit.jupiter.execution.parallel.enabled>false</junit.jupiter.execution.parallel.enabled>
321353
</systemPropertyVariables>
@@ -324,7 +356,7 @@
324356
<useFile>true</useFile>
325357
</configuration>
326358
</execution>
327-
<!-- Phase 2: Run all other tests in parallel in integration-test phase -->
359+
<!-- Run parallel tests -->
328360
<execution>
329361
<id>parallel-tests</id>
330362
<goals>
@@ -342,6 +374,11 @@
342374
<exclude>**/TagRecognizerFeedbackIT.java</exclude>
343375
</excludes>
344376
<systemPropertyVariables>
377+
<databaseType>postgres</databaseType>
378+
<databaseImage>postgres:15</databaseImage>
379+
<searchType>elasticsearch</searchType>
380+
<searchImage>docker.elastic.co/elasticsearch/elasticsearch:8.11.4</searchImage>
381+
345382
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
346383
<junit.jupiter.execution.parallel.enabled>true</junit.jupiter.execution.parallel.enabled>
347384
</systemPropertyVariables>
@@ -372,9 +409,9 @@
372409
<artifactId>maven-failsafe-plugin</artifactId>
373410
<version>${maven.failsafe.version}</version>
374411
<executions>
375-
<!-- Phase 1: Run TagRecognizerFeedbackIT sequentially in integration-test phase -->
412+
<!-- Run sequential tests -->
376413
<execution>
377-
<id>sequential-test</id>
414+
<id>sequential-tests</id>
378415
<goals>
379416
<goal>integration-test</goal>
380417
</goals>
@@ -386,6 +423,11 @@
386423
<include>**/TagRecognizerFeedbackIT.java</include>
387424
</includes>
388425
<systemPropertyVariables>
426+
<databaseType>mysql</databaseType>
427+
<databaseImage>mysql:8.3.0</databaseImage>
428+
<searchType>opensearch</searchType>
429+
<searchImage>opensearchproject/opensearch:2.6.0</searchImage>
430+
389431
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
390432
<junit.jupiter.execution.parallel.enabled>false</junit.jupiter.execution.parallel.enabled>
391433
</systemPropertyVariables>
@@ -394,7 +436,7 @@
394436
<useFile>true</useFile>
395437
</configuration>
396438
</execution>
397-
<!-- Phase 2: Run all other tests in parallel in integration-test phase -->
439+
<!-- Run parallel tests -->
398440
<execution>
399441
<id>parallel-tests</id>
400442
<goals>
@@ -412,6 +454,11 @@
412454
<exclude>**/TagRecognizerFeedbackIT.java</exclude>
413455
</excludes>
414456
<systemPropertyVariables>
457+
<databaseType>mysql</databaseType>
458+
<databaseImage>mysql:8.3.0</databaseImage>
459+
<searchType>opensearch</searchType>
460+
<searchImage>opensearchproject/opensearch:2.6.0</searchImage>
461+
415462
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
416463
<junit.jupiter.execution.parallel.enabled>true</junit.jupiter.execution.parallel.enabled>
417464
</systemPropertyVariables>
@@ -442,9 +489,9 @@
442489
<artifactId>maven-failsafe-plugin</artifactId>
443490
<version>${maven.failsafe.version}</version>
444491
<executions>
445-
<!-- Phase 1: Run TagRecognizerFeedbackIT sequentially in integration-test phase -->
492+
<!-- Run sequential tests -->
446493
<execution>
447-
<id>sequential-test</id>
494+
<id>sequential-tests</id>
448495
<goals>
449496
<goal>integration-test</goal>
450497
</goals>
@@ -456,6 +503,13 @@
456503
<include>**/TagRecognizerFeedbackIT.java</include>
457504
</includes>
458505
<systemPropertyVariables>
506+
<enableRdf>true</enableRdf>
507+
<rdfContainerImage>stain/jena-fuseki:latest</rdfContainerImage>
508+
<databaseType>postgres</databaseType>
509+
<databaseImage>postgres:15</databaseImage>
510+
<searchType>elasticsearch</searchType>
511+
<searchImage>docker.elastic.co/elasticsearch/elasticsearch:8.11.4</searchImage>
512+
459513
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
460514
<junit.jupiter.execution.parallel.enabled>false</junit.jupiter.execution.parallel.enabled>
461515
</systemPropertyVariables>
@@ -464,7 +518,7 @@
464518
<useFile>true</useFile>
465519
</configuration>
466520
</execution>
467-
<!-- Phase 2: Run all other tests in parallel in integration-test phase -->
521+
<!-- Run parallel tests -->
468522
<execution>
469523
<id>parallel-tests</id>
470524
<goals>
@@ -482,6 +536,13 @@
482536
<exclude>**/TagRecognizerFeedbackIT.java</exclude>
483537
</excludes>
484538
<systemPropertyVariables>
539+
<enableRdf>true</enableRdf>
540+
<rdfContainerImage>stain/jena-fuseki:latest</rdfContainerImage>
541+
<databaseType>postgres</databaseType>
542+
<databaseImage>postgres:15</databaseImage>
543+
<searchType>elasticsearch</searchType>
544+
<searchImage>docker.elastic.co/elasticsearch/elasticsearch:8.11.4</searchImage>
545+
485546
<junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
486547
<junit.jupiter.execution.parallel.enabled>true</junit.jupiter.execution.parallel.enabled>
487548
</systemPropertyVariables>

openmetadata-integration-tests/src/test/java/org/openmetadata/it/bootstrap/TestSuiteBootstrap.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,11 @@ private void startSearch() {
272272
new org.opensearch.testcontainers.OpensearchContainer<>(image);
273273
opensearch.withEnv("discovery.type", "single-node");
274274
opensearch.withEnv("DISABLE_SECURITY_PLUGIN", "true");
275+
opensearch.withEnv("DISABLE_INSTALL_DEMO_CONFIG", "true");
275276
opensearch.withEnv("OPENSEARCH_JAVA_OPTS", "-Xms1g -Xmx1g");
276277
opensearch.withStartupAttempts(3);
277-
opensearch.withTmpFs(java.util.Map.of("/usr/share/opensearch/data", "rw,size=1g"));
278+
opensearch.withTmpFs(
279+
java.util.Map.of("/usr/share/opensearch/data", "rw,size=1g,uid=1000,gid=1000"));
278280
opensearch.withCreateContainerCmdModifier(
279281
cmd ->
280282
cmd.getHostConfig()
@@ -602,6 +604,16 @@ private void cleanup() {
602604
LOG.warn("Error cleaning up shared entities", e);
603605
}
604606

607+
try {
608+
if (WorkflowHandler.isInitialized()) {
609+
LOG.info("Shutting down Flowable ProcessEngine...");
610+
org.flowable.engine.ProcessEngines.destroy();
611+
LOG.info("Flowable ProcessEngine shut down successfully");
612+
}
613+
} catch (Exception e) {
614+
LOG.warn("Error shutting down Flowable ProcessEngine", e);
615+
}
616+
605617
try {
606618
if (APP != null) {
607619
APP.after();

openmetadata-integration-tests/src/test/java/org/openmetadata/it/tests/TagRecognizerFeedbackIT.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.junit.jupiter.api.extension.ExtendWith;
1717
import org.junit.jupiter.api.parallel.Execution;
1818
import org.junit.jupiter.api.parallel.ExecutionMode;
19+
import org.junitpioneer.jupiter.RetryingTest;
1920
import org.openmetadata.it.bootstrap.SharedEntities;
2021
import org.openmetadata.it.util.SdkClients;
2122
import org.openmetadata.it.util.TestNamespace;
@@ -47,7 +48,7 @@
4748
@ExtendWith(TestNamespaceExtension.class)
4849
@Execution(ExecutionMode.SAME_THREAD)
4950
public class TagRecognizerFeedbackIT {
50-
private static final long TIMEOUT_MINUTES = 3;
51+
private static final long TIMEOUT_MINUTES = 5;
5152
private static final long POLL_INTERVAL_SECONDS = 3;
5253

5354
@BeforeAll
@@ -280,7 +281,7 @@ private Recognizer getNameRecognizer() {
280281
.withName(PredefinedRecognizer.Name.EMAIL_RECOGNIZER));
281282
}
282283

283-
@Test
284+
@RetryingTest(3)
284285
void test_recognizerFeedback_withDirectReviewer_createsTask(TestNamespace ns) throws Exception {
285286
Classification classification = createClassification(ns);
286287

@@ -308,7 +309,7 @@ void test_recognizerFeedback_withDirectReviewer_createsTask(TestNamespace ns) th
308309
assertEquals(feedback.getEntityLink(), task.getTask().getFeedback().getEntityLink());
309310
}
310311

311-
@Test
312+
@RetryingTest(3)
312313
void test_recognizerFeedback_withInheritedReviewer_createsTask(TestNamespace ns)
313314
throws Exception {
314315

@@ -335,7 +336,7 @@ void test_recognizerFeedback_withInheritedReviewer_createsTask(TestNamespace ns)
335336
assertDoesNotThrow(() -> waitForRecognizerFeedbackTask(tag.getFullyQualifiedName()));
336337
}
337338

338-
@Test
339+
@RetryingTest(3)
339340
void test_recognizerFeedback_noReviewer_autoApplied(TestNamespace ns) throws Exception {
340341

341342
Classification classification = createClassification(ns);
@@ -386,7 +387,7 @@ void test_recognizerFeedback_noReviewer_autoApplied(TestNamespace ns) throws Exc
386387
});
387388
}
388389

389-
@Test
390+
@RetryingTest(3)
390391
void test_recognizerFeedback_submitterIsReviewer_autoApplied(TestNamespace ns) throws Exception {
391392

392393
Classification classification = createClassification(ns);
@@ -439,7 +440,7 @@ void test_recognizerFeedback_submitterIsReviewer_autoApplied(TestNamespace ns) t
439440
});
440441
}
441442

442-
@Test
443+
@RetryingTest(3)
443444
void test_recognizerFeedback_approveTask_removesTagAndAddsException(TestNamespace ns)
444445
throws Exception {
445446

@@ -498,7 +499,7 @@ void test_recognizerFeedback_approveTask_removesTagAndAddsException(TestNamespac
498499
assertTrue(tagRemoved, "Tag should be removed from column after approval");
499500
}
500501

501-
@Test
502+
@RetryingTest(3)
502503
void test_recognizerFeedback_rejectTask_keepsTag(TestNamespace ns) throws Exception {
503504

504505
Classification classification = createClassification(ns);
@@ -546,7 +547,7 @@ void test_recognizerFeedback_rejectTask_keepsTag(TestNamespace ns) throws Except
546547
assertTrue(tagStillPresent, "Tag should remain on column after rejection");
547548
}
548549

549-
@Test
550+
@RetryingTest(3)
550551
void test_recognizerFeedback_taskIncludesRecognizerMetadata(TestNamespace ns) throws Exception {
551552
Classification classification = createClassification(ns);
552553

0 commit comments

Comments
 (0)