|
54 | 54 | * with {@code --prepared}, which touches no shared state (no install, no git, no build). Each |
55 | 55 | * scenario has its own log directory, its own {@code ${TMP}} (also {@code TMPDIR} for every |
56 | 56 | * process), and takes {@code ${PORT}} from {@code IT_PORT_RANGE} (e.g. 20000-20099) when set, so |
57 | | - * concurrent scenarios given disjoint ranges never race for a port. |
| 57 | + * concurrent scenarios given disjoint ranges never race for a port (unset: an OS-chosen ephemeral |
| 58 | + * port). Every Maven call goes through scripts/mvnw.sh, so the SDK SNAPSHOT is installed into and |
| 59 | + * resolved from {@code IT_M2_REPO} only (default: integration-testing/.cache/m2, or |
| 60 | + * ~/.m2/repository when CI=true). |
58 | 61 | */ |
59 | 62 | public class RunScenario { |
60 | 63 |
|
@@ -126,7 +129,7 @@ static void usage() { |
126 | 129 | Options: |
127 | 130 | --peer <name>=<ref> test peer SDK <name> (see peers.json) at <ref> (branch, tag or SHA) |
128 | 131 | --peers-ref <ref> test every peer SDK at <ref> (a --peer entry wins) |
129 | | - --skip-sdk-install do not run ./mvnw install first (run-all.sh installs once) |
| 132 | + --skip-sdk-install do not install the SDK first (run-all.sh installs once) |
130 | 133 | --prepare <s>... only prepare the peers and run the builds of the scenarios (no install) |
131 | 134 | --prepared the scenario was prepared: no install, no git, no build (parallel runs) |
132 | 135 | --list list scenarios |
@@ -184,11 +187,11 @@ int run(boolean skipInstall, boolean prepared, String peersRef, Map<String, Stri |
184 | 187 | String acpVersion = sdkVersion(); |
185 | 188 | if (!skipInstall) { |
186 | 189 | step("Installing the SDK from " + repo + " (" + acpVersion + ")"); |
187 | | - exec(logDir.resolve("sdk-install.log"), repo, 900, "./mvnw", "-q", "-B", "-DskipTests", "install"); |
| 190 | + exec(logDir.resolve("sdk-install.log"), repo, 900, mvnw(root), "-q", "-B", "-DskipTests", "install"); |
188 | 191 | } |
189 | 192 | vars.put("ROOT", root.toString()); |
190 | 193 | vars.put("REPO", repo.toString()); |
191 | | - vars.put("MVNW", repo.resolve("mvnw").toString()); |
| 194 | + vars.put("MVNW", mvnw(root)); |
192 | 195 | vars.put("ACP_VERSION", acpVersion); |
193 | 196 | vars.put("CACHE", root.resolve(".cache").toString()); |
194 | 197 | vars.put("LOG_DIR", logDir.toString()); |
@@ -485,6 +488,14 @@ String sdkVersion() throws Exception { |
485 | 488 | return m.group(1).trim(); |
486 | 489 | } |
487 | 490 |
|
| 491 | + /** |
| 492 | + * The Maven wrapper every build uses: scripts/mvnw.sh, the checkout's ./mvnw pinned to the |
| 493 | + * suite's local repository ({@code -Dmaven.repo.local=$IT_M2_REPO}, see scripts/m2-repo.sh). |
| 494 | + */ |
| 495 | + static String mvnw(Path root) { |
| 496 | + return root.resolve("scripts").resolve("mvnw.sh").toString(); |
| 497 | + } |
| 498 | + |
488 | 499 | /** |
489 | 500 | * A free port: the first one that binds in {@code IT_PORT_RANGE} ({@code <from>-<to>}, set by |
490 | 501 | * run-all.sh so concurrent scenarios use disjoint ranges), else one the OS picks. |
@@ -528,7 +539,7 @@ static int prepareAll(Path root, List<String> scenarios, String peersRef, Map<St |
528 | 539 | Map<String, String> vars = new LinkedHashMap<>(); |
529 | 540 | vars.put("ROOT", root.toString()); |
530 | 541 | vars.put("REPO", r.repo.toString()); |
531 | | - vars.put("MVNW", r.repo.resolve("mvnw").toString()); |
| 542 | + vars.put("MVNW", mvnw(root)); |
532 | 543 | vars.put("ACP_VERSION", r.sdkVersion()); |
533 | 544 | vars.put("CACHE", root.resolve(".cache").toString()); |
534 | 545 | vars.put("LOG_DIR", r.logDir.toString()); |
|
0 commit comments