Skip to content

Commit f8d5c18

Browse files
authored
Merge branch 'master' into shutdown-task-loss-fix
2 parents fe3a5f0 + 7a8e684 commit f8d5c18

32 files changed

Lines changed: 412 additions & 298 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,25 @@ jobs:
3232
- name: Run unit tests (Java 23)
3333
env:
3434
USER: unittest
35-
USE_DOCKER_SERVICE: false
35+
USE_EXTERNAL_SERVICE: false
3636
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -PtestJavaVersion=23
3737

3838
- name: Run independent resource tuner test
3939
env:
4040
USER: unittest
41-
USE_DOCKER_SERVICE: false
41+
USE_EXTERNAL_SERVICE: false
4242
run: ./gradlew --no-daemon temporal-sdk:testResourceIndependent -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -PtestJavaVersion=23
4343

4444
- name: Run Spring Boot 3 compatibility tests
4545
env:
4646
USER: unittest
47-
USE_DOCKER_SERVICE: false
47+
USE_EXTERNAL_SERVICE: false
4848
run: ./gradlew --no-daemon :temporal-spring-boot-autoconfigure:test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -P springBoot3Test -PtestJavaVersion=23
4949

5050
- name: Run Spring Boot 4 compatibility tests
5151
env:
5252
USER: unittest
53-
USE_DOCKER_SERVICE: false
53+
USE_EXTERNAL_SERVICE: false
5454
run: ./gradlew --no-daemon :temporal-spring-boot-autoconfigure:test -x spotlessCheck -x spotlessApply -x spotlessJava -P edgeDepsTest -P springBoot4Test -PtestJavaVersion=23
5555

5656
- name: Publish Test Report
@@ -125,20 +125,20 @@ jobs:
125125
env:
126126
USER: unittest
127127
TEMPORAL_SERVICE_ADDRESS: localhost:7233
128-
USE_DOCKER_SERVICE: true
128+
USE_EXTERNAL_SERVICE: true
129129
run: ./gradlew --no-daemon test -x spotlessCheck -x spotlessApply -x spotlessJava -PtestJavaVersion=11
130130

131131
- name: Run Jackson 3 converter tests (Java 17)
132132
env:
133133
USER: unittest
134-
USE_DOCKER_SERVICE: false
134+
USE_EXTERNAL_SERVICE: false
135135
run: ./gradlew --no-daemon :temporal-sdk:jackson3Tests -x spotlessCheck -x spotlessApply -x spotlessJava -PtestJavaVersion=17
136136

137137
- name: Run virtual thread tests (Java 21)
138138
env:
139139
USER: unittest
140140
TEMPORAL_SERVICE_ADDRESS: localhost:7233
141-
USE_DOCKER_SERVICE: true
141+
USE_EXTERNAL_SERVICE: true
142142
run: ./gradlew --no-daemon :temporal-sdk:virtualThreadTests -x spotlessCheck -x spotlessApply -x spotlessJava -PtestJavaVersion=21
143143

144144
- name: Publish Test Report

.github/workflows/nightly-throughput-stress.yml

Lines changed: 0 additions & 202 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ before we can merge in any of your changes
88

99
## Development Environment
1010

