Skip to content

Commit 9b14893

Browse files
edburnsCopilot
andcommitted
Add JDK 25 smoke test job with virtual thread support
- Rename existing smoke-test job to smoke-test-jdk17 - Add smoke-test-java25 job using Microsoft JDK 25 - JDK 25 job instructs agent to follow // JDK 25+: marker comments in README Quick Start to enable virtual threads Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f8e59c8 commit 9b14893

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

.github/workflows/run-smoke-test.yml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ permissions:
1111
contents: read
1212

1313
jobs:
14-
smoke-test:
15-
name: Build SDK and run smoke test
14+
smoke-test-jdk17:
15+
name: Build SDK and run smoke test (JDK 17)
1616
runs-on: ubuntu-latest
1717
if: github.ref == 'refs/heads/main'
1818
steps:
@@ -59,3 +59,55 @@ jobs:
5959
cd smoke-test
6060
java -jar ./target/copilot-sdk-smoketest-1.0-SNAPSHOT.jar
6161
echo "Smoke test passed (exit code 0)"
62+
63+
smoke-test-java25:
64+
name: Build SDK and run smoke test (JDK 25)
65+
runs-on: ubuntu-latest
66+
if: github.ref == 'refs/heads/main'
67+
steps:
68+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
69+
70+
- name: Set up JDK 25
71+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
72+
with:
73+
java-version: "25"
74+
distribution: "microsoft"
75+
cache: "maven"
76+
77+
- uses: ./.github/actions/setup-copilot
78+
79+
- name: Build SDK and install to local repo
80+
run: mvn -DskipTests -Pskip-test-harness clean install
81+
82+
- name: Create and run smoke test via Copilot CLI
83+
env:
84+
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
85+
run: |
86+
cat > /tmp/smoke-test-prompt.txt << 'PROMPT_EOF'
87+
You are running inside the copilot-sdk-java repository.
88+
The SDK has already been built and installed into the local Maven repository.
89+
JDK 25 and Maven are already installed and on PATH.
90+
91+
Execute the prompt at `src/test/prompts/PROMPT-smoke-test.md` with the following critical overrides:
92+
93+
**Critical override — disable SNAPSHOT updates (but allow downloads):** The goal of this workflow is to validate the SDK SNAPSHOT that was just built and installed locally, not any newer SNAPSHOT that might exist in a remote repository. To ensure Maven does not download a newer timestamped SNAPSHOT of the SDK while still allowing it to download any missing plugins or dependencies, you must run the smoke-test Maven build without `-U` and with `--no-snapshot-updates`, so that it uses the locally installed SDK artifact. Use `mvn --no-snapshot-updates clean package` instead of `mvn -U clean package` or `mvn -o clean package`.
94+
95+
**Critical override — do NOT run the jar:** Stop after the `mvn --no-snapshot-updates clean package` build succeeds. Do NOT execute Step 4 (java -jar) or Step 5 (verify exit code) from the prompt. The workflow will run the jar in a separate deterministic step to guarantee the exit code propagates correctly.
96+
97+
**Critical override — enable Virtual Threads for JDK 25:** After creating the Java source file from the README "Quick Start" section but BEFORE building, you must modify the source file to enable virtual thread support. The Quick Start code contains inline comments that start with `// JDK 25+:` — these are instructions. Find every such comment and follow what it says (comment out lines it says to comment out, uncomment lines it says to uncomment). Add any imports required by the newly uncommented code (e.g. `java.util.concurrent.Executors`).
98+
Also set `maven.compiler.source` and `maven.compiler.target` to `25` in the `pom.xml`.
99+
100+
Follow steps 1-3 only: create the `smoke-test/` directory, create `pom.xml` and the Java source file exactly as specified, apply the JDK 25 virtual thread modifications described above, and build with `mvn --no-snapshot-updates clean package` (no SNAPSHOT updates and without `-U`).
101+
102+
If any step fails, exit with a non-zero exit code. Do not silently fix errors.
103+
PROMPT_EOF
104+
105+
copilot --yolo --prompt "$(cat /tmp/smoke-test-prompt.txt)"
106+
107+
- name: Run smoke test jar
108+
env:
109+
COPILOT_GITHUB_TOKEN: ${{ secrets.COPILOT_GITHUB_TOKEN }}
110+
run: |
111+
cd smoke-test
112+
java -jar ./target/copilot-sdk-smoketest-1.0-SNAPSHOT.jar
113+
echo "Smoke test passed (exit code 0)"

0 commit comments

Comments
 (0)