You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by kd...@apache.org on 2022/03/31 17:43:40 UTC
[nifi] branch main updated: NIFI-9845 Fix NiFi Registry database ITs
This is an automated email from the ASF dual-hosted git repository.
kdoran pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 3c10910 NIFI-9845 Fix NiFi Registry database ITs
3c10910 is described below
commit 3c10910fe266ca8274ef8d14ad2423e5bef6c7be
Author: Bryan Bende <bb...@gmail.com>
AuthorDate: Tue Mar 29 11:44:59 2022 -0400
NIFI-9845 Fix NiFi Registry database ITs
- remove unsupported DB test containers, update admin guide
This closes #5914.
Signed-off-by: Kevin Doran <kd...@apache.org>
---
.../src/main/asciidoc/administration-guide.adoc | 2 +-
.../nifi-registry-core/nifi-registry-test/pom.xml | 10 ------
.../nifi/registry/db/MySql6DataSourceFactory.java | 37 ----------------------
.../nifi/registry/db/MySql7DataSourceFactory.java | 37 ----------------------
...ctory.java => Postgres14DataSourceFactory.java} | 6 ++--
nifi-registry/nifi-registry-core/pom.xml | 35 +++++++-------------
nifi-registry/pom.xml | 26 +++++++++++++++
7 files changed, 41 insertions(+), 112 deletions(-)
diff --git a/nifi-registry/nifi-registry-core/nifi-registry-docs/src/main/asciidoc/administration-guide.adoc b/nifi-registry/nifi-registry-core/nifi-registry-docs/src/main/asciidoc/administration-guide.adoc
index 7609c40..f8c6f88 100644
--- a/nifi-registry/nifi-registry-core/nifi-registry-docs/src/main/asciidoc/administration-guide.adoc
+++ b/nifi-registry/nifi-registry-core/nifi-registry-docs/src/main/asciidoc/administration-guide.adoc
@@ -1131,7 +1131,7 @@ providing 2 total locations, including `nifi.registry.extension.dir.1`.
The metadata database maintains the knowledge of which buckets exist, which versioned items belong to which buckets, as well as the version history for each item.
-Currently, NiFi Registry supports using H2, Postgres (9.x, 10.x), and MySQL (5.6, 5.7, 8.0) for the relational database engine.
+Currently, NiFi Registry supports using H2, Postgres (10.x - 13.x), and MySQL (8.0) for the relational database engine.
NOTE: NiFi Registry 0.1.0 only supports H2.
diff --git a/nifi-registry/nifi-registry-core/nifi-registry-test/pom.xml b/nifi-registry/nifi-registry-core/nifi-registry-test/pom.xml
index 0354b71..65cbe5a 100644
--- a/nifi-registry/nifi-registry-core/nifi-registry-test/pom.xml
+++ b/nifi-registry/nifi-registry-core/nifi-registry-test/pom.xml
@@ -40,29 +40,19 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
- <version>${testcontainers.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
- <version>${testcontainers.version}</version>
- <exclusions>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>jcl-over-slf4j</artifactId>
- </exclusion>
- </exclusions>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mariadb</artifactId>
- <version>${testcontainers.version}</version>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
- <version>${testcontainers.version}</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
diff --git a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/MySql6DataSourceFactory.java b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/MySql6DataSourceFactory.java
deleted file mode 100644
index 69fc987..0000000
--- a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/MySql6DataSourceFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.registry.db;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.testcontainers.containers.MySQLContainer;
-
-@Configuration
-@Profile("mysql-56")
-public class MySql6DataSourceFactory extends MySqlDataSourceFactory {
-
- private static final MySQLContainer MYSQL_CONTAINER = new MySqlCustomContainer("mysql:5.6");
-
- static {
- MYSQL_CONTAINER.start();
- }
-
- @Override
- protected MySQLContainer mysqlContainer() {
- return MYSQL_CONTAINER;
- }
-}
diff --git a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/MySql7DataSourceFactory.java b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/MySql7DataSourceFactory.java
deleted file mode 100644
index d0a1fde..0000000
--- a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/MySql7DataSourceFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.registry.db;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.Profile;
-import org.testcontainers.containers.MySQLContainer;
-
-@Configuration
-@Profile({"mysql", "mysql-57"})
-public class MySql7DataSourceFactory extends MySqlDataSourceFactory {
-
- private static final MySQLContainer MYSQL_CONTAINER = new MySqlCustomContainer("mysql:5.7");
-
- static {
- MYSQL_CONTAINER.start();
- }
-
- @Override
- protected MySQLContainer mysqlContainer() {
- return MYSQL_CONTAINER;
- }
-}
diff --git a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/PostgresDataSourceFactory.java b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres14DataSourceFactory.java
similarity index 93%
rename from nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/PostgresDataSourceFactory.java
rename to nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres14DataSourceFactory.java
index 01fe05d..19b8346 100644
--- a/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/PostgresDataSourceFactory.java
+++ b/nifi-registry/nifi-registry-core/nifi-registry-test/src/main/java/org/apache/nifi/registry/db/Postgres14DataSourceFactory.java
@@ -29,10 +29,10 @@ import javax.sql.DataSource;
import java.sql.SQLException;
@Configuration
-@Profile("postgres")
-public class PostgresDataSourceFactory extends TestDataSourceFactory {
+@Profile("postgres-14")
+public class Postgres14DataSourceFactory extends TestDataSourceFactory {
- private static final PostgreSQLContainer POSTGRESQL_CONTAINER = new PostgreSQLContainer();
+ private static final PostgreSQLContainer POSTGRESQL_CONTAINER = new PostgreSQLContainer("postgres:14");
static {
POSTGRESQL_CONTAINER.start();
diff --git a/nifi-registry/nifi-registry-core/pom.xml b/nifi-registry/nifi-registry-core/pom.xml
index 96b2dfd..14f666a 100644
--- a/nifi-registry/nifi-registry-core/pom.xml
+++ b/nifi-registry/nifi-registry-core/pom.xml
@@ -172,20 +172,7 @@
<artifactId>maven-failsafe-plugin</artifactId>
<executions>
<execution>
- <id>mysql5.7-test</id>
- <phase>verify</phase>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <spring.profiles.active>mysql-57</spring.profiles.active>
- </systemPropertyVariables>
- </configuration>
- </execution>
- <execution>
- <id>mysql58-test</id>
+ <id>mysql8-test</id>
<phase>verify</phase>
<goals>
<goal>integration-test</goal>
@@ -198,7 +185,7 @@
</configuration>
</execution>
<execution>
- <id>postgres-test</id>
+ <id>postgres10-test</id>
<phase>verify</phase>
<goals>
<goal>integration-test</goal>
@@ -206,12 +193,12 @@
</goals>
<configuration>
<systemPropertyVariables>
- <spring.profiles.active>postgres</spring.profiles.active>
+ <spring.profiles.active>postgres-10</spring.profiles.active>
</systemPropertyVariables>
</configuration>
</execution>
<execution>
- <id>postgres10-test</id>
+ <id>postgres11-test</id>
<phase>verify</phase>
<goals>
<goal>integration-test</goal>
@@ -219,12 +206,12 @@
</goals>
<configuration>
<systemPropertyVariables>
- <spring.profiles.active>postgres-10</spring.profiles.active>
+ <spring.profiles.active>postgres-11</spring.profiles.active>
</systemPropertyVariables>
</configuration>
</execution>
<execution>
- <id>postgres11-test</id>
+ <id>postgres12-test</id>
<phase>verify</phase>
<goals>
<goal>integration-test</goal>
@@ -232,12 +219,12 @@
</goals>
<configuration>
<systemPropertyVariables>
- <spring.profiles.active>postgres-11</spring.profiles.active>
+ <spring.profiles.active>postgres-12</spring.profiles.active>
</systemPropertyVariables>
</configuration>
</execution>
<execution>
- <id>postgres12-test</id>
+ <id>postgres13-test</id>
<phase>verify</phase>
<goals>
<goal>integration-test</goal>
@@ -245,12 +232,12 @@
</goals>
<configuration>
<systemPropertyVariables>
- <spring.profiles.active>postgres-12</spring.profiles.active>
+ <spring.profiles.active>postgres-13</spring.profiles.active>
</systemPropertyVariables>
</configuration>
</execution>
<execution>
- <id>postgres13-test</id>
+ <id>postgres14-test</id>
<phase>verify</phase>
<goals>
<goal>integration-test</goal>
@@ -258,7 +245,7 @@
</goals>
<configuration>
<systemPropertyVariables>
- <spring.profiles.active>postgres-13</spring.profiles.active>
+ <spring.profiles.active>postgres-14</spring.profiles.active>
</systemPropertyVariables>
</configuration>
</execution>
diff --git a/nifi-registry/pom.xml b/nifi-registry/pom.xml
index e2ded17..e6fc25e 100644
--- a/nifi-registry/pom.xml
+++ b/nifi-registry/pom.xml
@@ -216,6 +216,32 @@
<version>${nifi.groovy.version}</version>
<type>test</type>
</dependency>
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>testcontainers</artifactId>
+ <version>${testcontainers.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>mysql</artifactId>
+ <version>${testcontainers.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl-over-slf4j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>mariadb</artifactId>
+ <version>${testcontainers.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.testcontainers</groupId>
+ <artifactId>postgresql</artifactId>
+ <version>${testcontainers.version}</version>
+ </dependency>
</dependencies>
</dependencyManagement>