Enable some tests that weren't actually running
@@ -48,7 +48,8 @@ interface RunCase {
showRootResourceRegistration?: boolean;
invoke?: (ctx: any, tok: string, args: any, version: string) => { failures: any, ret: any };
readResource?: (ctx: any, t: string, name: string, id: string, par: string, state: any, version: string) => {
- urn: URN | undefined, props: any | undefined };
+ urn: URN | undefined, props: any | undefined,
+ };
registerResource?: (ctx: any, dryrun: boolean, t: string, name: string, res: any, dependencies?: string[],
custom?: boolean, protect?: boolean, parent?: string, provider?: string,
propertyDeps?: any, ignoreChanges?: string[], version?: string, importID?: string) => { urn: URN | undefined, id: ID | undefined, props: any | undefined };
@@ -509,11 +510,19 @@ describe("rpc", () => {
// Test stack outputs via exports.
"stack_exports": {
program: path.join(base, "019.stack_exports"),
- expectResourceCount: 0,
+ expectResourceCount: 1,
+ showRootResourceRegistration: true,
+ registerResource: (ctx, dryrun, t, name, res, deps, custom, protect, parent) => {
+ if (t === "pulumi:pulumi:Stack") {
+ ctx.stackUrn = makeUrn(t, name);
+ return { urn: makeUrn(t, name), id: undefined, props: undefined };
+ }
+ throw new Error();
+ },
registerResourceOutputs: (ctx: any, dryrun: boolean, urn: URN,
t: string, name: string, res: any, outputs: any | undefined) => {
assert.strictEqual(t, "pulumi:pulumi:Stack");
- assert.strictEqual(outputs, {
+ assert.deepEqual(outputs, {
a: {
x: 99,
y: "z",
@@ -865,25 +874,33 @@ describe("rpc", () => {
// Test stack outputs via exports.
"recursive_stack_exports": {
program: path.join(base, "046.recursive_stack_exports"),
- expectResourceCount: 0,
+ expectResourceCount: 1,
+ showRootResourceRegistration: true,
+ registerResource: (ctx, dryrun, t, name, res, deps, custom, protect, parent) => {
+ if (t === "pulumi:pulumi:Stack") {
+ ctx.stackUrn = makeUrn(t, name);
+ return { urn: makeUrn(t, name), id: undefined, props: undefined };
+ }
+ throw new Error();
+ },
registerResourceOutputs: (ctx: any, dryrun: boolean, urn: URN,
t: string, name: string, res: any, outputs: any | undefined) => {
assert.strictEqual(t, "pulumi:pulumi:Stack");
- assert.strictEqual(outputs, {
- m: { a: { b: 1 } },
- n: { a: { b: 1 } },
- o: { b: 1 },
- p: 1,
- obj2: { x: { y: 1, x: undefined }, obj2: undefined },
- obj2_x: { y: 1, x: undefined },
- obj2_x_y: 1,
+ assert.deepEqual(outputs, {
+ "m": { "a": { "b": 1 } },
+ "n": { "a": { "b": 1 } },
+ "o": { "b": 1 },
+ "obj2": { "x": { "y": 1 } },
+ "obj2_x": { "y": 1 },
+ "obj2_x_y": 1,
+ "p": 1,
});
},
},
};
for (const casename of Object.keys(cases)) {
- // if (casename.indexOf("recursive_stack_exports") < 0) {
+ // if (casename !== "stack_exports") {
// continue;
// }
