MaximBelov opened a new pull request, #315:
URL: https://github.com/apache/cordova-paramedic/pull/315
Split out of #314 at the reviewer's convenience — the two fixes there were
independent, and this is the second one. #314 now covers only the `--plugin`
argument handling.
## The problem
`filterForSimulatorIds` requires the two runtime versions to be equal:
```js
if (simIdMatch && simIdMatch.length === 4 && simIdMatch[1] ===
simulatorData.device && simIdMatch[2] === simulatorData.version) {
```
But the two sides come from different tools and are not written to the same
depth. `cordova run ios --list --emulator`, which `getSimulatorModelId` reads,
reports the minor version:
```
iPhone-16-Pro, 18.3
```
while `xcrun xctrace list devices`, which the simulator ids are read from,
reports the patch version:
```
iPhone 16 Pro (18.3.1) (A14B1090-294D-4E0B-9474-0C3F8B97394C)
```
`'18.3' === '18.3.1'` is false, so no id is found, `getSimulatorData` logs
`No simulator found.`, `simId` is left undefined, and the run then sits in
`Waiting for test results...` until it times out.
It only works when the installed runtime happens to have no patch component.
On the machine this was found on, 18.2 matched while 18.3.1 and 26.3.1 did not
— which is the asymmetry that keeps it out of CI here: runner images tend to
ship runtimes whose versions are two components, a developer's Xcode usually
does not.
## The change
Compares on dot boundaries, so the shorter version acts as a prefix of the
longer without `18.3` also matching `18.30`. Extracted as
`runtimeVersionsMatch` with the reason documented, since the mismatch is not
obvious from either call site.
Checked against the cases that matter:
| a | b | matches |
| --- | --- | --- |
| `18.3` | `18.3.1` | yes |
| `26` | `26.3.1` | yes |
| `18.2` | `18.2` | yes |
| `18.3` | `18.30` | no |
| `18.3` | `18.4.1` | no |
| `18` | `19.0` | no |
## Verification
Against a real third-party plugin with a 23-spec suite in its `tests/`
directory, cordova-ios 8.1.1, `--ci --cleanUpAfterRun`:
| | before | after |
| --- | --- | --- |
| iPhone 17 Pro, iOS **26.3.1** | `No simulator found.` then hangs in
`Waiting for test results...` | `Executed 23 of 23 specs SUCCESS`, exit 0 |
| iPhone 16 Pro, iOS **18.2** (no patch component) | already worked | still
works, unchanged |
`eslint .` is clean.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]