-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix some gradle configuration #247
Changes from 6 commits
0035af9
89550f6
cf3cbfe
55ed2ef
bf860d4
d1508d7
80d88fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,78 +73,83 @@ tasks { | |
} | ||
} | ||
|
||
register<Test>("testAlwaysSuspending") { | ||
environment = | ||
environment + | ||
baseRestateEnvironment(name) + | ||
mapOf("RESTATE_WORKER__INVOKER__INACTIVITY_TIMEOUT" to "0s") | ||
|
||
useJUnitPlatform { | ||
// Run all the tests with always-suspending or only-always-suspending tag | ||
includeTags("always-suspending | only-always-suspending") | ||
} | ||
// Increase a bit the default timeout | ||
systemProperties["junit.jupiter.execution.timeout.testable.method.default"] = "30 s" | ||
} | ||
|
||
register<Test>("testSingleThreadSinglePartition") { | ||
environment = | ||
environment + | ||
baseRestateEnvironment(name) + | ||
mapOf( | ||
"RESTATE_WORKER__PARTITIONS" to "1", | ||
"RESTATE_TOKIO_RUNTIME__WORKER_THREADS" to "1", | ||
"RESTATE_TOKIO_RUNTIME__MAX_BLOCKING_THREADS" to "1", | ||
) | ||
|
||
useJUnitPlatform { | ||
// Run all the tests with either no tags, or always-suspending tag | ||
includeTags("none() | always-suspending") | ||
} | ||
// Increase a bit the default timeout | ||
systemProperties["junit.jupiter.execution.timeout.testable.method.default"] = "30 s" | ||
} | ||
|
||
register<Test>("testLazyState") { | ||
environment = | ||
environment + | ||
baseRestateEnvironment(name) + | ||
mapOf( | ||
"RESTATE_WORKER__INVOKER__DISABLE_EAGER_STATE" to "true", | ||
) | ||
|
||
useJUnitPlatform { | ||
// Run all the tests with either no tags, or always-suspending tag | ||
includeTags("lazy-state") | ||
} | ||
} | ||
|
||
register<Test>("testPersistedTimers") { | ||
environment = | ||
environment + | ||
baseRestateEnvironment(name) + | ||
mapOf("RESTATE_WORKER__TIMERS__NUM_TIMERS_IN_MEMORY_LIMIT" to "1") | ||
|
||
useJUnitPlatform { | ||
// Run all the tests with always-suspending or only-always-suspending tag | ||
includeTags("timers") | ||
} | ||
// Increase a bit the default timeout | ||
systemProperties["junit.jupiter.execution.timeout.testable.method.default"] = "20 s" | ||
} | ||
|
||
val testAlwaysSuspending by | ||
registering(Test::class) { | ||
environment = | ||
environment + | ||
baseRestateEnvironment(name) + | ||
mapOf("RESTATE_WORKER__INVOKER__INACTIVITY_TIMEOUT" to "0s") | ||
|
||
useJUnitPlatform { | ||
// Run all the tests with always-suspending or only-always-suspending tag | ||
includeTags("always-suspending | only-always-suspending") | ||
} | ||
// Increase a bit the default timeout | ||
systemProperties["junit.jupiter.execution.timeout.testable.method.default"] = "30 s" | ||
} | ||
|
||
val testSingleThreadSinglePartition by | ||
registering(Test::class) { | ||
environment = | ||
environment + | ||
baseRestateEnvironment(name) + | ||
mapOf( | ||
"RESTATE_WORKER__PARTITIONS" to "1", | ||
"RESTATE_TOKIO_RUNTIME__WORKER_THREADS" to "1", | ||
"RESTATE_TOKIO_RUNTIME__MAX_BLOCKING_THREADS" to "1", | ||
) | ||
|
||
useJUnitPlatform { | ||
// Run all the tests with either no tags, or always-suspending tag | ||
includeTags("none() | always-suspending") | ||
} | ||
// Increase a bit the default timeout | ||
systemProperties["junit.jupiter.execution.timeout.testable.method.default"] = "30 s" | ||
} | ||
|
||
val testLazyState by | ||
registering(Test::class) { | ||
environment = | ||
environment + | ||
baseRestateEnvironment(name) + | ||
mapOf( | ||
"RESTATE_WORKER__INVOKER__DISABLE_EAGER_STATE" to "true", | ||
) | ||
|
||
useJUnitPlatform { | ||
// Run all the tests with either no tags, or always-suspending tag | ||
includeTags("lazy-state") | ||
} | ||
} | ||
|
||
val testPersistedTimers by | ||
registering(Test::class) { | ||
environment = | ||
environment + | ||
baseRestateEnvironment(name) + | ||
mapOf("RESTATE_WORKER__TIMERS__NUM_TIMERS_IN_MEMORY_LIMIT" to "1") | ||
|
||
useJUnitPlatform { | ||
// Run all the tests with always-suspending or only-always-suspending tag | ||
includeTags("timers") | ||
} | ||
// Increase a bit the default timeout | ||
systemProperties["junit.jupiter.execution.timeout.testable.method.default"] = "20 s" | ||
} | ||
|
||
// Common configuration for all test tasks | ||
withType<Test>().configureEach { | ||
dependsOn(":services:http-server:jibDockerBuild") | ||
dependsOn(":services:java-services:jibDockerBuild") | ||
dependsOn(":services:node-services:dockerBuild") | ||
|
||
maxParallelForks = 3 | ||
} | ||
} | ||
|
||
tasks.named("check") { | ||
dependsOn("testAlwaysSuspending") | ||
dependsOn("testSingleThreadSinglePartition") | ||
dependsOn("testPersistedTimers") | ||
dependsOn("testLazyState") | ||
check { | ||
dependsOn(testAlwaysSuspending) | ||
dependsOn(testSingleThreadSinglePartition) | ||
dependsOn(testPersistedTimers) | ||
dependsOn(testLazyState) | ||
} | ||
Comment on lines
+149
to
+154
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, really cool. Now it is actually possible to run individually tests via There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't notice that I fixed that as well 🤣 |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
toolchain
thing fixes to a specific java version, which causes #237. Using source/target compatibility should work with any sdk version >= 17There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried now to enable the auto jvm download in the last commit, it sounds like a useful feature. I wonder though if it works on NixOS, perhaps @igalshilman give this a try to see if your machine likes it :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works like magic 🪄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm that it works on my machine as well. Thanks @slinkydeveloper for working your magic on this ❤️