Skip to content

Commit

Permalink
Upgrade dependencies and streamline test code
Browse files Browse the repository at this point in the history
Updated Gradle to version 8.10.1 and Testcontainers to 1.20.1. Also removed the license header from CallDetectionTest.kt and streamlined assertion syntax. Additionally, updated the build script to include JUnit runtime dependency and enabled multiple test engines.
  • Loading branch information
ng-galien committed Sep 14, 2024
1 parent 8677d73 commit 21cf50e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 25 deletions.
10 changes: 9 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ dependencies {
implementation(libs.arrowCore)
implementation(libs.arrowFxCoroutines)

// implementation("net.java.dev.jna:jna:6.1.6")

// Kotlin and logging
testImplementation(kotlin("test"))
testImplementation(kotlin("reflect"))
Expand All @@ -59,6 +61,7 @@ dependencies {
testImplementation(libs.jdbi3Testing)
// Guava
testImplementation(libs.guava)
testRuntimeOnly("junit:junit:4.13.2")

intellijPlatform {
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
Expand Down Expand Up @@ -161,9 +164,14 @@ tasks {
wrapper {
gradleVersion = providers.gradleProperty("gradleVersion").get()
}

publishPlugin {
dependsOn(patchChangelog)
}

test {
useJUnitPlatform {
includeEngines("junit-vintage", "junit-jupiter")
}
}
}

2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ platformPlugins =
platformBundledPlugins = com.intellij.database

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 8.6
gradleVersion = 8.10.1

# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
kotlin.stdlib.default.dependency = false
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ gradleIntelliJPlugin = "2.0.1"
qodana = "0.1.13"
kover = "0.7.6"
arrow = "1.2.4"
testcontainers = "1.19.8"
testcontainers = "1.20.1"
postgres = "42.7.3"
jbdi3 = "3.45.2"
logback = "1.5.6"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
27 changes: 6 additions & 21 deletions src/test/kotlin/net/plpgsql/ideadebugger/CallDetectionTest.kt
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
/*
* MIT License
*
* IntelliJ PL/pg SQL Debugger
*
* Copyright (c) 2022-2024. Alexandre Boyer.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

package net.plpgsql.ideadebugger

import com.intellij.sql.dialects.postgres.PgDialect
import com.intellij.sql.psi.SqlStatement
import com.intellij.testFramework.TestDataPath
import com.intellij.testFramework.fixtures.BasePlatformTestCase
import org.junit.Test
import org.junit.jupiter.api.Assertions
import org.junit.runner.RunWith
import org.junit.runners.Parameterized


@TestDataPath("\$CONTENT_ROOT/src/test/testData")
@TestDataPath("\$PROJECT_ROOT/src/test/testData")
@RunWith(Parameterized::class)
class CallDetectionTest(private val sql: String, private val expected: FunctionDef) : BasePlatformTestCase() {

Expand All @@ -49,10 +34,10 @@ class CallDetectionTest(private val sql: String, private val expected: FunctionD
val stmt = psiFile.children.first() as SqlStatement
val call = getCallStatement(stmt)
call.parseFunctionCall()
Assertions.assertNotNull(call)
Assertions.assertEquals(DebugMode.DIRECT, call.debugMode)
Assertions.assertEquals(expected.schema, call.schema)
Assertions.assertEquals(expected.routine, call.routine)
Assertions.assertEquals(expected.args, call.args)
assertNotNull(call)
assertEquals(DebugMode.DIRECT, call.debugMode)
assertEquals(expected.schema, call.schema)
assertEquals(expected.routine, call.routine)
assertEquals(expected.args, call.args)
}
}

0 comments on commit 21cf50e

Please sign in to comment.