11-
- Java 23+
12-
- Docker to run Temporal Server
11+
- **Java 21+** is required to run Gradle, compile the project, and run all tests locally.
12+
- Some optional tests also require the [Temporal CLI](https://docs.temporal.io/cli#installation).
13+
14+
If you're using Apple Silicon, see the [note on Rosetta](#note-on-rosetta).
15+
1316

1417
## Build
1518

@@ -41,26 +44,32 @@ fatal: No names found, cannot describe anything.
4144
This can be done resolved by running `git fetch --tags` on your branch. Note, make sure your fork has tags copied from
4245
the main repo.
4346

44-
## Test and Build
47+
## Testing
4548

46-
Run a local temporal server with the [temporal CLI](https://docs.temporal.io/cli#installation):
49+
Run tests:
4750

4851
```bash
49-
temporal server start-dev
52+
./gradlew test
5053
```
5154

52-
(If this does not work, see instructions for running the Temporal Server at https://github.com/temporalio/temporal/blob/master/README.md.)
53-
54-
Then run all the tests with:
55+
Run a single test or group of tests:
5556

5657
```bash
57-
./gradlew test
58+
./gradlew :temporal-sdk:test --offline --tests "io.temporal.activity.ActivityPauseTest"
59+
./gradlew :temporal-sdk:test --offline --tests "io.temporal.workflow.*"
5860
```
5961

60-
Build with:
62+
By default, integration tests run against the built-in time-skipping test server. Some tests require features that the built-in server doesn't support; those tests will be skipped. To run the skipped tests:
6163

64+
1. Install the [temporal CLI](https://docs.temporal.io/cli#installation), which comes with a built-in dev server.
65+
2. Find the flags that the dev server will need to run the tests by grepping for `temporal server` in [./github/workflows/ci.yml](./github/workflows/ci.yml).
66+
3. Start the server:
67+
```bash
68+
temporal server start-dev --YOUR-FLAGS-HERE
69+
```
70+
4. Set the `USE_EXTERNAL_SERVICE` environment variable and run the tests:
6271
```bash
63-
./gradlew build
72+
USE_EXTERNAL_SERVICE=true ./gradlew test
6473
```
6574

6675
## Note on Rosetta

mise.toml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
1-
# TIP
2-
#
3-
# For the best SDK development experience, make to hava all of the following
4-
# JDKs installed on your machine (`mise install java@[version]`):
5-
# - `java@temurin-11`
6-
# - `java@temurin-17`
7-
# - `java@temurin-23`
8-
#
9-
# Java 21+ is required for anything that requires gradle.
10-
#
11-
# If you find out that gradle isn't automatically picking it up older JDKs as
12-
# toolchains, see https://mise.jdx.dev/lang/java.html#gradle-toolchains-detection.
13-
141
[tools]
15-
java = "temurin-23"
2+
java = "temurin-21"

temporal-sdk/build.gradle

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,10 @@ testing {
184184
targets {
185185
all {
186186
testTask.configure {
187-
javaLauncher = javaToolchains.launcherFor {
188-
languageVersion = JavaLanguageVersion.of(17)
187+
if (project.hasProperty("testJavaVersion")) {
188+
javaLauncher = javaToolchains.launcherFor {
189+
languageVersion = JavaLanguageVersion.of(project.property("testJavaVersion") as int)
190+
}
189191
}
190192
shouldRunAfter(test)
191193
}
@@ -194,20 +196,24 @@ testing {
194196
}
195197

196198
// Unlike virtualThreadTests, jackson3Tests source directly imports Jackson 3 types
197-
// and java17 classes, so the compile task also needs a Java 17 compiler (not just
199+
// and java17 classes, so the compile task also needs a Java 17+ compiler (not just
198200
// the test launcher).
199201
tasks.named('compileJackson3TestsJava') {
200-
javaCompiler = javaToolchains.compilerFor {
201-
languageVersion = JavaLanguageVersion.of(17)
202+
if (project.hasProperty("testJavaVersion")) {
203+
javaCompiler = javaToolchains.compilerFor {
204+
languageVersion = JavaLanguageVersion.of(project.property("testJavaVersion") as int)
205+
}
202206
}
203207
}
204208

205209
virtualThreadTests(JvmTestSuite) {
206210
targets {
207211
all {
208212
testTask.configure {
209-
javaLauncher = javaToolchains.launcherFor {
210-
languageVersion = JavaLanguageVersion.of(21)
213+
if (project.hasProperty("testJavaVersion")) {
214+
javaLauncher = javaToolchains.launcherFor {
215+
languageVersion = JavaLanguageVersion.of(project.property("testJavaVersion") as int)
216+
}
211217
}
212218
shouldRunAfter(test)
213219
}
@@ -230,8 +236,10 @@ testing {
230236
targets {
231237
all {
232238
testTask.configure {
233-
javaLauncher = javaToolchains.launcherFor {
234-
languageVersion = JavaLanguageVersion.of(21)
239+
if (project.hasProperty("testJavaVersion")) {
240+
javaLauncher = javaToolchains.launcherFor {
241+
languageVersion = JavaLanguageVersion.of(project.property("testJavaVersion") as int)
242+
}
235243
}
236244
environment("USE_VIRTUAL_THREADS", "false")
237245
}

0 commit comments

Comments
 (0)