Has anyone got a functional launch.json or similar...
# typescript
l
Has anyone got a functional launch.json or similar, to get debugging working with Pulumi?
Even partially working would be fine. If it could run my tests, it'd be great. I've never managed to get js debugging working, ever... must be because I run ts/node via Docker...
a
@gorgeous-egg-16927 How do you guys test pulumi apps?
l
@little-cartoon-10569 Yeah, this worked for me: https://github.com/pulumi/pulumi/issues/1372#issuecomment-794491331 It should probably be in the docs. I actually switched away from the suggested method of running a task as VScode complains about not having a problem matcher and their docs seemed daunting on that aspect. I also found it would occasionally get stuck and the output is missing. Instead I just
NODE_OPTIONS='--inspect-brk=127.0.0.1:9292' pulumi up --parallel=1
from the terminal and then
F5
in vscode to launch the debugger.
l
I haven't managed to figure any of that out. My use case is different.. I'm running mocha, not Pulumi, so it should be even easier.. but I'm just not getting it. Guess I've been stuck in the JVM too long.. new ways of working...
Found an "auto-attach" feature that suddenly makes stuff work... https://code.visualstudio.com/docs/nodejs/nodejs-debugging
The --inspect-brk=127.0.0.1:9292 option that all the Pulumi docs mention just caused everything to hang. With that option gone, stuff ran but the debugger never attached. With this auto-attach (set to "smart"), I can now debug my tests.
👍 1
🎉 1