fix(run): recover Testo paths when a remote interpreter's configuration holds host paths - #99
Conversation
…on holds host paths test(run): cover projectRootOfExecutable and the working-directory precedence With no Testo configuration bound to the interpreter id, PhpTestFrameworkSettingsManager.getOrCreateByInterpreter fabricates one from the local configuration through PathMappingSettings.convertToRemote, which returns its input unchanged when no mapping matches — so the executable stayed the host vendor/bin/testo, and a Docker Compose interpreter in run lifecycle mode launched a path that exists only outside the container. That fabricated configuration also carries no config file, so the working directory fell through to the platform fallback (the content root), which the compose volume need not map; the nearest ancestor of the executable holding testo.php or composer.json is the one directory the interpreter is known to see, and bounding it by project.basePath keeps a globally installed binary from answering. Assisted-By: Claude Fable 5.1
|
Same fix covers a local interpreter case, worth adding to the description. Monorepo, In a fresh checkout of that repository PhpStorm registered every nested from there. The entrypoint fails, the nested package has no The original checkout of the same repository, with only the root manifest registered, ran from the root. So the cwd depended on IDE-side Composer project detection, not on the repository. With this branch the executable-root walk stops at the root |
🔍 What was changed
runlifecycle mode no longer launches the hostvendor/bin/testo.testo.phpis known, the working directory is now the project root above the executable rather than the content root, so the run starts in a directory the interpreter actually maps.How it works
testo.php→ nearest ancestor of the (reverse-mapped) executable holdingtesto.phporcomposer.json, bounded byproject.basePath→ platform fallback. A globally installed binary yields nothing and falls through.convertToRemote, which returns an already-remote path unchanged and rewrites only a host one. The alternative configuration file keeps going throughaddPathArgument.Why?
When no Testo configuration is bound to the interpreter id,
PhpTestFrameworkSettingsManager.getOrCreateByInterpreterfabricates one from the local configuration (the oneTestoComposerConfigcreated, with the hostvendor/bin/testoand no config file) usingPathMappingSettings.convertToRemote— which returns its input unchanged when no mapping matches. SoframeworkConfig.executablePathcame back as a host path, and the missing config file dropped the cwd to the unmapped content root. Composeexeclooked fine only because that interpreter happened to have a real per-interpreter Testo configuration.Checklist
runmode on the reporter's macOS setup still needs confirmationbuildPluginon 262,compileKotlin -PphpApi=252