chore(damn): detekt, build, tests, formatting

fixed detekt issues where possible.
fixed disttar failing build because tools is added twice in the server module.
added workflowId where required.
fixed some tests not being recognized because of runBlocking without explicit return type.
formatting + imports.
This commit is contained in:
2026-05-22 00:10:05 +04:00
parent 2c459da009
commit f827685ed0
185 changed files with 1134 additions and 832 deletions
@@ -32,4 +32,4 @@ object ConcurrencyRunner {
done.await()
executor.shutdown()
}
}
}
@@ -9,4 +9,4 @@ class DeterministicBarrier(parties: Int) {
fun await() {
barrier.await()
}
}
}
@@ -29,4 +29,4 @@ class StageIdTest {
assertEquals(a, b)
}
}
}
@@ -29,4 +29,4 @@ class TransitionIdTest {
assertEquals(a, b)
}
}
}
@@ -26,4 +26,4 @@ class ValidationReportContractTest {
assertEquals(r1, r2)
}
}
}
@@ -17,6 +17,7 @@ class WorkflowGraphTest {
@Test
fun `graph stores immutable structure`() {
val graph = WorkflowGraph(
id = "workflow-test",
stages = mapOf(s1 to StageConfig(), s2 to StageConfig()),
transitions = setOf(
TransitionEdge(
@@ -39,6 +40,7 @@ class WorkflowGraphTest {
val node = s1
val graph = WorkflowGraph(
id = "workflow-test",
stages = mapOf(node to StageConfig()),
transitions = emptySet(),
start = s1
@@ -51,12 +53,14 @@ class WorkflowGraphTest {
@Test
fun `graph equality is structural`() {
val g1 = WorkflowGraph(
id = "workflow-test",
stages = mapOf(s1 to StageConfig()),
transitions = emptySet(),
start = s1
)
val g2 = WorkflowGraph(
id = "workflow-test",
stages = mapOf(s1 to StageConfig()),
transitions = emptySet(),
start = s1
@@ -14,11 +14,15 @@ import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test
class EventsTest {
private val workflowId = "workflow-test"
@Test
fun `WorkflowStartedEvent survives round-trip`() {
val event: EventPayload = WorkflowStartedEvent(
sessionId = SessionId("s1"),
startStageId = StageId("stage-a"),
workflowId = workflowId,
)
val json = eventJson.encodeToString(EventPayload.serializer(), event)
@@ -33,6 +37,7 @@ class EventsTest {
sessionId = SessionId("s1"),
terminalStageId = StageId("stage-a"),
totalStages = 1,
workflowId = workflowId,
)
val json = eventJson.encodeToString(EventPayload.serializer(), event)
@@ -129,4 +134,4 @@ class EventsTest {
assertEquals(event, decoded)
}
}
}