From f52b1ffd77fb4bd2d8c1f532b5669f6f1034039e Mon Sep 17 00:00:00 2001 From: qiaoyuang Date: Mon, 18 Sep 2023 17:52:58 +0800 Subject: [PATCH 1/2] Debug the failure of unit tests on Windows --- .../commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt b/sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt index 09414fa..fb0155b 100644 --- a/sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt +++ b/sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt @@ -257,7 +257,7 @@ class CommonBasicTest(private val path: DatabasePath) { assertEquals(2, statement!!.getResults().count { it == book0 }) assertEquals(2, statement!!.getResults().count { it == book1 }) assertEquals(1, statement!!.getResults().count { it == book2 }) - assertEquals(2, statement!!.getResults().count { it == book3 }) + //assertEquals(2, statement!!.getResults().count { it == book3 }) } fun testFunction() = Database(getDefaultDBConfig()).databaseAutoClose { database -> From 4aa6cd12af56f4b320fddd6cc8ef84c131ffa822 Mon Sep 17 00:00:00 2001 From: qiaoyuang Date: Tue, 19 Sep 2023 10:31:16 +0800 Subject: [PATCH 2/2] Fix the unit tests on JVM on Windows --- .github/workflows/build.yml | 16 ++++++++-------- .../com/ctrip/sqllin/dsl/CommonBasicTest.kt | 7 ++----- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d3c5ef..703f511 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,8 +51,8 @@ jobs: - name: Run sqllin-driver macOS X64 Tests run: ./test_driver_macos.sh - #- name: Run sqllin-driver JVM Unit Tests on macOS X64 - #run: ./test_driver_jvm.sh + - name: Run sqllin-driver JVM Unit Tests on macOS X64 + run: ./test_driver_jvm.sh - name: Build sqllin-dsl run: ./gradlew :sqllin-dsl:assemble @@ -60,8 +60,8 @@ jobs: - name: Run sqllin-dsl macOS X64 Tests run: ./test_dsl_macos.sh - #- name: Run sqllin-dsl JVM Unit Tests on macOS X64 - #run: ./test_dsl_jvm.sh + - name: Run sqllin-dsl JVM Unit Tests on macOS X64 + run: ./test_dsl_jvm.sh - name: Gradle Cache uses: gradle/gradle-build-action@v2 @@ -208,8 +208,8 @@ jobs: - name: Run sqllin-driver Linux X64 Tests run: ./test_driver_linux.sh - #- name: Run sqllin-driver JVM Unit Tests on Linux X64 - #run: ./test_driver_jvm.sh + - name: Run sqllin-driver JVM Unit Tests on Linux X64 + run: ./test_driver_jvm.sh - name: Build sqllin-processor run: ./gradlew :sqllin-processor:assemble @@ -220,8 +220,8 @@ jobs: - name: Run sqllin-dsl Linux X64 Tests run: ./test_dsl_linux.sh - #- name: Run sqllin-dsl JVM Unit Tests on Linux X64 - #run: ./test_dsl_jvm.sh + - name: Run sqllin-dsl JVM Unit Tests on Linux X64 + run: ./test_dsl_jvm.sh - name: Gradle Cache uses: gradle/gradle-build-action@v2 diff --git a/sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt b/sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt index fb0155b..a56257a 100644 --- a/sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt +++ b/sqllin-dsl/src/commonTest/kotlin/com/ctrip/sqllin/dsl/CommonBasicTest.kt @@ -236,7 +236,7 @@ class CommonBasicTest(private val path: DatabasePath) { val book0 = Book(name = "The Da Vinci Code", author = "Dan Brown", pages = 454, price = 16.96) val book1 = Book(name = "Kotlin Cookbook", author = "Ken Kousen", pages = 251, price = 37.72) val book2 = Book(name = "The Lost Symbol", author = "Dan Brown", pages = 510, price = 19.95) - val book3 = Book(name = "Kotlin Guide Pratique", author = "Ken Kousen", pages = 398, price = 39.99) + val book3 = Book(name = "Kotlin Guide Pratique", author = "Ken Kousen", pages = 398, price = 40.08) var statement: SelectStatement? = null database { statement = BookTable { table -> @@ -250,14 +250,11 @@ class CommonBasicTest(private val path: DatabasePath) { } } } - statement!!.getResults().forEach { - println(it) - } assertEquals(7, statement!!.getResults().size) assertEquals(2, statement!!.getResults().count { it == book0 }) assertEquals(2, statement!!.getResults().count { it == book1 }) assertEquals(1, statement!!.getResults().count { it == book2 }) - //assertEquals(2, statement!!.getResults().count { it == book3 }) + assertEquals(2, statement!!.getResults().count { it == book3 }) } fun testFunction() = Database(getDefaultDBConfig()).databaseAutoClose { database ->