From db9184b57555a383f6d0e1761f7480f77e037a79 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 29 Sep 2023 21:21:13 -0300 Subject: [PATCH] fix: Build for MySQL Registry Storage (#3726) * Typo fix on README and entry on CONTRIBUTING.md * Fix on mysql build * Add mysql integration tests to 'integration-tests' task * Add 'run-mysql-integration-tests' and 'run-mysql-clustered-integration-tests' to Makefile 'integration-tests' task * Update TESTING.md - Append the entry for 'mysql' on TESTING.md * Add entry for the docker.mysql.file --- CONTRIBUTING.md | 3 ++- Makefile | 2 +- README.md | 4 ++-- TESTING.md | 2 +- distro/docker/pom.xml | 21 +++++++++++++++++++++ srcclr.yml | 2 +- 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b544352f04..78864ef1ed 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,7 +73,8 @@ Be sure to test your pull request using all storage variants: 1. SQL storage (using the `-Psql` profile) 2. SQL Server storage (using the `-Pmssql` profile) -3. KafkaSQL storage (using the `-Pkafkasql` profile) +3. MySQL storage (using the `-Pmysql` profile) +4. KafkaSQL storage (using the `-Pkafkasql` profile) ### Customizing Registry supported ArtifactTypes diff --git a/Makefile b/Makefile index 6ac3b77e5f..ec2e04345e 100644 --- a/Makefile +++ b/Makefile @@ -516,7 +516,7 @@ run-kafkasql-legacy-tests: build-integration-tests-common ./mvnw verify --no-transfer-progress -Pintegration-tests -P$(INTEGRATION_TESTS_PROFILE) -Pkafkasql -pl integration-tests/legacy-tests -Dmaven.javadoc.skip=true --no-transfer-progress .PHONY: integration-tests ## Runs all integration tests [SKIP_TESTS, BUILD_FLAGS] -integration-tests: build-all build-integration-tests-common run-ui-tests run-sql-integration-tests run-sql-clustered-integration-tests run-mssql-integration-tests run-mssql-clustered-integration-tests run-kafkasql-integration-tests run-kafkasql-clustered-integration-tests run-multitenancy-integration-tests run-sql-migration-integration-tests run-mssql-migration-integration-tests run-kafkasql-migration-integration-tests run-sql-auth-integration-tests run-mssql-auth-integration-tests run-kafkasql-auth-integration-tests run-sql-legacy-tests run-mssql-legacy-tests run-kafkasql-legacy-tests +integration-tests: build-all build-integration-tests-common run-ui-tests run-sql-integration-tests run-sql-clustered-integration-tests run-mssql-integration-tests run-mssql-clustered-integration-tests run-mysql-integration-tests run-mysql-clustered-integration-tests run-kafkasql-integration-tests run-kafkasql-clustered-integration-tests run-multitenancy-integration-tests run-sql-migration-integration-tests run-mssql-migration-integration-tests run-kafkasql-migration-integration-tests run-sql-auth-integration-tests run-mssql-auth-integration-tests run-kafkasql-auth-integration-tests run-sql-legacy-tests run-mssql-legacy-tests run-kafkasql-legacy-tests # Please declare your targets as .PHONY in the format shown below, so that the 'make help' parses the information correctly. # diff --git a/README.md b/README.md index 4daba842f1..e7bc934226 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ This should result in Quarkus and the in-memory registry starting up, with the u and `PostgreSQL` driver in *prod* mode. - `-Pmssql` enables a build of `storage/mssql` module and produces `apicurio-registry-storage-mssql--all.zip`. This artifact uses `H2` driver in *dev* mode, and `SQL Server` driver in *prod* mode. -- `-Pmysql` enables a build of `storage/mssql` module and produces `apicurio-registry-storage-mssql--all.zip`. This artifact uses `H2` driver in *dev* mode, +- `-Pmysql` enables a build of `storage/mysql` module and produces `apicurio-registry-storage-mssql--all.zip`. This artifact uses `H2` driver in *dev* mode, and `MySQL` driver in *prod* mode. - `-Pkafkasql` enables a build of the `storage/kafkasql` module and produces the `apicurio-registry-storage-kafkasql--all.zip` artifact. - `-Pnative` *(experimental)* builds native executables. See [Building a native executable](https://quarkus.io/guides/maven-tooling#building-a-native-executable). @@ -59,7 +59,7 @@ The following parameters are available for executable files: ### SQL - In the *dev* mode, the application expects an H2 server running at `jdbc:h2:tcp://localhost:9123/mem:registry`. - - In the *prod* mode, you have to provide connection configuration for a PostgreSQL (or SQL Server) server as follows: + - In the *prod* mode, you have to provide connection configuration for a PostgreSQL (or SQL Server, or MySQL) server as follows: |Option|Command argument|Env. variable| |---|---|---| diff --git a/TESTING.md b/TESTING.md index 5ec3ec0d55..22d773a750 100644 --- a/TESTING.md +++ b/TESTING.md @@ -33,7 +33,7 @@ This is the normal mode used when you execute the testsuite. Because Apicurio Re The configuration is provided via maven profiles. You can find all the available maven profiles [here](integration-tests/testsuite/pom.xml) When executing the testsuite you normally provide two profiles: + test profile (which determines the tests that will be executed), some options are acceptance , multitenancy ,... -+ storage variant to test (which determines the storage backend that will be deployed, and therefore tested), the available options are: inmemory , sql, mssql , kafkasql . ++ storage variant to test (which determines the storage backend that will be deployed, and therefore tested), the available options are: inmemory , sql, mssql, mysql, kafkasql. You can find multiple examples of how to run the testsuite in this mode in our [Github Actions Workflows](.github/workflows/integration-tests.yaml) diff --git a/distro/docker/pom.xml b/distro/docker/pom.xml index e0e5c747cf..5924cce2c3 100644 --- a/distro/docker/pom.xml +++ b/distro/docker/pom.xml @@ -17,6 +17,7 @@ app-files/apicurio-registry-app-${project.version}-all.tar.gz app-files/apicurio-registry-storage-sql-${project.version}-all.tar.gz app-files/apicurio-registry-storage-mssql-${project.version}-all.tar.gz + app-files/apicurio-registry-storage-mysql-${project.version}-all.tar.gz app-files/apicurio-registry-storage-kafkasql-${project.version}-all.tar.gz app-files/apicurio-registry-tenant-manager-api-${project.version}-all.tar.gz @@ -69,6 +70,14 @@ apicurio-*runner + + ${basedir}/../../storage/mysql/target + false + + apicurio-*.tar.gz + apicurio-*runner + + ${basedir}/../../storage/kafkasql/target false @@ -144,6 +153,18 @@ + + mysql + + + io.apicurio + apicurio-registry-storage-mysql + ${project.version} + provided + + + + kafkasql diff --git a/srcclr.yml b/srcclr.yml index fa6c188846..2214934565 100644 --- a/srcclr.yml +++ b/srcclr.yml @@ -1 +1 @@ -custom_maven_command: -Pprod,sql,mssql,kafkasql clean install -DskipTests +custom_maven_command: -Pprod,sql,mssql,mysql,kafkasql clean install -DskipTests