This is an automated email from the ASF dual-hosted git repository. joewitt pushed a commit to branch support/nifi-1.16 in repository https://gitbox.apache.org/repos/asf/nifi.git
commit cbb81d0b33c8f62e6a850e6d66255bd14d28e12c Author: Bryan Bende <[email protected]> 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 <[email protected]> --- .../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 7609c40069..f8c6f8839f 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 53d201294b..a3046233b8 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 69fc9875d1..0000000000 --- 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 d0a1fdeaf6..0000000000 --- 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 01fe05d789..19b8346897 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 e3de7df6df..5fb211babb 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 70488529c9..f581b7b848 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>
