|
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> |
| 65 | + <!-- |
| 66 | + Whether to skip the install-nodejs-cli-dependencies execution |
| 67 | + (npm ci of the @github/copilot CLI). Defaults to ${skip.test.harness} |
| 68 | + so it tracks the rest of the test-harness setup, but is also |
| 69 | + forced to true when Maven tests are skipped (-DskipTests or |
| 70 | + -Dmaven.test.skip) via the skip-cli-install-when-tests-skipped |
| 71 | + and skip-cli-install-when-maven-test-skip profiles below, so that |
| 72 | + non-test builds (e.g. package/deploy with tests skipped) do not |
| 73 | + require npm or network access. |
| 74 | + --> |
| 75 | + <skip.cli.install>${skip.test.harness}</skip.cli.install> |
54 | 76 | <!-- Extra JVM args for Surefire; overridden by the jdk21+ profile --> |
55 | 77 | <surefire.jvm.args /> |
| 78 | + <!-- |
| 79 | + The version of the @github/copilot npm package that the reference implementation |
| 80 | + commit pinned in .lastmerge depends on. Mirrors the value of dependencies."@github/copilot" |
| 81 | + in target/copilot-sdk/nodejs/package.json after the reference impl is cloned/reset to the |
| 82 | + commit in .lastmerge. |
| 83 | +
|
| 84 | + The previously mentioned package.json contains the SINGLE |
| 85 | + SOURCE OF TRUTH for the Copilot CLI version that all paths |
| 86 | + (build-test.yml, run-smoke-test.yml, |
| 87 | + update-copilot-dependency.yml, setup-copilot action) must |
| 88 | + pin to. It is updated automatically by |
| 89 | + .github/scripts/reference-impl-sync/sync-cli-version-from-reference-impl.sh, |
| 90 | + which is called from merge-reference-impl-finish.sh |
| 91 | + whenever .lastmerge is updated. |
| 92 | +
|
| 93 | + DO NOT EDIT MANUALLY. To update, run the |
| 94 | + reference-impl-sync workflow and deal with the subsequent |
| 95 | + PR. |
| 96 | + --> |
| 97 | + <readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-weekly-reference-impl-sync>^1.0.36-0</readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-weekly-reference-impl-sync> |
| 98 | + |
56 | 99 | </properties> |
57 | 100 |
|
58 | 101 | <dependencies> |
|
240 | 283 | </arguments> |
241 | 284 | </configuration> |
242 | 285 | </execution> |
| 286 | + <!-- |
| 287 | + Install the @github/copilot CLI declared by |
| 288 | + target/copilot-sdk/nodejs/package.json. This is the CLI |
| 289 | + version the SDK tests must run against (independent of |
| 290 | + the older pin in test/harness/package.json which is |
| 291 | + incidental to harness internals). Mirrors what |
| 292 | + .github/workflows/build-test.yml does manually so that |
| 293 | + `mvn clean verify` is self-contained: the prior |
| 294 | + target/copilot-sdk/nodejs/node_modules is wiped by |
| 295 | + clean, but this re-creates it before tests run. |
| 296 | + Uses npm ci with the ignore-scripts flag, matching |
| 297 | + build-test.yml. |
| 298 | + --> |
| 299 | + <execution> |
| 300 | + <id>install-nodejs-cli-dependencies</id> |
| 301 | + <phase>generate-test-resources</phase> |
| 302 | + <goals> |
| 303 | + <goal>exec</goal> |
| 304 | + </goals> |
| 305 | + <configuration> |
| 306 | + <skip>${skip.cli.install}</skip> |
| 307 | + <executable>npm</executable> |
| 308 | + <workingDirectory>${copilot.sdk.clone.dir}/nodejs</workingDirectory> |
| 309 | + <arguments> |
| 310 | + <argument>ci</argument> |
| 311 | + <argument>--ignore-scripts</argument> |
| 312 | + </arguments> |
| 313 | + </configuration> |
| 314 | + </execution> |
243 | 315 | </executions> |
244 | 316 | </plugin> |
245 | 317 | <plugin> |
|
253 | 325 | <copilot.tests.dir>${copilot.tests.dir}</copilot.tests.dir> |
254 | 326 | <copilot.sdk.dir>${copilot.sdk.clone.dir}</copilot.sdk.dir> |
255 | 327 | </systemPropertyVariables> |
| 328 | + <!-- |
| 329 | + Set COPILOT_CLI_PATH for the forked test JVM so the SDK |
| 330 | + tests transparently use the pinned CLI under |
| 331 | + target/copilot-sdk/nodejs/. See the copilot.cli.path |
| 332 | + property above for the override mechanism. |
| 333 | + --> |
| 334 | + <environmentVariables> |
| 335 | + <COPILOT_CLI_PATH>${copilot.cli.path}</COPILOT_CLI_PATH> |
| 336 | + </environmentVariables> |
256 | 337 | </configuration> |
257 | 338 | </plugin> |
258 | 339 | <!-- Add src/generated/java as an additional source root --> |
|
587 | 668 | <skip.test.harness>true</skip.test.harness> |
588 | 669 | </properties> |
589 | 670 | </profile> |
| 671 | + <!-- |
| 672 | + Skip the install-nodejs-cli-dependencies (npm ci) execution when |
| 673 | + tests are skipped via -DskipTests, so non-test builds do not |
| 674 | + require npm or network access. Activates automatically; no manual |
| 675 | + -P needed. |
| 676 | + --> |
| 677 | + <profile> |
| 678 | + <id>skip-cli-install-when-tests-skipped</id> |
| 679 | + <activation> |
| 680 | + <property> |
| 681 | + <name>skipTests</name> |
| 682 | + <value>true</value> |
| 683 | + </property> |
| 684 | + </activation> |
| 685 | + <properties> |
| 686 | + <skip.cli.install>true</skip.cli.install> |
| 687 | + </properties> |
| 688 | + </profile> |
| 689 | + <!-- |
| 690 | + Same as above, but for -Dmaven.test.skip=true. |
| 691 | + --> |
| 692 | + <profile> |
| 693 | + <id>skip-cli-install-when-maven-test-skip</id> |
| 694 | + <activation> |
| 695 | + <property> |
| 696 | + <name>maven.test.skip</name> |
| 697 | + <value>true</value> |
| 698 | + </property> |
| 699 | + </activation> |
| 700 | + <properties> |
| 701 | + <skip.cli.install>true</skip.cli.install> |
| 702 | + </properties> |
| 703 | + </profile> |
590 | 704 | <!-- Debug profile for FINE logging during tests --> |
591 | 705 | <profile> |
592 | 706 | <id>debug</id> |
|
0 commit comments