Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/run-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Test
run: |
./mvnw -B test \
-pl "tci-advanced-demo/${{ matrix.project }}" -am \
-pl "tci-advanced-demo/integration-tests/${{ matrix.project }}" -am \
-P run-it \
${{ matrix.pre-start && '-Dinfra-pre-start.enabled=1 ' || '' }} \
${{ matrix.parallel > 0 && format('-Djunit.jupiter.execution.parallel.enabled=true -Djunit.jupiter.execution.parallel.mode.default=concurrent -Djunit.jupiter.execution.parallel.mode.classes.default=concurrent -Djunit.jupiter.execution.parallel.config.strategy=fixed -Djunit.jupiter.execution.parallel.config.fixed.parallelism=2 -Djunit.jupiter.execution.parallel.config.fixed.max-pool-size={0} ', matrix.parallel) || '' }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>software.xdev.tci.demo</groupId>
<artifactId>tci-advanced-demo</artifactId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>integration-tests</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>
<artifactId>persistence-it</artifactId>
Expand All @@ -24,7 +24,7 @@
</dependency>

<dependency>
<groupId>software.xdev.tci.demo</groupId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-db</artifactId>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ protected void stopInfra()
{
this.dbInfra.logDataBaseInfo();

final DBTCI dbInfra = this.dbInfra;
REAP_CFS.add(CompletableFuture.runAsync(dbInfra::stop));
final DBTCI fDbInfra = this.dbInfra;
REAP_CFS.add(CompletableFuture.runAsync(fDbInfra::stop));

this.dbInfra = null;
}
Expand Down
111 changes: 111 additions & 0 deletions tci-advanced-demo/integration-tests/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>software.xdev.tci.demo</groupId>
<artifactId>tci-advanced-demo</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>

<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>integration-tests</artifactId>
<version>1.2.1-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>persistence-it</module>
<module>tci-db</module>
<module>tci-oidc</module>
<module>tci-selenium</module>
<module>tci-testcontainers</module>
<module>tci-webapp</module>
<module>webapp-it</module>
</modules>

<dependencyManagement>
<dependencies>
<!-- Internal -->
<dependency>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-db</artifactId>
<version>1.2.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-oidc</artifactId>
<version>1.2.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-selenium</artifactId>
<version>1.2.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-webapp</artifactId>
<version>1.2.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-testcontainers</artifactId>
<version>1.2.1-SNAPSHOT</version>
</dependency>

<dependency>
<groupId>software.xdev</groupId>
<artifactId>tci-base</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Selenium -->
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-dependencies-bom</artifactId>
<version>4.33.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Tests -->
<!-- Unit-Tests -->
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.13.1</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<!-- Test Containers -->
<dependency>
<groupId>software.xdev</groupId>
<artifactId>testcontainers-selenium</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>software.xdev</groupId>
<artifactId>testcontainers-junit4-mock</artifactId>
<version>1.0.2</version>
</dependency>
<dependency>
<groupId>software.xdev</groupId>
<artifactId>testcontainers-advanced-imagebuilder</artifactId>
<version>2.0.1</version>
</dependency>

<!-- Utility for proxies in tests -->
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.30.2-GA</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>software.xdev.tci.demo</groupId>
<artifactId>tci-advanced-demo</artifactId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>integration-tests</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>
<artifactId>tci-db</artifactId>

<dependencies>
<dependency>
<groupId>software.xdev.tci.demo</groupId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-testcontainers</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public ClassLoader getNewTempClassLoader()
Optional.ofNullable(connectionProviderClassName)
.ifPresent(p -> properties.put(JdbcSettings.CONNECTION_PROVIDER, connectionProviderClassName));
properties.putAll(DisableHibernateFormatMapper.properties());
properties.putAll(additionalConfig);
return new EntityManagerController(
new HibernatePersistenceProvider()
.createContainerEntityManagerFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.hibernate.boot.archive.scan.spi.ScanResult;


@SuppressWarnings("java:S6548")
public class CachingStandardScanner extends StandardScanner
{
private static CachingStandardScanner instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>software.xdev.tci.demo</groupId>
<artifactId>tci-advanced-demo</artifactId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>integration-tests</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>
<artifactId>tci-oidc</artifactId>

<dependencies>
<dependency>
<groupId>software.xdev.tci.demo</groupId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-testcontainers</artifactId>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>software.xdev.tci.demo</groupId>
<artifactId>tci-advanced-demo</artifactId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>integration-tests</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>
<artifactId>tci-selenium</artifactId>

<dependencies>
<dependency>
<groupId>software.xdev.tci.demo</groupId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-testcontainers</artifactId>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>software.xdev.tci.demo</groupId>
<artifactId>tci-advanced-demo</artifactId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>integration-tests</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>
<artifactId>tci-testcontainers</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>software.xdev.tci.demo</groupId>
<artifactId>tci-advanced-demo</artifactId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>integration-tests</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>
<artifactId>tci-webapp</artifactId>

<dependencies>
<dependency>
<groupId>software.xdev.tci.demo</groupId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-testcontainers</artifactId>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,21 @@ public static synchronized String getBuiltImageName()
"*.iml",
"*.cmd",
"*.md",
".config/**",
".idea/**",
"_dev_infra/**",
"_resource_metrics/**",
// Ignore other Dockerfiles (our required file will always be transferred)
"Dockerfile",
// Ignore not required test-modules that may have changed
// sources only - otherwise the parent pom doesn't find the resources
"tci-*/src/**",
"*-it/src/**",
"**/src/test",
"integration-tests/*/src/**",
"**/src/test/**",
// Ignore resources that are just used for development
"webapp/src/main/resources-dev/**",
// Most files from these folders need to be ignored -> Down there for highest prio
"node_modules",
"target")
.withDockerFilePath(Paths.get("../tci-webapp/Dockerfile"))
.withBaseDir(Paths.get("../"))
.withDockerFilePath(Paths.get("../../integration-tests/tci-webapp/Dockerfile"))
.withBaseDir(Paths.get("../../"))
// File is in root directory - we can't access it
.withBaseDirRelativeIgnoreFile(null)
.withDockerFileLinesModifier(new DockerfileCOPYParentsEmulator());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>software.xdev.tci.demo</groupId>
<artifactId>tci-advanced-demo</artifactId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>integration-tests</artifactId>
<version>1.2.1-SNAPSHOT</version>
</parent>
<artifactId>webapp-it</artifactId>
Expand All @@ -18,22 +18,22 @@

<dependencies>
<dependency>
<groupId>software.xdev.tci.demo</groupId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-db</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>software.xdev.tci.demo</groupId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-oidc</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>software.xdev.tci.demo</groupId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-selenium</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>software.xdev.tci.demo</groupId>
<groupId>software.xdev.tci.demo.it</groupId>
<artifactId>tci-webapp</artifactId>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,19 +194,19 @@ protected void stopWebDriver()
return;
}

final RemoteWebDriver remoteWebDriver = this.remoteWebDriver;
final BrowserTCI browserInfra = this.browserInfra;
final RemoteWebDriver fRemoteWebDriver = this.remoteWebDriver;
final BrowserTCI fBrowserInfra = this.browserInfra;

REAP_CFS.add(CompletableFuture.runAsync(() -> {
try
{
if(remoteWebDriver != null && remoteWebDriver.getSessionId() != null)
if(fRemoteWebDriver != null && fRemoteWebDriver.getSessionId() != null)
{
LOG.info("Quiting remoteWebDriver");
remoteWebDriver.quit();
fRemoteWebDriver.quit();
}

browserInfra.stop();
fBrowserInfra.stop();
}
catch(final Exception ex)
{
Expand All @@ -222,25 +222,25 @@ protected void stopEverything()
{
LOG.info("Shutting down");

final WebAppTCI appInfra = this.appInfra;
final OIDCTCI oidcInfra = this.oidcInfra;
final DBTCI dbInfra = this.dbInfra;
final WebAppTCI fAppInfra = this.appInfra;
final OIDCTCI fOidcInfra = this.oidcInfra;
final DBTCI fDbInfra = this.dbInfra;

final Network network = this.network;
final Network fNetwork = this.network;

REAP_CFS.add(CompletableFuture.runAsync(() -> {
try
{
Stream.<Runnable>concat(
Stream.of(this::stopWebDriver),
Stream.of(appInfra, oidcInfra, dbInfra)
Stream.of(fAppInfra, fOidcInfra, fDbInfra)
.filter(Objects::nonNull)
.map(tci -> tci::stop))
.map(CompletableFuture::runAsync)
.toList() // collect so everything is getting executed async
.forEach(CompletableFuture::join);

Optional.ofNullable(network).ifPresent(Network::close);
Optional.ofNullable(fNetwork).ifPresent(Network::close);
}
catch(final Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.openqa.selenium.support.ui.WebDriverWait;


@SuppressWarnings("java:S119")
public interface IntegrationTestDefaults<SELF extends BaseTest>
{
@SuppressWarnings("unchecked")
Expand Down
Loading