From 732b3b25d9f965bf4d8d6fd9de6554aed0b3b8f7 Mon Sep 17 00:00:00 2001 From: Lukas Cardot Date: Mon, 2 Sep 2024 17:12:05 -0400 Subject: [PATCH 1/2] upgrade mssql docker image 2017-latest does not work correctly on arm processors --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/snapshot.yml | 2 +- README.md | 1 - docker-compose.yml | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb4699a..ea0f50c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: --health-retries 10 mssql: - image: mcr.microsoft.com/mssql/server:2017-latest + image: mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04 env: ACCEPT_EULA: Y MSSQL_PID: Express diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d44e390..bd124bd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: --health-retries 10 mssql: - image: mcr.microsoft.com/mssql/server:2017-latest + image: mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04 env: ACCEPT_EULA: Y MSSQL_PID: Express diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml index 4699284..95c7def 100644 --- a/.github/workflows/snapshot.yml +++ b/.github/workflows/snapshot.yml @@ -23,7 +23,7 @@ jobs: --health-retries 10 mssql: - image: mcr.microsoft.com/mssql/server:2017-latest + image: mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04 env: ACCEPT_EULA: Y MSSQL_PID: Express diff --git a/README.md b/README.md index 9dc6858..4c1d324 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ Some tests require that the database container is running. To start the containe ````bash docker compose up -d ```` -Note: Currently, the MSSQL Docker image (`mcr.microsoft.com/mssql/server`) is not supported for the ARM64 platform. However, you can work around this limitation using the method described in this post: [https://github.com/microsoft/mssql-docker/issues/668#issuecomment-1436802153](https://github.com/microsoft/mssql-docker/issues/668#issuecomment-1436802153) ## Quick Start diff --git a/docker-compose.yml b/docker-compose.yml index d4068c0..0671fc8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,7 +2,7 @@ version: '3.8' services: mssql: - image: mcr.microsoft.com/mssql/server:2017-latest + image: mcr.microsoft.com/mssql/server:2019-CU27-ubuntu-20.04 command: /bin/bash ./entrypoint.sh ports: - '1433:1433' From f84e9ca09457a6c524c953de3a4adb1b34513924 Mon Sep 17 00:00:00 2001 From: Lukas Cardot Date: Mon, 2 Sep 2024 17:13:53 -0400 Subject: [PATCH 2/2] upgrade dependencies --- gradle/libs.versions.toml | 40 +++++++++---------- jcv-db-cassandra/build.gradle.kts | 3 +- .../oss/jcv/db/DbComparatorAssertTest.kt | 23 ++++++----- .../com/ekino/oss/jcv/db/ValidatorsTest.kt | 31 ++++++++------ jcv-db-jdbc/build.gradle.kts | 2 - .../ekino/oss/jcv/db/mongo/ValidatorsTest.kt | 14 ++++--- 6 files changed, 57 insertions(+), 56 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f134249..09e57f5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,25 +1,22 @@ [versions] jcv-core = "1.5.0" -jsonassert = "1.5.0" -postgres = "42.5.0" +jsonassert = "1.5.3" +postgres = "42.7.4" mssql = "11.2.0.jre11" -mysql = "8.0.29" -junit = "5.9.0" -assertj-core = "3.24.2" +mysql = "8.4.0" +junit = "5.11.0" +assertj-core = "3.26.3" assertj-db = "2.0.2" -kotlin-jvm = "1.8.10" -dokka = "1.7.10" +kotlin-jvm = "1.9.25" +dokka = "1.9.20" researchgate-release = "3.0.2" kotlin-quality = "4.2.0" -java-driver-core = "4.15.0" -java-driver-query-builder = "4.17.0" -jackson-databind = "2.15.3" -jts-core = "1.19.0" -assertk-jvm = "0.25" -spring-jdbc = "5.3.23" -mongodb-driver = "4.9.0" - +cassandra-driver = "4.18.1" +jackson-databind = "2.17.2" +jts-core = "1.20.0" +assertk-jvm = "0.28.1" +mongodb-driver = "4.11.3" [libraries] @@ -29,20 +26,19 @@ jcv-core = { module = "com.ekino.oss.jcv:jcv-core", version.ref = "jcv-core" } jsonassert = { module = "org.skyscreamer:jsonassert", version.ref= "jsonassert" } assertj-core = { module = "org.assertj:assertj-core", version.ref = "assertj-core" } assertj-db = { module = "org.assertj:assertj-db", version.ref = "assertj-db" } +assertk-jvm = { module = "com.willowtreeapps.assertk:assertk-jvm", version.ref = "assertk-jvm" } +junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" } postgres = { module = "org.postgresql:postgresql", version.ref = "postgres" } mssql-jdbc = { module = "com.microsoft.sqlserver:mssql-jdbc", version.ref = "mssql" } -mysql-connector-java = { module = "mysql:mysql-connector-java", version.ref = "mysql" } -junit = { module = "org.junit.jupiter:junit-jupiter", version.ref = "junit" } -java-driver-core = { module = "com.datastax.oss:java-driver-core", version.ref = "java-driver-core" } -java-driver-query-builder = { module = "com.datastax.oss:java-driver-query-builder", version.ref = "java-driver-query-builder" } +mysql-connector-java = { module = "com.mysql:mysql-connector-j", version.ref = "mysql" } +cassandra-driver-core = { module = "org.apache.cassandra:java-driver-core", version.ref = "cassandra-driver" } +cassandra-query-builder = { module = "org.apache.cassandra:java-driver-query-builder", version.ref = "cassandra-driver" } jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson-databind" } jts-core = { module = "org.locationtech.jts:jts-core", version.ref = "jts-core" } -assertk-jvm = { module = "com.willowtreeapps.assertk:assertk-jvm", version.ref = "assertk-jvm" } -spring-jdbc = { module = "org.springframework:spring-jdbc", version.ref = "spring-jdbc" } mongodb-driver = { module = "org.mongodb:mongodb-driver-sync", version.ref = "mongodb-driver" } [bundles] - +cassandra-driver = ["cassandra-driver-core", "cassandra-query-builder"] [plugins] diff --git a/jcv-db-cassandra/build.gradle.kts b/jcv-db-cassandra/build.gradle.kts index 917d2c7..4acd5a2 100644 --- a/jcv-db-cassandra/build.gradle.kts +++ b/jcv-db-cassandra/build.gradle.kts @@ -76,8 +76,7 @@ dependencies { implementation(libs.kotlin.stdlib) implementation(libs.jcv.core) implementation(libs.jsonassert) - implementation(libs.java.driver.core) - implementation(libs.java.driver.query.builder) + implementation(libs.bundles.cassandra.driver) testImplementation(libs.junit) } diff --git a/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/DbComparatorAssertTest.kt b/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/DbComparatorAssertTest.kt index e450e6c..68c92ca 100644 --- a/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/DbComparatorAssertTest.kt +++ b/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/DbComparatorAssertTest.kt @@ -1,8 +1,7 @@ package com.ekino.oss.jcv.db -import assertk.assertThat +import assertk.assertFailure import assertk.assertions.hasMessage -import assertk.assertions.isFailure import com.ekino.oss.jcv.db.model.RowModel import com.ekino.oss.jcv.db.model.TableModel import org.json.JSONArray @@ -102,16 +101,18 @@ class DbComparatorAssertTest { ) ) - assertThat { + assertFailure { DbComparatorAssert.assertThatTableModel(tableModel).isValidAgainst(expected) - }.isFailure().hasMessage( - """[content_test=abcd] -Expected: a JSON object - but none found - ; [content_test=abcde] -Unexpected: a JSON object - -Actual: [{"content_test":"abcde"}]""" + }.hasMessage( + """ + [content_test=abcd] + Expected: a JSON object + but none found + ; [content_test=abcde] + Unexpected: a JSON object + + Actual: [{"content_test":"abcde"}] + """.trimIndent() ) } } diff --git a/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/ValidatorsTest.kt b/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/ValidatorsTest.kt index 5c4a9e6..9f7d143 100644 --- a/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/ValidatorsTest.kt +++ b/jcv-db-core/src/test/kotlin/com/ekino/oss/jcv/db/ValidatorsTest.kt @@ -17,22 +17,27 @@ class ValidatorsTest { @Test fun `json object validator`() { - assertThat { - compare( - """{"field_name": {}}""", - """{"field_name": "{#json_object#}"}""" - ) - }.isSuccess() + assertThat( + runCatching { + compare( + """{"field_name": {}}""", + """{"field_name": "{#json_object#}"}""" + ) + } + ).isSuccess() } @Test fun `json array validator`() { - assertThat { - compare( - """{"field_name": []}""", - """{"field_name": "{#json_array#}"}""" - ) - }.isSuccess() + assertThat( + runCatching { + compare( + """{"field_name": []}""", + """{"field_name": "{#json_array#}"}""" + ) + } + ) + .isSuccess() } @Test @@ -71,7 +76,7 @@ class ValidatorsTest { } } - private fun compare(actualJson: String, expectedJson: String, body: (JSONCompareResult) -> Unit = {}) = body.invoke( + private fun compare(actualJson: String, expectedJson: String, body: (JSONCompareResult) -> Unit = {}) = body( JSONCompare.compareJSON( expectedJson, actualJson, diff --git a/jcv-db-jdbc/build.gradle.kts b/jcv-db-jdbc/build.gradle.kts index 14d26dd..a470032 100644 --- a/jcv-db-jdbc/build.gradle.kts +++ b/jcv-db-jdbc/build.gradle.kts @@ -25,7 +25,6 @@ val javadocJar by tasks.registering(Jar::class) { from(layout.buildDirectory.file("dokka")) } - java { withSourcesJar() } @@ -81,7 +80,6 @@ dependencies { implementation(libs.postgres) implementation(libs.mssql.jdbc) implementation(libs.mysql.connector.java) - implementation(libs.spring.jdbc) implementation(libs.jackson.databind) testImplementation(libs.junit) diff --git a/jcv-db-mongo/src/test/kotlin/com/ekino/oss/jcv/db/mongo/ValidatorsTest.kt b/jcv-db-mongo/src/test/kotlin/com/ekino/oss/jcv/db/mongo/ValidatorsTest.kt index b8eaa71..2abe1be 100644 --- a/jcv-db-mongo/src/test/kotlin/com/ekino/oss/jcv/db/mongo/ValidatorsTest.kt +++ b/jcv-db-mongo/src/test/kotlin/com/ekino/oss/jcv/db/mongo/ValidatorsTest.kt @@ -17,12 +17,14 @@ class ValidatorsTest { @Test fun `mongo id validator`() { - assertThat { - compare( - """{"field_name": "5d8253faef748a2c0e53ebfd"}""", - """{"field_name": "{#mongo_id#}"}""" - ) - }.isSuccess() + assertThat( + runCatching { + compare( + """{"field_name": "5d8253faef748a2c0e53ebfd"}""", + """{"field_name": "{#mongo_id#}"}""" + ) + } + ).isSuccess() } @Test