little-cartoon-10569
05/08/2020, 12:53 AMError: Program run without the Pulumi engine available; re-run using theI've triedCLIpulumi
pulumi login
and I've copied Pulumi.yaml from the source directory (btw it's not documented anywhere that you have to do this in order to use the same project/stack in multiple places - all the docs assume you're creating a new project and stack every time).setMockOptions
or how to check if I'm in testing mode. I am using the example code from the docs, so I'm calling setMocks
, which should call setMockOptions
, but I haven't been able to prove it. I don't think I can debug.. I certainly don't know how (using js/ts/vscode, but a beginner in all of them).white-balloon-205
05/08/2020, 2:09 AMlittle-cartoon-10569
05/08/2020, 2:10 AMmocha -r ts-node/register
or npm test
to run the Pulumi engine? It looks like it's almost doing the right thing, but the mock option testModeEnabled is false... maybe?console.log
outputting pulumi.runtime.isTestModeEnabled()
before and after the call to pulumi.runtime.setMocks()
and it's going from false to true.. good. But now I'm getting
Error: The root stack resource was referenced before it was initialized.
at Object.registerStackTransformation (/app/node_modules/@pulumi/pulumi/runtime/stack.js:211:15)
registerStackTransformation
from my Pulumi code brings me back to
Error: Program run without the Pulumi engine available; re-run using the😡CLIpulumi
describe('Vpc', function () {
it('should contain tags', function (done) {
const vpc = new aws.ec2.Vpc("VPC", {
"cidrBlock": "10.10.10.10/20",
"tags": { "name": "steve" }
});
pulumi.output(vpc.tags).apply((tags) => {
console.log(tags); // Logged fine.
done(); // Test passes.
});
});
});
describe('VpcX', function () {
it('should contain tags', function (done) {
const vpc = new awsx.ec2.Vpc("VPC", {
"cidrBlock": "10.10.10.10/20",
"tags": { "name": "steve" }
});
pulumi.output(vpc.vpc.tags).apply((tags) => {
console.log(tags); // Doesn't get logged.
done(); // Test errors out.
});
});
});
steve
, it stops them complaining about all the others having better names.)pulumi.runtime
... I'll raise an issue in pulumi/pulumi-awsx. ¯\_(ツ)_/¯white-balloon-205
05/08/2020, 6:54 PMSame module (pulumi/pulumi) appeared in a few places in my dependency graph and I think it had a hard time with that.Ahh - got it - sorry for the troubles there. We are trying to shift to a model that will avoid this class of problem in the future (more use of
peerDependencies
in our own libraries).little-cartoon-10569
05/09/2020, 10:21 PM