forked from neo4j/neo4j-kafka-connector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntegrationTests.kt
More file actions
138 lines (127 loc) · 5.31 KB
/
IntegrationTests.kt
File metadata and controls
138 lines (127 loc) · 5.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
package builds
import jetbrains.buildServer.configs.kotlin.BuildStep
import jetbrains.buildServer.configs.kotlin.BuildType
import jetbrains.buildServer.configs.kotlin.buildFeatures.buildCache
import jetbrains.buildServer.configs.kotlin.buildSteps.MavenBuildStep
import jetbrains.buildServer.configs.kotlin.buildSteps.ScriptBuildStep
import jetbrains.buildServer.configs.kotlin.buildSteps.maven
import jetbrains.buildServer.configs.kotlin.buildSteps.script
import jetbrains.buildServer.configs.kotlin.toId
class IntegrationTests(
id: String,
name: String,
javaVersion: JavaVersion,
confluentPlatformVersion: String,
neo4jVersion: Neo4jVersion,
init: BuildType.() -> Unit
) :
BuildType(
{
this.id(id.toId())
this.name = name
init()
artifactRules =
"""
+:diagnostics => diagnostics.zip
"""
.trimIndent()
params {
text("env.BROKER_EXTERNAL_HOST", "broker:29092")
text("env.SCHEMA_CONTROL_REGISTRY_URI", "http://schema-registry:8081")
text("env.SCHEMA_CONTROL_REGISTRY_EXTERNAL_URI", "http://schema-registry:8081")
text("env.KAFKA_CONNECT_EXTERNAL_URI", "http://connect:8083")
text("env.NEO4J_URI", "neo4j://neo4j")
text("env.NEO4J_EXTERNAL_URI", "neo4j://neo4j")
text("env.NEO4J_USER", "neo4j")
text("env.NEO4J_PASSWORD", "password")
text("env.CONFLUENT_PLATFORM_VERSION", confluentPlatformVersion)
text("env.NEO4J_TEST_IMAGE", neo4jVersion.dockerImage)
}
steps {
if (neo4jVersion != Neo4jVersion.V_NONE) {
pullImage(neo4jVersion)
}
script {
scriptContent =
"""
#!/bin/bash -eu
# TODO: publish custom image instead
apt-get update
apt-get install --yes ruby-full ruby-bundler build-essential
bundle install
curl -fsSL https://get.docker.com | sh
dip compose up -d neo4j zookeeper broker schema-registry control-center
until [ "`docker inspect -f {{.State.Health.Status}} control-center`"=="healthy" ]; do
sleep 0.1;
done;
"""
.trimIndent()
formatStderrAsError = true
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
dockerImage = javaVersion.dockerImage
dockerRunParameters = "--volume /var/run/docker.sock:/var/run/docker.sock"
}
maven {
this.goals = "verify"
this.runnerArgs =
"$MAVEN_DEFAULT_ARGS -Djava.version=${javaVersion.version} -DskipUnitTests"
// this is the settings name we uploaded to Connectors project
userSettingsSelection = "github"
localRepoScope = MavenBuildStep.RepositoryScope.MAVEN_DEFAULT
dockerImagePlatform = MavenBuildStep.ImagePlatform.Linux
dockerImage = javaVersion.dockerImage
dockerRunParameters =
"--volume /var/run/docker.sock:/var/run/docker.sock --network neo4j-kafka-connector_default"
}
script {
scriptContent =
"""
#!/bin/bash -eu
# TODO: publish custom image instead
apt-get update
apt-get install --yes ruby-full ruby-bundler build-essential
bundle install
curl -fsSL https://get.docker.com | sh
mkdir diagnostics
dip compose cp neo4j:/data diagnostics/data
dip compose cp neo4j:/logs diagnostics/logs
dip compose logs --no-color > ./diagnostics/docker-compose.logs
"""
.trimIndent()
formatStderrAsError = true
executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
dockerImage = javaVersion.dockerImage
dockerRunParameters = "--volume /var/run/docker.sock:/var/run/docker.sock"
}
script {
scriptContent =
"""
#!/bin/bash -eu
# TODO: publish custom image instead
apt-get update
apt-get install --yes ruby-full ruby-bundler build-essential
bundle install
curl -fsSL https://get.docker.com | sh
dip compose down --rmi local
"""
.trimIndent()
formatStderrAsError = true
executionMode = BuildStep.ExecutionMode.ALWAYS
dockerImagePlatform = ScriptBuildStep.ImagePlatform.Linux
dockerImage = javaVersion.dockerImage
dockerRunParameters = "--volume /var/run/docker.sock:/var/run/docker.sock"
}
}
features {
buildCache {
this.name = "neo4j-kafka-connector"
publish = true
use = true
publishOnlyChanged = true
rules = ".m2/repository"
}
}
requirements { runOnLinux(LinuxSize.LARGE) }
},
)