You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+56-45Lines changed: 56 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
This guide describes how to develop and contribute pull requests to this connector. The focus is currently on how to
2
-
develop and test the connector, either via a Docker cluster install of Confluent Platform or of the regular Kafka
3
-
distribution.
2
+
develop and test the connector. There are two methods available - automated and manual. Both methods are performed via a
3
+
Docker stack. The automated tests stack creates MarkLogic, Sonar, and Postgres instance for the automated tests. The
4
+
manual tests use Confluent Platform in a different Docker stack to allow testing the connector via Confluent Control
5
+
Center with a MarkLogic instance in the same stack.
4
6
5
7
### Requirements:
6
8
* MarkLogic Server 11+
@@ -10,7 +12,7 @@ See [the Confluent compatibility matrix](https://docs.confluent.io/platform/curr
10
12
for more information. After installing your desired version of Java, ensure that the `JAVA_HOME` environment variable
11
13
points to your Java installation.
12
14
13
-
# Configuring Local Automated and Manual Testing
15
+
# Configuring Local Automated Testing
14
16
15
17
The test suite for the MarkLogic Kafka connector, found at `src/test`, requires that the test application first be
16
18
deployed to a MarkLogic instance. The recommendation is for this application to be deployed via Docker and
@@ -19,51 +21,17 @@ deployed to a MarkLogic instance. The recommendation is for this application to
19
21
Note that you do not need to install [Gradle](https://gradle.org/) - the "gradlew" program used below will install the
20
22
appropriate version of Gradle if you do not have it installed already.
21
23
22
-
## Virtual Server Preparation
23
-
The project includes a docker-compose file in the repository root that includes MarkLogic, SonarQube with a Postgres server, and Confluent
24
-
Platform servers.
25
-
26
-
### Confluent Platform
27
-
[Confluent Platform](https://docs.confluent.io/platform/current/overview.html) provides an easy mechanism for running
28
-
Kafka locally via a single Docker cluster. A primary benefit of testing with Confluent Platform is to test configuring
29
-
the MarkLogic Kafka connector via the
30
-
[Confluent Control Center](https://docs.confluent.io/platform/current/control-center/index.html) web application.
31
-
The Confluent Platform servers in this docker-compose file are based on the Confluent files and instructions at
32
-
[Install a Confluent Platform cluster in Docker using a Confluent docker-compose file](https://docs.confluent.io/platform/current/platform-quickstart.html).
33
-
34
-
## Docker Cluster Preparation
35
-
To setup the docker cluster, use the docker-compose file in the repository root to build the Docker cluster with
36
-
the command:
24
+
## Docker Cluster Preparation for Automated Testing
25
+
The automated tests require a MarkLogic server, SonarQube server, and Postgres server. The docker-compose file in the
26
+
repository root includes these services. To prepare for running the automated tests, perform the following steps:
37
27
```
38
28
docker-compose up -d --build
39
29
```
40
-
When the setup is complete, you should be able to run
41
-
```
42
-
docker-compose ps
43
-
```
44
-
and see results similar to the following.
45
-
```
46
-
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
47
-
broker confluentinc/cp-kafka:7.6.1 "/etc/confluent/dock…" broker 14 minutes ago Up 14 minutes 0.0.0.0:9092->9092/tcp, 0.0.0.0:9101->9101/tcp
48
-
connect cnfldemos/cp-server-connect-datagen:0.6.4-7.6.0 "/etc/confluent/dock…" connect 14 minutes ago Up 14 minutes 0.0.0.0:8083->8083/tcp, 9092/tcp
49
-
control-center confluentinc/cp-enterprise-control-center:7.6.1 "/etc/confluent/dock…" control-center 14 minutes ago Up 14 minutes 0.0.0.0:9021->9021/tcp
50
-
ksql-datagen confluentinc/ksqldb-examples:7.6.1 "bash -c 'echo Waiti…" ksql-datagen 14 minutes ago Up 14 minutes
51
-
ksqldb-cli confluentinc/cp-ksqldb-cli:7.6.1 "/bin/sh" ksqldb-cli 14 minutes ago Up 14 minutes
52
-
ksqldb-server confluentinc/cp-ksqldb-server:7.6.1 "/etc/confluent/dock…" ksqldb-server 14 minutes ago Up 14 minutes 0.0.0.0:8088->8088/tcp
53
-
marklogic marklogicdb/marklogic-db:11.2.0-centos-1.1.2 "/tini -- /usr/local…" marklogic 14 minutes ago Up 14 minutes 25/tcp, 7997-7999/tcp, 0.0.0.0:8000-8002->8000-8002/tcp, 0.0.0.0:8010-8013->8010-8013/tcp, 8003-8009/tcp, 0.0.0.0:8018-8019->8018-8019/tcp
54
-
marklogic-kafka-confluent-postgres-1 postgres:15-alpine "docker-entrypoint.s…" postgres 14 minutes ago Up 14 minutes 5432/tcp
55
-
marklogic-kafka-confluent-sonarqube-1 sonarqube:10.3.0-community "/opt/sonarqube/dock…" sonarqube 14 minutes ago Up 14 minutes 0.0.0.0:9000->9000/tcp
56
-
rest-proxy confluentinc/cp-kafka-rest:7.6.1 "/etc/confluent/dock…" rest-proxy 14 minutes ago Up 14 minutes 0.0.0.0:8082->8082/tcp
57
-
schema-registry confluentinc/cp-schema-registry:7.6.1 "/etc/confluent/dock…" schema-registry 14 minutes ago Up 14 minutes 0.0.0.0:8081->8081/tcp
58
-
```
59
30
60
-
You can now visit several web applications:
31
+
You can now visit these web applications:
61
32
*http://localhost:8000 to access the MarkLogic server.
62
33
*http://localhost:9000 to use the SonarQube server as described in the "Running Sonar Code Analysis"
63
34
section below.
64
-
*http://localhost:9021 to access
65
-
[Confluent's Control Center GUI](https://docs.confluent.io/platform/current/control-center/index.html) application.
66
-
Within Control Center, click on "controlcenter.cluster" to access the configuration for the Kafka cluster.
67
35
68
36
## MarkLogic Preparation
69
37
To prepare the MarkLogic server for automated testing as well as testing with the Confluent Platform, the Data Hub based
@@ -100,8 +68,8 @@ To configure the SonarQube service, perform the following steps:
100
68
8. On the "Analysis Method" page, click on "Locally".
101
69
9. In the "Provide a token" panel, click on "Generate". Copy the token.
102
70
10. Click the "Continue" button.
103
-
11. Update `systemProp.sonar.token=<Replace With Your Sonar Token>` in `gradle-local.properties` in the root of your
104
-
project.
71
+
11. Update `systemProp.sonar.token=<Replace With Your Sonar Token>` in `gradle-local.properties` in the root directory
72
+
of your project.
105
73
106
74
To run the SonarQube analysis, run the following Gradle task in the root directory, which will run all the tests with
107
75
code coverage and then generate a quality report with SonarQube:
@@ -125,16 +93,59 @@ without having to re-run the tests.
125
93
For more assistance with Sonar and Gradle, see the
broker confluentinc/cp-kafka:7.6.1 "/etc/confluent/dock…" broker 14 minutes ago Up 14 minutes 0.0.0.0:9092->9092/tcp, 0.0.0.0:9101->9101/tcp
115
+
connect cnfldemos/cp-server-connect-datagen:0.6.4-7.6.0 "/etc/confluent/dock…" connect 14 minutes ago Up 14 minutes 0.0.0.0:8083->8083/tcp, 9092/tcp
116
+
control-center confluentinc/cp-enterprise-control-center:7.6.1 "/etc/confluent/dock…" control-center 14 minutes ago Up 14 minutes 0.0.0.0:9021->9021/tcp
117
+
ksql-datagen confluentinc/ksqldb-examples:7.6.1 "bash -c 'echo Waiti…" ksql-datagen 14 minutes ago Up 14 minutes
118
+
ksqldb-cli confluentinc/cp-ksqldb-cli:7.6.1 "/bin/sh" ksqldb-cli 14 minutes ago Up 14 minutes
119
+
ksqldb-server confluentinc/cp-ksqldb-server:7.6.1 "/etc/confluent/dock…" ksqldb-server 14 minutes ago Up 14 minutes 0.0.0.0:8088->8088/tcp
120
+
marklogic marklogicdb/marklogic-db:11.2.0-centos-1.1.2 "/tini -- /usr/local…" marklogic 14 minutes ago Up 14 minutes 25/tcp, 7997-7999/tcp, 0.0.0.0:8000-8002->8000-8002/tcp, 0.0.0.0:8010-8013->8010-8013/tcp, 8003-8009/tcp, 0.0.0.0:8018-8019->8018-8019/tcp
121
+
marklogic-kafka-confluent-postgres-1 postgres:15-alpine "docker-entrypoint.s…" postgres 14 minutes ago Up 14 minutes 5432/tcp
122
+
marklogic-kafka-confluent-sonarqube-1 sonarqube:10.3.0-community "/opt/sonarqube/dock…" sonarqube 14 minutes ago Up 14 minutes 0.0.0.0:9000->9000/tcp
123
+
rest-proxy confluentinc/cp-kafka-rest:7.6.1 "/etc/confluent/dock…" rest-proxy 14 minutes ago Up 14 minutes 0.0.0.0:8082->8082/tcp
124
+
schema-registry confluentinc/cp-schema-registry:7.6.1 "/etc/confluent/dock…" schema-registry 14 minutes ago Up 14 minutes 0.0.0.0:8081->8081/tcp
125
+
```
126
+
127
+
You can now visit several web applications:
128
+
*http://localhost:8000 to access the MarkLogic server.
129
+
*http://localhost:9021 to access
130
+
[Confluent's Control Center GUI](https://docs.confluent.io/platform/current/control-center/index.html) application.
131
+
Within Control Center, click on "controlcenter.cluster" to access the configuration for the Kafka cluster.
132
+
133
+
### Confluent Platform for Manual Testing
134
+
[Confluent Platform](https://docs.confluent.io/platform/current/overview.html) provides an easy mechanism for running
135
+
Kafka locally via a single Docker cluster. A primary benefit of testing with Confluent Platform is to test configuring
136
+
the MarkLogic Kafka connector via the
137
+
[Confluent Control Center](https://docs.confluent.io/platform/current/control-center/index.html) web application.
138
+
The Confluent Platform servers in this docker-compose file are based on the Confluent files and instructions at
139
+
[Install a Confluent Platform cluster in Docker using a Confluent docker-compose file](https://docs.confluent.io/platform/current/platform-quickstart.html).
128
140
129
-
## Confluent Platform for Manual Testing
130
141
131
142
### Building and Sharing the Connector with the Docker Container
132
143
Using gradle in the root directory, build the connector archive and copy it to a directory shared with the Confluent
133
144
Platform Docker cluster built in the that section, using this gradle command in the root directory:
134
145
```
135
146
./gradlew copyConnectorToDockerVolume
136
147
```
137
-
**You MUST restart the "connect" server in the Docker "confluent-platform-example" cluster.**
148
+
**You MUST restart the "connect" server in the Docker "manual-tests-marklogic-kafka-confluent" cluster.**
0 commit comments