This message was deleted.
s
This message was deleted.
m
Alright, I’ve found it. Digging into the source code and some of the issues on github learned me I have to set the environment variable
PULUMI_TEST_MODE=true
.
l
Yes, or you can run your test code inside
pulumi.runtime.runInPulumiStack()
.
Often it is possible to avoid doing either, if you limit your testing to your ComponentResources and avoid testing your index.ts or similar.
So far, the only time I have had to use
runInPulumiStack
in a test was to test
registerStackTransformation
.
m
I wasn’t aware of
pulumi.runtime.runInPulumiStack()
I’ll take a look at that.
Up until now I never tested index.ts. index.ts only does the wiring. I only test the resources created by my classes or functions that kind of do what
ComponentResources
does. I also wasn’t aware of that one 🙄 😄
And it is exactly while testing these functions and classes (that rely on a Node.js package that uses Pulumi) that I got that error message
l
Ok. I use a mono-repo so not quite the same case. I haven't been dependent on that env var. But it looks like it's intended for exactly this purpose 👍
m
Well, at least it solved my problem. But for some reason, nodejs memory usage exploded. I had to increase
--max-old-space-size