diff --git a/.github/workflows/pipeline.yaml b/.github/workflows/pipeline.yaml index c22ab4eb..42792dcf 100644 --- a/.github/workflows/pipeline.yaml +++ b/.github/workflows/pipeline.yaml @@ -9,6 +9,8 @@ on: jobs: test: uses: ./.github/workflows/test.yaml + with: + agent_enabled: true build: permissions: contents: read diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2d1019c9..2c039a4e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -2,6 +2,12 @@ on: workflow_call: + inputs: + agent_enabled: + description: "Enable agent" + required: false + default: false + type: boolean jobs: test: @@ -20,7 +26,7 @@ jobs: - uses: gradle/actions/setup-gradle@v5 - - run: ./gradlew -Pagent test --no-daemon --info --fail-fast + - run: ./gradlew ${{ inputs.agent_enabled && '-Pagent' || '' }} test --no-daemon --info --fail-fast - uses: actions/upload-artifact@v5 with: diff --git a/build.gradle.kts b/build.gradle.kts index 4d59fb1d..7f633b73 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - val kotlinVersion = "2.2.21" + val kotlinVersion = "2.3.0-RC" kotlin("jvm") version kotlinVersion kotlin("plugin.serialization") version kotlinVersion @@ -14,7 +14,7 @@ group = "cash.atto" java { toolchain { - languageVersion = JavaLanguageVersion.of(21) + languageVersion = JavaLanguageVersion.of(25) } } @@ -122,7 +122,7 @@ dependencies { tasks.withType { useJUnitPlatform() - maxHeapSize = "2g" + maxHeapSize = "4g" } ktlint { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 1b33c55b..f8e1ee31 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e111328..23449a2b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index 23d15a93..adff685a 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" diff --git a/gradlew.bat b/gradlew.bat index db3a6ac2..c4bdd3ab 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -70,11 +70,10 @@ goto fail :execute @rem Setup the command line -set CLASSPATH= @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* :end @rem End local scope for the variables with windows NT shell diff --git a/src/main/resources/application-default.yaml b/src/main/resources/application-default.yaml index 1188ac3a..a34beeb7 100644 --- a/src/main/resources/application-default.yaml +++ b/src/main/resources/application-default.yaml @@ -7,6 +7,10 @@ spring: url: jdbc:mysql://${ATTO_DB_HOST:localhost}:${ATTO_DB_PORT:3306}/${ATTO_DB_NAME:atto} user: ${ATTO_DB_USER:root} password: ${ATTO_DB_PASSWORD:} + web: + error: + include-message: ALWAYS + include-stacktrace: ALWAYS atto: node: @@ -14,14 +18,6 @@ atto: force-historical: true network: LOCAL public-uri: ws://localhost:${websocket.port} - network: - broadcaster: - cache-expiration-time-in-seconds: 0 - -server: - error: - include-message: ALWAYS - include-stacktrace: ALWAYS logging: level: diff --git a/src/test/kotlin/cash/atto/node/CucumberTest.kt b/src/test/kotlin/cash/atto/node/CucumberTest.kt index 3251f0f4..5e53f0be 100644 --- a/src/test/kotlin/cash/atto/node/CucumberTest.kt +++ b/src/test/kotlin/cash/atto/node/CucumberTest.kt @@ -1,10 +1,10 @@ package cash.atto.node import org.junit.platform.suite.api.IncludeEngines -import org.junit.platform.suite.api.SelectClasspathResource +import org.junit.platform.suite.api.SelectPackages import org.junit.platform.suite.api.Suite @Suite @IncludeEngines("cucumber") -@SelectClasspathResource("features") +@SelectPackages("features") class CucumberTest diff --git a/src/test/kotlin/cash/atto/node/NodeStepDefinition.kt b/src/test/kotlin/cash/atto/node/NodeStepDefinition.kt index 2e9c98d2..eaf2c2d5 100644 --- a/src/test/kotlin/cash/atto/node/NodeStepDefinition.kt +++ b/src/test/kotlin/cash/atto/node/NodeStepDefinition.kt @@ -29,8 +29,9 @@ class NodeStepDefinition( val nodeName = "Node $shortId" val starter = Runnable { - val websocketPort = randomPort() - val httpPort = randomPort() + val ports = randomPorts() + val websocketPort = ports[0] + val httpPort = ports[1] val classLoader = Thread.currentThread().contextClassLoader val applicationClass = arrayOf(classLoader.loadClass(Application::class.java.canonicalName)) @@ -105,11 +106,11 @@ class NodeStepDefinition( networkProperties.defaultNodes.add("ws://localhost:${neighbour.websocketPort}") } - private fun randomPort(): UShort { - val socket = ServerSocket(0) - val port = socket.localPort - socket.close() - return port.toUShort() + private fun randomPorts(count: Int = 2): List { + val sockets = (0 until count).map { ServerSocket(0) } + val ports = sockets.map { it.localPort.toUShort() } + sockets.forEach { it.close() } + return ports } private fun createClassLoader(): URLClassLoader { diff --git a/src/test/resources/application-default.yaml b/src/test/resources/application-default.yaml index 3b73aec8..8aa0971d 100644 --- a/src/test/resources/application-default.yaml +++ b/src/test/resources/application-default.yaml @@ -7,6 +7,10 @@ spring: url: user: password: + web: + error: + include-message: ALWAYS + include-stacktrace: ALWAYS atto: transaction: @@ -21,11 +25,6 @@ atto: network: LOCAL public-uri: ws://localhost:${websocket.port} -server: - error: - include-message: ALWAYS - include-stacktrace: ALWAYS - logging: level: cash.atto: INFO