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
2 changes: 2 additions & 0 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
jobs:
test:
uses: ./.github/workflows/test.yaml
with:
agent_enabled: true
build:
permissions:
contents: read
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

on:
workflow_call:
inputs:
agent_enabled:
description: "Enable agent"
required: false
default: false
type: boolean

jobs:
test:
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -14,7 +14,7 @@ group = "cash.atto"

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(25)
}
}

Expand Down Expand Up @@ -122,7 +122,7 @@ dependencies {

tasks.withType<Test> {
useJUnitPlatform()
maxHeapSize = "2g"
maxHeapSize = "4g"
}

ktlint {
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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-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
Expand Down
5 changes: 1 addition & 4 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions src/main/resources/application-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,17 @@ 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:
force-voter: true
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:
Expand Down
4 changes: 2 additions & 2 deletions src/test/kotlin/cash/atto/node/CucumberTest.kt
Original file line number Diff line number Diff line change
@@ -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
15 changes: 8 additions & 7 deletions src/test/kotlin/cash/atto/node/NodeStepDefinition.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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<UShort> {
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 {
Expand Down
9 changes: 4 additions & 5 deletions src/test/resources/application-default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ spring:
url:
user:
password:
web:
error:
include-message: ALWAYS
include-stacktrace: ALWAYS

atto:
transaction:
Expand All @@ -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
Expand Down
Loading