|
49 | 49 | <!-- Directory where the copilot-sdk repo will be cloned for tests --> |
50 | 50 | <copilot.sdk.clone.dir>${project.build.directory}/copilot-sdk</copilot.sdk.clone.dir> |
51 | 51 | <copilot.tests.dir>${copilot.sdk.clone.dir}/test</copilot.tests.dir> |
| 52 | + <!-- |
| 53 | + Path to the Copilot CLI entry point used by the SDK tests. Defaults |
| 54 | + to the CLI installed under target/copilot-sdk/nodejs by the |
| 55 | + install-nodejs-cli-dependencies execution. Surefire injects this |
| 56 | + into the test JVM as the COPILOT_CLI_PATH environment variable, so |
| 57 | + `mvn verify` is self-contained and the developer never has to set |
| 58 | + it manually. Override on the command line to point at a different |
| 59 | + CLI build, e.g.: |
| 60 | + mvn verify -Dcopilot.cli.path=/some/other/copilot/index.js |
| 61 | + --> |
| 62 | + <copilot.cli.path>${copilot.sdk.clone.dir}/nodejs/node_modules/@github/copilot/index.js</copilot.cli.path> |
52 | 63 | <!-- Set to true (via -Pskip-test-harness) to skip git-clone + npm install of test harness --> |
53 | 64 | <skip.test.harness>false</skip.test.harness> |
54 | 65 | <!-- Extra JVM args for Surefire; overridden by the jdk21+ profile --> |
|
261 | 272 | </arguments> |
262 | 273 | </configuration> |
263 | 274 | </execution> |
| 275 | + <!-- |
| 276 | + Install the @github/copilot CLI declared by |
| 277 | + target/copilot-sdk/nodejs/package.json. This is the CLI |
| 278 | + version the SDK tests must run against (independent of |
| 279 | + the older pin in test/harness/package.json which is |
| 280 | + incidental to harness internals). Mirrors what |
| 281 | + .github/workflows/build-test.yml does manually so that |
| 282 | + `mvn clean verify` is self-contained: the prior |
| 283 | + target/copilot-sdk/nodejs/node_modules is wiped by |
| 284 | + clean, but this re-creates it before tests run. |
| 285 | + Uses npm ci with the ignore-scripts flag, matching |
| 286 | + build-test.yml. |
| 287 | + --> |
| 288 | + <execution> |
| 289 | + <id>install-nodejs-cli-dependencies</id> |
| 290 | + <phase>generate-test-resources</phase> |
| 291 | + <goals> |
| 292 | + <goal>exec</goal> |
| 293 | + </goals> |
| 294 | + <configuration> |
| 295 | + <skip>${skip.test.harness}</skip> |
| 296 | + <executable>npm</executable> |
| 297 | + <workingDirectory>${copilot.sdk.clone.dir}/nodejs</workingDirectory> |
| 298 | + <arguments> |
| 299 | + <argument>ci</argument> |
| 300 | + <argument>--ignore-scripts</argument> |
| 301 | + </arguments> |
| 302 | + </configuration> |
| 303 | + </execution> |
264 | 304 | </executions> |
265 | 305 | </plugin> |
266 | 306 | <plugin> |
|
274 | 314 | <copilot.tests.dir>${copilot.tests.dir}</copilot.tests.dir> |
275 | 315 | <copilot.sdk.dir>${copilot.sdk.clone.dir}</copilot.sdk.dir> |
276 | 316 | </systemPropertyVariables> |
| 317 | + <!-- |
| 318 | + Set COPILOT_CLI_PATH for the forked test JVM so the SDK |
| 319 | + tests transparently use the pinned CLI under |
| 320 | + target/copilot-sdk/nodejs/. See the copilot.cli.path |
| 321 | + property above for the override mechanism. |
| 322 | + --> |
| 323 | + <environmentVariables> |
| 324 | + <COPILOT_CLI_PATH>${copilot.cli.path}</COPILOT_CLI_PATH> |
| 325 | + </environmentVariables> |
277 | 326 | </configuration> |
278 | 327 | </plugin> |
279 | 328 | <!-- Add src/generated/java as an additional source root --> |
|
0 commit comments