Skip to content

Commit ce75e70

Browse files
authored
Updated the integration testing docs (#4079)
* Updated the integration testing docs * Updated TESTING.md for accuracy
1 parent 8abd76e commit ce75e70

File tree

2 files changed

+43
-10
lines changed

2 files changed

+43
-10
lines changed

TESTING.md

+37-10
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,59 @@ This set of tests are mainly designed to work in two different modes:
2828

2929
### ITs with local infrastructure
3030

31-
This is the normal mode used when you execute the testsuite. Because Apicurio Registry supports various storage backends and various deployment time configurations(such as authentication,...) this tests deploy different components depending on the test executed. This is achieved using Quarkus profiles.
32-
33-
When running from the terminal, the configuration is provided via maven profiles. You can find all the available maven profiles [here](integration-tests/pom.xml)
31+
This is the normal mode used when you execute the testsuite. Because Apicurio Registry employs a unified approach to the application as of version 3.0, the only storage that can currently be used in this mode is in-memory.
3432

3533
When executing the testsuite you normally provide two profiles:
3634
+ test profile (which determines the tests that will be executed), with the following options: all, ci, smoke, serdes, ui, acceptance, auth, migration, sqlit, kafkasqlit.
37-
+ storage variant to test (which determines the storage backend that will be deployed, and therefore tested), the available options for running the test locally are: local-mem , local-sql, local-mssql , local-kafka.
35+
+ `local-tests` - this profile enables local testing mode, rather than remote testing (i.e. registry deployed to an external environment like minikube)
36+
37+
As you might expect, this testsuite mode depends on the rest of the project to be built first, in order to have the application jars/images available or the serdes module to be available.
3838

39-
As you might expect, this testsuite mode depends on the rest of the project to be built first, in order to have the application jars/images available or the serdes module to be available as well.
39+
For example, to run the smoke tests group using this approach, first run `mvn clean install` (this command will execute all unit tests as well, you can skip them using `-DskipTests`) and then run `mvn verify -am -Pintegration-tests -pl integration-tests -Plocal-tests -Psmoke`.
4040

41-
For running the smoke tests group using the sql variant, first run `mvn clean install -Psql` (this command will execute the unit tests for the sql variant, you can skip them using `-DskipTests`) and then run `mvn verify -Plocal-sql -Psmoke`.
41+
Here is a breakdown of the options:
4242

43+
* `verify` - the maven command you want to run. Verify will run the tests.
44+
* `-am` - automatically build any maven modules needed by the module/project being built.
45+
* `-Pintegration-tests` - enable the `integration-tests` profile, which adds the **integration-tests** maven module to the reactor.
46+
* `-pl integration-tests` - tell maven to only build the **integration-tests* module.
47+
* `-Plocal-tests` - enable local testing mode, which will tell the test framework to start the Quarkus application automatically for the tests.
48+
* `-Psmoke` - run only the integration tests in the `smoke` group.
4349

4450
## ITs with infrastructure in Kubernetes/Openshift
4551

46-
The Integration Tests testsuite can be configured to expect Apicurio Registry, and it's required infrastructure, to be deployed externally in a K8s cluster.
52+
The Integration Tests testsuite can be configured to expect Apicurio Registry, and its required infrastructure, to be deployed externally in a K8s cluster.
4753

4854
In this mode, the testsuite expects your kubeconfig file to be already configured pointing to the cluster that will be used for testing. The tests that will be executed are determined using the maven profile just as when running locally.
49-
As for the storage variant, it will be determined using a similar approach as the one used for the local execution but with different names: remote-mem, remote-sql, remote-mssql, remote-kafka.
55+
As for the storage variant, it will be determined by activating one of the `remote-*` maven proviles: remote-mem, remote-sql, remote-kafka.
56+
57+
For more help/examples of running the integration tests in this mode, see our CI jobs here: [Integration Tests GH Workflow](.github/workflows/integration-tests.yaml)
58+
59+
## ITs against custom infrastructure
60+
61+
Another way to run the tests is against custom infrastructure. You can deploy and run the registry in whatever way you want, and then run the integration tests against that deployment.
62+
63+
To do this, you must once again specify the collection of integration tests you wish to run, but instead of activating the `local-tests` maven profile or one of the `remote-*` profiles, you can add `-Dquarkus.http.test-host` and `-Dquarkus.http.test-port` to the maven command line.
64+
65+
For example, you can run the tests against the docker version of Registry by doing the following:
5066

51-
We have make goals for all the deployment variants and you have examples for all the execution possibilities in our [Github Actions Workflows](.github/workflows/integration-tests.yaml)
67+
### Run Registry using docker
68+
69+
```
70+
docker pull quay.io/apicurio/apicurio-registry:latest-snapshot
71+
docker run -it -p 8080:8080 quay.io/apicurio/apicurio-registry:latest-snapshot
72+
```
73+
74+
### Run the integration tests against the running docker container
75+
76+
```
77+
mvn verify -Psmoke -Dquarkus.http.test-host=127.0.0.1 -Dquarkus.http.test-port=8080
78+
```
5279

5380

5481
## Integration Tests testsuite internal details
5582

56-
The Integration Tests testsuite is written in Java and we use JUnit 5 .
83+
The Integration Tests testsuite is written in Java and we use JUnit 5.
5784

5885
The main entry point for the testsuite is this class [`integration-tests/src/test/java/io/apicurio/deployment/RegistryDeploymentManager.java`](integration-tests/src/test/java/io/apicurio/deployment/RegistryDeploymentManager.java).
5986

integration-tests/README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Apicurio Registry Integration Tests
2+
3+
This module contains a collection of integration tests for Apicurio Registry. You can find documentation about
4+
how to run them here:
5+
6+
[../TESTING.md](../TESTING.md)

0 commit comments

Comments
 (0)