Skip to content

Commit 8f66761

Browse files
authored
Cluster tests (#202)
Recovery-testing module Fix config of docker-compose plugin to support multiple modules.
1 parent d9d1435 commit 8f66761

File tree

10 files changed

+332
-34
lines changed

10 files changed

+332
-34
lines changed

build.gradle

+38-34
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ buildscript {
1212
plugins {
1313
id "io.github.gradle-nexus.publish-plugin" version '1.1.0'
1414
}
15-
apply plugin: 'docker-compose'
1615

1716
nexusPublishing {
1817
repositories {
@@ -84,10 +83,13 @@ subprojects {
8483
apply plugin: 'java'
8584
apply plugin: 'scala'
8685
apply plugin: 'java-library'
87-
apply plugin: 'maven-publish'
88-
apply plugin: 'signing'
8986
apply plugin: 'com.github.ben-manes.versions'
9087

88+
if (!project.hasProperty("notPublished")) {
89+
apply plugin: 'maven-publish'
90+
apply plugin: 'signing'
91+
}
92+
9193
task sourceJar(type: Jar) {
9294
from sourceSets.main.allSource
9395
classifier "sources"
@@ -100,45 +102,47 @@ subprojects {
100102
withSourcesJar()
101103
}
102104

103-
afterEvaluate {
104-
publishing {
105-
publications {
106-
mavenJava(MavenPublication) {
107-
from(components.java)
108-
artifactId = archivesBaseName
109-
pom {
110-
name = 'RabbitMQ client for Scala'
111-
description = 'Scala wrapper over standard RabbitMQ Java client library'
112-
url = 'https://github.com/avast/rabbitmq-scala-client'
113-
licenses {
114-
license {
115-
name = 'The MIT License'
116-
url = 'http://www.opensource.org/licenses/mit-license.php'
105+
if (!project.hasProperty("notPublished")) {
106+
afterEvaluate {
107+
publishing {
108+
publications {
109+
mavenJava(MavenPublication) {
110+
from(components.java)
111+
artifactId = archivesBaseName
112+
pom {
113+
name = 'RabbitMQ client for Scala'
114+
description = 'Scala wrapper over standard RabbitMQ Java client library'
115+
url = 'https://github.com/avast/rabbitmq-scala-client'
116+
licenses {
117+
license {
118+
name = 'The MIT License'
119+
url = 'http://www.opensource.org/licenses/mit-license.php'
120+
}
117121
}
118-
}
119-
developers {
120-
developer {
121-
id = 'jendakol'
122-
name = 'Jenda Kolena'
123-
122+
developers {
123+
developer {
124+
id = 'jendakol'
125+
name = 'Jenda Kolena'
126+
127+
}
128+
}
129+
scm {
130+
connection = 'scm:git:git://github.com/avast/rabbitmq-scala-client.git'
131+
developerConnection = 'scm:git:ssh://github.com/avast/rabbitmq-scala-client.git'
132+
url = 'https://github.com/avast/rabbitmq-scala-client'
124133
}
125-
}
126-
scm {
127-
connection = 'scm:git:git://github.com/avast/rabbitmq-scala-client.git'
128-
developerConnection = 'scm:git:ssh://github.com/avast/rabbitmq-scala-client.git'
129-
url = 'https://github.com/avast/rabbitmq-scala-client'
130134
}
131135
}
132136
}
133137
}
134138
}
135-
}
136139

137-
signing {
138-
String base64Key = System.getenv('SIGNING_KEY')
139-
if (base64Key) {
140-
useInMemoryPgpKeys(new String(Base64.decoder.decode(base64Key)), System.getenv('SIGNING_PASSWORD'))
141-
sign publishing.publications
140+
signing {
141+
String base64Key = System.getenv('SIGNING_KEY')
142+
if (base64Key) {
143+
useInMemoryPgpKeys(new String(Base64.decoder.decode(base64Key)), System.getenv('SIGNING_PASSWORD'))
144+
sign publishing.publications
145+
}
142146
}
143147
}
144148

core/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
apply plugin: 'docker-compose'
12
apply plugin: 'com.google.protobuf'
23

34
archivesBaseName = "rabbitmq-client-core_$scalaVersion"
File renamed without changes.
File renamed without changes.

recovery-testing/build.gradle

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apply plugin: 'docker-compose'
2+
3+
archivesBaseName = "rabbitmq-client-core_$scalaVersion"
4+
5+
dockerCompose.isRequiredBy(test)
6+
7+
test.doFirst {
8+
dockerCompose.exposeAsSystemProperties(test)
9+
}
10+
11+
dependencies {
12+
api project(":pureconfig")
13+
14+
api "com.spotify:docker-client:8.14.1"
15+
}

recovery-testing/docker-compose.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
version: "3"
2+
services:
3+
cluster_rabbit1:
4+
image: lucifer8591/rabbitmq-server:3.7.17
5+
hostname: cluster_rabbit1
6+
ports:
7+
- "20001:5672"
8+
- "15672:15672"
9+
environment:
10+
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER:-admin}
11+
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS:-admin}
12+
cluster_rabbit2:
13+
image: lucifer8591/rabbitmq-server:3.7.17
14+
hostname: cluster_rabbit2
15+
links:
16+
- cluster_rabbit1
17+
environment:
18+
- CLUSTERED=true
19+
- CLUSTER_WITH=cluster_rabbit1
20+
- RAM_NODE=true
21+
ports:
22+
- "20002:5672"
23+
- "15673:15672"
24+
cluster_rabbit3:
25+
image: lucifer8591/rabbitmq-server:3.7.17
26+
hostname: cluster_rabbit3
27+
links:
28+
- cluster_rabbit1
29+
- cluster_rabbit2
30+
environment:
31+
- CLUSTERED=true
32+
- CLUSTER_WITH=cluster_rabbit1
33+
ports:
34+
- "20003:5672"

recovery-testing/gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
notPublished=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
recoveryTesting {
2+
hosts = ["127.0.0.1:20001", "127.0.0.1:20002", "127.0.0.1:20003"] // the order is irrelevant
3+
virtualHost = "/"
4+
5+
name = "TestingConnection"
6+
7+
credentials {
8+
enabled = true
9+
10+
username = "admin"
11+
password = "admin"
12+
}
13+
14+
connectionTimeout = 1s
15+
16+
networkRecovery {
17+
enabled = true // enabled by default
18+
19+
handler {
20+
type = "exponential" // exponential, linear
21+
22+
initialDelay = 10s
23+
period = 2s
24+
maxLength = 32s
25+
}
26+
}
27+
28+
29+
consumers {
30+
consumer {
31+
name = "TestingConsumer"
32+
33+
queueName = "RecoveryTesting"
34+
35+
prefetchCount = 5
36+
processTimeout = 0
37+
38+
declare {
39+
enabled = true
40+
41+
durable = true
42+
autoDelete = false
43+
exclusive = false
44+
}
45+
46+
bindings = []
47+
}
48+
}
49+
50+
producers {
51+
producer {
52+
name = "TestingProducer"
53+
exchange = ""
54+
}
55+
}
56+
57+
}

0 commit comments

Comments
 (0)