Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .teamcity/builds/Build.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ val DEFAULT_NEO4J_VERSION = Neo4jVersion.V_2025
class Build(
name: String,
forPullRequests: Boolean,
forCompatibility: Boolean = false,
neo4jVersion: Neo4jVersion = DEFAULT_NEO4J_VERSION,
customizeCompletion: BuildType.() -> Unit = {}
) :
Expand All @@ -44,7 +45,7 @@ class Build(
"package (${java.javaVersion.version})",
"package",
java.javaVersion,
neo4jVersion,
Neo4jVersion.V_NONE,
"-pl :packaging -am -DskipTests",
)

Expand All @@ -55,7 +56,7 @@ class Build(
"build (${java.javaVersion.version})",
"test-compile",
java.javaVersion,
neo4jVersion,
Neo4jVersion.V_NONE,
),
)
dependentBuildType(
Expand Down Expand Up @@ -98,7 +99,7 @@ class Build(
}

dependentBuildType(complete)
if (!forPullRequests)
if (!forPullRequests && !forCompatibility)
dependentBuildType(Release("${name}-release", "release", DEFAULT_JAVA_VERSION))
}

Expand All @@ -108,7 +109,7 @@ class Build(
it.features {
loginToECR()
requireDiskSpace("5gb")
enableCommitStatusPublisher()
if (!forCompatibility) enableCommitStatusPublisher()
if (forPullRequests) enablePullRequests()
}

Expand Down
12 changes: 12 additions & 0 deletions .teamcity/builds/Common.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import jetbrains.buildServer.configs.kotlin.buildFeatures.commitStatusPublisher
import jetbrains.buildServer.configs.kotlin.buildFeatures.dockerRegistryConnections
import jetbrains.buildServer.configs.kotlin.buildFeatures.freeDiskSpace
import jetbrains.buildServer.configs.kotlin.buildFeatures.pullRequests
import jetbrains.buildServer.configs.kotlin.buildSteps.DockerCommandStep
import jetbrains.buildServer.configs.kotlin.buildSteps.MavenBuildStep
import jetbrains.buildServer.configs.kotlin.buildSteps.dockerCommand
import jetbrains.buildServer.configs.kotlin.buildSteps.maven
import jetbrains.buildServer.configs.kotlin.vcs.GitVcsRoot

Expand Down Expand Up @@ -41,6 +43,7 @@ enum class JavaVersion(val version: String, val dockerImage: String) {
}

enum class Neo4jVersion(val version: String, val dockerImage: String) {
V_NONE("", ""),
V_4_4("4.4", "neo4j:4.4-enterprise"),
V_4_4_DEV(
"4.4-dev",
Expand Down Expand Up @@ -140,3 +143,12 @@ fun BuildSteps.commonMaven(
init(maven)
return maven
}

fun BuildSteps.pullImage(version: Neo4jVersion): DockerCommandStep =
this.dockerCommand {
name = "pull neo4j test image"
commandType = other {
subCommand = "image"
commandArgs = "pull ${version.dockerImage}"
}
}
4 changes: 4 additions & 0 deletions .teamcity/builds/IntegrationTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class IntegrationTests(
}

steps {
if (neo4jVersion != Neo4jVersion.V_NONE) {
pullImage(neo4jVersion)
}

script {
scriptContent =
"""
Expand Down
6 changes: 5 additions & 1 deletion .teamcity/builds/Maven.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Maven(
name: String,
goals: String,
javaVersion: JavaVersion,
neo4jVersion: Neo4jVersion = DEFAULT_NEO4J_VERSION,
neo4jVersion: Neo4jVersion,
args: String? = null
) :
BuildType({
Expand All @@ -22,6 +22,10 @@ class Maven(
}

steps {
if (neo4jVersion != Neo4jVersion.V_NONE) {
pullImage(neo4jVersion)
}

commonMaven(javaVersion) {
this.goals = goals
this.runnerArgs =
Expand Down
58 changes: 32 additions & 26 deletions .teamcity/settings.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,38 +45,44 @@ project {
this.id("compatibility")
name = "compatibility"

Neo4jVersion.entries.forEach { neo4j ->
Neo4jVersion.entries.minus(Neo4jVersion.V_NONE).forEach { neo4j ->
subProject(
Build(name = "${neo4j.version}", forPullRequests = false, neo4jVersion = neo4j) {
triggers {
vcs { enabled = false }
Build(
name = "${neo4j.version}",
forPullRequests = false,
forCompatibility = true,
neo4jVersion = neo4j) {
triggers {
vcs { enabled = false }

schedule {
branchFilter = "+:main"
schedulingPolicy = daily {
hour = 8
minute = 0
schedule {
branchFilter = "+:main"
schedulingPolicy = daily {
hour = 8
minute = 0
}
triggerBuild = always()
}
}
triggerBuild = always()
}
}

features {
notifications {
buildFailedToStart = true
buildFailed = true
firstFailureAfterSuccess = true
firstSuccessAfterFailure = true
buildProbablyHanging = true
features {
notifications {
buildFailedToStart = true
buildFailed = true
firstFailureAfterSuccess = true
firstSuccessAfterFailure = true
buildProbablyHanging = true

notifierSettings = slackNotifier {
connection = SLACK_CONNECTION_ID
sendTo = SLACK_CHANNEL
messageFormat = simpleMessageFormat()
branchFilter = "+:main"

notifierSettings = slackNotifier {
connection = SLACK_CONNECTION_ID
sendTo = SLACK_CHANNEL
messageFormat = simpleMessageFormat()
}
}
}
}
}
})
})
}
})
}
5 changes: 5 additions & 0 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@
<artifactId>mockito-kotlin</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class TypesTest {
val neo4j: Neo4jContainer<*> =
Neo4jContainer(neo4jImage())
.withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT", "yes")
.withExposedPorts(7687)
.withoutAuthentication()

private lateinit var driver: Driver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Neo4jCdcTaskTest {
val container: Neo4jContainer<*> =
Neo4jContainer(neo4jImage())
.withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT", "yes")
.withExposedPorts(7687)
.withoutAuthentication()

private lateinit var driver: Driver
Expand All @@ -88,8 +89,8 @@ class Neo4jCdcTaskTest {

@AfterEach
fun after() {
session.close()
task.stop()
if (this::session.isInitialized) session.close()
if (this::task.isInitialized) task.stop()
}

@BeforeEach
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Neo4jQueryTaskTest {
val neo4j: Neo4jContainer<*> =
Neo4jContainer(neo4jImage())
.withEnv("NEO4J_ACCEPT_LICENSE_AGREEMENT", "yes")
.withExposedPorts(7687)
.withoutAuthentication()

private lateinit var driver: Driver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ object DatabaseSupport {
if (database == DEFAULT_DATABASE) {
return this
}
this.run(
"CREATE DATABASE \$db_name OPTIONS { txLogEnrichment: '${if (withCdc) { "FULL" } else "OFF"}' } WAIT 30 SECONDS",
mapOf("db_name" to database))
if (withCdc) {
this.run(
"CREATE DATABASE \$db_name OPTIONS { txLogEnrichment: 'FULL' } WAIT 30 SECONDS",
mapOf("db_name" to database))
} else {
this.run("CREATE DATABASE \$db_name WAIT 30 SECONDS", mapOf("db_name" to database))
}
return this
}

Expand Down