@pulumi/pulumi 3.40.0 → 3.40.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/asset/archive.js +8 -1
- package/asset/archive.js.map +1 -1
- package/asset/asset.js +8 -1
- package/asset/asset.js.map +1 -1
- package/automation/cmd.js +5 -2
- package/automation/cmd.js.map +1 -1
- package/automation/localWorkspace.d.ts +2 -2
- package/automation/localWorkspace.js +12 -5
- package/automation/localWorkspace.js.map +1 -1
- package/automation/minimumVersion.d.ts +1 -2
- package/automation/minimumVersion.js +9 -1
- package/automation/minimumVersion.js.map +1 -1
- package/automation/server.js +12 -5
- package/automation/server.js.map +1 -1
- package/automation/stack.js +19 -9
- package/automation/stack.js.map +1 -1
- package/automation/workspace.d.ts +1 -1
- package/cmd/dynamic-provider/index.js +9 -2
- package/cmd/dynamic-provider/index.js.map +1 -1
- package/cmd/run/index.js +15 -5
- package/cmd/run/index.js.map +1 -1
- package/cmd/run/run.js +57 -13
- package/cmd/run/run.js.map +1 -1
- package/cmd/run/tracing.d.ts +1 -0
- package/cmd/run/tracing.js +116 -0
- package/cmd/run/tracing.js.map +1 -0
- package/cmd/run-policy-pack/index.js +13 -3
- package/cmd/run-policy-pack/index.js.map +1 -1
- package/cmd/run-policy-pack/run.js +14 -7
- package/cmd/run-policy-pack/run.js.map +1 -1
- package/dynamic/index.js +9 -2
- package/dynamic/index.js.map +1 -1
- package/errors.js +9 -2
- package/errors.js.map +1 -1
- package/index.js +15 -8
- package/index.js.map +1 -1
- package/metadata.d.ts +3 -3
- package/metadata.js +11 -4
- package/metadata.js.map +1 -1
- package/output.js +9 -2
- package/output.js.map +1 -1
- package/package.json +8 -1
- package/provider/internals.d.ts +1 -3
- package/provider/internals.js +1 -0
- package/provider/internals.js.map +1 -1
- package/provider/server.js +13 -6
- package/provider/server.js.map +1 -1
- package/resource.js +9 -2
- package/resource.js.map +1 -1
- package/runtime/closure/codePaths.js +17 -7
- package/runtime/closure/codePaths.js.map +1 -1
- package/runtime/closure/createClosure.js +10 -3
- package/runtime/closure/createClosure.js.map +1 -1
- package/runtime/closure/package.js +8 -1
- package/runtime/closure/package.js.map +1 -1
- package/runtime/closure/parseFunction.js +10 -3
- package/runtime/closure/parseFunction.js.map +1 -1
- package/runtime/closure/rewriteSuper.js +8 -1
- package/runtime/closure/rewriteSuper.js.map +1 -1
- package/runtime/closure/serializeClosure.js +9 -2
- package/runtime/closure/serializeClosure.js.map +1 -1
- package/runtime/closure/v8.js +11 -4
- package/runtime/closure/v8.js.map +1 -1
- package/runtime/closure/v8Hooks.js +10 -3
- package/runtime/closure/v8Hooks.js.map +1 -1
- package/runtime/closure/v8_v10andLower.js +8 -1
- package/runtime/closure/v8_v10andLower.js.map +1 -1
- package/runtime/closure/v8_v11andHigher.js +10 -3
- package/runtime/closure/v8_v11andHigher.js.map +1 -1
- package/runtime/debuggable.d.ts +1 -2
- package/runtime/debuggable.js +10 -1
- package/runtime/debuggable.js.map +1 -1
- package/runtime/index.d.ts +0 -1
- package/runtime/index.js +0 -2
- package/runtime/index.js.map +1 -1
- package/runtime/invoke.js +10 -3
- package/runtime/invoke.js.map +1 -1
- package/runtime/mocks.d.ts +2 -1
- package/runtime/mocks.js +3 -2
- package/runtime/mocks.js.map +1 -1
- package/runtime/resource.js +11 -4
- package/runtime/resource.js.map +1 -1
- package/runtime/rpc.js +10 -3
- package/runtime/rpc.js.map +1 -1
- package/runtime/settings.d.ts +0 -1
- package/runtime/settings.js +13 -5
- package/runtime/settings.js.map +1 -1
- package/runtime/stack.js +8 -1
- package/runtime/stack.js.map +1 -1
- package/tests/automation/cmd.spec.js +8 -1
- package/tests/automation/cmd.spec.js.map +1 -1
- package/tests/automation/data/testproj/go.mod +64 -2
- package/tests/automation/data/testproj/go.sum +226 -187
- package/tests/automation/data/testproj/main.go +3 -0
- package/tests/automation/localWorkspace.spec.js +133 -123
- package/tests/automation/localWorkspace.spec.js.map +1 -1
- package/tests/config.spec.js +8 -1
- package/tests/config.spec.js.map +1 -1
- package/tests/iterable.spec.js +9 -2
- package/tests/iterable.spec.js.map +1 -1
- package/tests/options.spec.js +8 -1
- package/tests/options.spec.js.map +1 -1
- package/tests/output.spec.js +9 -2
- package/tests/output.spec.js.map +1 -1
- package/tests/provider.spec.js +10 -3
- package/tests/provider.spec.js.map +1 -1
- package/tests/resource.spec.js +9 -2
- package/tests/resource.spec.js.map +1 -1
- package/tests/runtime/asyncIterableUtil.spec.js +8 -1
- package/tests/runtime/asyncIterableUtil.spec.js.map +1 -1
- package/tests/runtime/closureLoader.spec.js +8 -1
- package/tests/runtime/closureLoader.spec.js.map +1 -1
- package/tests/runtime/langhost/cases/069.ambiguous_entrypoints/index.js.map +1 -1
- package/tests/runtime/langhost/cases/070.unusual_alias_names/index.js +27 -0
- package/tests/runtime/langhost/cases/071.large_alias_counts/index.js +23 -0
- package/tests/runtime/langhost/cases/072.large_alias_lineage_chains/index.js +27 -0
- package/tests/runtime/langhost/run.spec.js +200 -176
- package/tests/runtime/langhost/run.spec.js.map +1 -1
- package/tests/runtime/package.spec.js +9 -2
- package/tests/runtime/package.spec.js.map +1 -1
- package/tests/runtime/props.spec.js +8 -1
- package/tests/runtime/props.spec.js.map +1 -1
- package/tests/runtime/registrations.spec.js +8 -1
- package/tests/runtime/registrations.spec.js.map +1 -1
- package/tests/runtime/settings.spec.js +9 -2
- package/tests/runtime/settings.spec.js.map +1 -1
- package/tests/runtime/tsClosureCases.js +14 -25
- package/tests/runtime/tsClosureCases.js.map +1 -1
- package/tests/unwrap.spec.js +8 -1
- package/tests/unwrap.spec.js.map +1 -1
- package/tests/util.js +5 -2
- package/tests/util.js.map +1 -1
- package/tests_with_mocks/mocks.spec.js +9 -2
- package/tests_with_mocks/mocks.spec.js.map +1 -1
- package/tsutils.d.ts +1 -1
- package/tsutils.js +10 -2
- package/tsutils.js.map +1 -1
- package/version.js +1 -1
|
@@ -21,10 +21,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
25
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
26
|
+
};
|
|
27
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
31
|
+
result["default"] = mod;
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
24
34
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
-
const
|
|
26
|
-
const semver = require("semver");
|
|
27
|
-
const upath = require("upath");
|
|
35
|
+
const assert_1 = __importDefault(require("assert"));
|
|
36
|
+
const semver = __importStar(require("semver"));
|
|
37
|
+
const upath = __importStar(require("upath"));
|
|
28
38
|
const automation_1 = require("../../automation");
|
|
29
39
|
const index_1 = require("../../index");
|
|
30
40
|
const util_1 = require("../util");
|
|
@@ -35,18 +45,18 @@ describe("LocalWorkspace", () => {
|
|
|
35
45
|
for (const ext of ["yaml", "yml", "json"]) {
|
|
36
46
|
const ws = yield automation_1.LocalWorkspace.create({ workDir: upath.joinSafe(__dirname, "data", ext) });
|
|
37
47
|
const settings = yield ws.projectSettings();
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
assert_1.default(settings.name, "testproj");
|
|
49
|
+
assert_1.default(settings.runtime, "go");
|
|
50
|
+
assert_1.default(settings.description, "A minimal Go Pulumi program");
|
|
41
51
|
}
|
|
42
52
|
})));
|
|
43
53
|
it(`stackSettings from yaml/yml/json`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
54
|
for (const ext of ["yaml", "yml", "json"]) {
|
|
45
55
|
const ws = yield automation_1.LocalWorkspace.create({ workDir: upath.joinSafe(__dirname, "data", ext) });
|
|
46
56
|
const settings = yield ws.stackSettings("dev");
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
assert_1.default.strictEqual(settings.secretsProvider, "abc");
|
|
58
|
+
assert_1.default.strictEqual(settings.config["plain"], "plain");
|
|
59
|
+
assert_1.default.strictEqual(settings.config["secure"].secure, "secret");
|
|
50
60
|
}
|
|
51
61
|
})));
|
|
52
62
|
it(`adds/removes/lists plugins successfully`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -102,21 +112,21 @@ describe("LocalWorkspace", () => {
|
|
|
102
112
|
catch (error) {
|
|
103
113
|
caught++;
|
|
104
114
|
}
|
|
105
|
-
|
|
115
|
+
assert_1.default.strictEqual(caught, 1, "expected config get on empty value to throw");
|
|
106
116
|
let values = yield stack.getAllConfig();
|
|
107
|
-
|
|
117
|
+
assert_1.default.strictEqual(Object.keys(values).length, 0, "expected stack config to be empty");
|
|
108
118
|
yield stack.setAllConfig(config);
|
|
109
119
|
values = yield stack.getAllConfig();
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
120
|
+
assert_1.default.strictEqual(values[plainKey].value, "abc");
|
|
121
|
+
assert_1.default.strictEqual(values[plainKey].secret, false);
|
|
122
|
+
assert_1.default.strictEqual(values[secretKey].value, "def");
|
|
123
|
+
assert_1.default.strictEqual(values[secretKey].secret, true);
|
|
114
124
|
yield stack.removeConfig("plain");
|
|
115
125
|
values = yield stack.getAllConfig();
|
|
116
|
-
|
|
126
|
+
assert_1.default.strictEqual(Object.keys(values).length, 1, "expected stack config to have 1 value");
|
|
117
127
|
yield stack.setConfig("foo", { value: "bar" });
|
|
118
128
|
values = yield stack.getAllConfig();
|
|
119
|
-
|
|
129
|
+
assert_1.default.strictEqual(Object.keys(values).length, 2, "expected stack config to have 2 values");
|
|
120
130
|
yield ws.removeStack(stackName);
|
|
121
131
|
})));
|
|
122
132
|
it(`config_flag_like`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -131,19 +141,19 @@ describe("LocalWorkspace", () => {
|
|
|
131
141
|
yield stack.setConfig("key", { value: "-value" });
|
|
132
142
|
yield stack.setConfig("secret-key", { value: "-value", secret: true });
|
|
133
143
|
const values = yield stack.getAllConfig();
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
144
|
+
assert_1.default.strictEqual(values["config_flag_like:key"].value, "-value");
|
|
145
|
+
assert_1.default.strictEqual(values["config_flag_like:key"].secret, false);
|
|
146
|
+
assert_1.default.strictEqual(values["config_flag_like:secret-key"].value, "-value");
|
|
147
|
+
assert_1.default.strictEqual(values["config_flag_like:secret-key"].secret, true);
|
|
138
148
|
yield stack.setAllConfig({
|
|
139
149
|
"key": { value: "-value2" },
|
|
140
150
|
"secret-key": { value: "-value2", secret: true },
|
|
141
151
|
});
|
|
142
152
|
const values2 = yield stack.getAllConfig();
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
153
|
+
assert_1.default.strictEqual(values2["config_flag_like:key"].value, "-value2");
|
|
154
|
+
assert_1.default.strictEqual(values2["config_flag_like:key"].secret, false);
|
|
155
|
+
assert_1.default.strictEqual(values2["config_flag_like:secret-key"].value, "-value2");
|
|
156
|
+
assert_1.default.strictEqual(values2["config_flag_like:secret-key"].secret, true);
|
|
147
157
|
})));
|
|
148
158
|
it(`nested_config`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
149
159
|
if (getTestOrg() !== "pulumi-test") {
|
|
@@ -154,17 +164,17 @@ describe("LocalWorkspace", () => {
|
|
|
154
164
|
const stack = yield automation_1.LocalWorkspace.createOrSelectStack({ stackName, workDir });
|
|
155
165
|
const allConfig = yield stack.getAllConfig();
|
|
156
166
|
const outerVal = allConfig["nested_config:outer"];
|
|
157
|
-
|
|
158
|
-
|
|
167
|
+
assert_1.default.strictEqual(outerVal.secret, true);
|
|
168
|
+
assert_1.default.strictEqual(outerVal.value, "{\"inner\":\"my_secret\",\"other\":\"something_else\"}");
|
|
159
169
|
const listVal = allConfig["nested_config:myList"];
|
|
160
|
-
|
|
161
|
-
|
|
170
|
+
assert_1.default.strictEqual(listVal.secret, false);
|
|
171
|
+
assert_1.default.strictEqual(listVal.value, "[\"one\",\"two\",\"three\"]");
|
|
162
172
|
const outer = yield stack.getConfig("outer");
|
|
163
|
-
|
|
164
|
-
|
|
173
|
+
assert_1.default.strictEqual(outer.secret, true);
|
|
174
|
+
assert_1.default.strictEqual(outer.value, "{\"inner\":\"my_secret\",\"other\":\"something_else\"}");
|
|
165
175
|
const list = yield stack.getConfig("myList");
|
|
166
|
-
|
|
167
|
-
|
|
176
|
+
assert_1.default.strictEqual(list.secret, false);
|
|
177
|
+
assert_1.default.strictEqual(list.value, "[\"one\",\"two\",\"three\"]");
|
|
168
178
|
})));
|
|
169
179
|
it(`can list stacks and currently selected stack`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
170
180
|
const projectName = `node_list_test${getTestSuffix()}`;
|
|
@@ -180,9 +190,9 @@ describe("LocalWorkspace", () => {
|
|
|
180
190
|
stackNames[i] = stackName;
|
|
181
191
|
yield automation_1.Stack.create(stackName, ws);
|
|
182
192
|
const stackSummary = yield ws.stack();
|
|
183
|
-
|
|
193
|
+
assert_1.default.strictEqual(stackSummary === null || stackSummary === void 0 ? void 0 : stackSummary.current, true);
|
|
184
194
|
const stacks = yield ws.listStacks();
|
|
185
|
-
|
|
195
|
+
assert_1.default.strictEqual(stacks.length, i + 1);
|
|
186
196
|
}
|
|
187
197
|
for (const name of stackNames) {
|
|
188
198
|
yield ws.removeStack(name);
|
|
@@ -198,9 +208,9 @@ describe("LocalWorkspace", () => {
|
|
|
198
208
|
const stackName = automation_1.fullyQualifiedStackName(getTestOrg(), projectName, `int_test${getTestSuffix()}`);
|
|
199
209
|
const stack = yield automation_1.Stack.create(stackName, ws);
|
|
200
210
|
const history = yield stack.history();
|
|
201
|
-
|
|
211
|
+
assert_1.default.strictEqual(history.length, 0);
|
|
202
212
|
const info = yield stack.info();
|
|
203
|
-
|
|
213
|
+
assert_1.default.strictEqual(typeof (info), "undefined");
|
|
204
214
|
yield ws.removeStack(stackName);
|
|
205
215
|
})));
|
|
206
216
|
// TODO[pulumi/pulumi#8220] understand why this test was flaky
|
|
@@ -215,26 +225,26 @@ describe("LocalWorkspace", () => {
|
|
|
215
225
|
yield stack.setAllConfig(config);
|
|
216
226
|
// pulumi up
|
|
217
227
|
const upRes = yield stack.up({ userAgent });
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
228
|
+
assert_1.default.strictEqual(Object.keys(upRes.outputs).length, 3);
|
|
229
|
+
assert_1.default.strictEqual(upRes.outputs["exp_static"].value, "foo");
|
|
230
|
+
assert_1.default.strictEqual(upRes.outputs["exp_static"].secret, false);
|
|
231
|
+
assert_1.default.strictEqual(upRes.outputs["exp_cfg"].value, "abc");
|
|
232
|
+
assert_1.default.strictEqual(upRes.outputs["exp_cfg"].secret, false);
|
|
233
|
+
assert_1.default.strictEqual(upRes.outputs["exp_secret"].value, "secret");
|
|
234
|
+
assert_1.default.strictEqual(upRes.outputs["exp_secret"].secret, true);
|
|
235
|
+
assert_1.default.strictEqual(upRes.summary.kind, "update");
|
|
236
|
+
assert_1.default.strictEqual(upRes.summary.result, "succeeded");
|
|
227
237
|
// pulumi preview
|
|
228
238
|
const preRes = yield stack.preview({ userAgent });
|
|
229
|
-
|
|
239
|
+
assert_1.default.strictEqual(preRes.changeSummary.same, 1);
|
|
230
240
|
// pulumi refresh
|
|
231
241
|
const refRes = yield stack.refresh({ userAgent });
|
|
232
|
-
|
|
233
|
-
|
|
242
|
+
assert_1.default.strictEqual(refRes.summary.kind, "refresh");
|
|
243
|
+
assert_1.default.strictEqual(refRes.summary.result, "succeeded");
|
|
234
244
|
// pulumi destroy
|
|
235
245
|
const destroyRes = yield stack.destroy({ userAgent });
|
|
236
|
-
|
|
237
|
-
|
|
246
|
+
assert_1.default.strictEqual(destroyRes.summary.kind, "destroy");
|
|
247
|
+
assert_1.default.strictEqual(destroyRes.summary.result, "succeeded");
|
|
238
248
|
yield stack.workspace.removeStack(stackName);
|
|
239
249
|
})));
|
|
240
250
|
it(`runs through the stack lifecycle with an inline program`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -256,26 +266,26 @@ describe("LocalWorkspace", () => {
|
|
|
256
266
|
yield stack.setAllConfig(stackConfig);
|
|
257
267
|
// pulumi up
|
|
258
268
|
const upRes = yield stack.up({ userAgent });
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
269
|
+
assert_1.default.strictEqual(Object.keys(upRes.outputs).length, 3);
|
|
270
|
+
assert_1.default.strictEqual(upRes.outputs["exp_static"].value, "foo");
|
|
271
|
+
assert_1.default.strictEqual(upRes.outputs["exp_static"].secret, false);
|
|
272
|
+
assert_1.default.strictEqual(upRes.outputs["exp_cfg"].value, "abc");
|
|
273
|
+
assert_1.default.strictEqual(upRes.outputs["exp_cfg"].secret, false);
|
|
274
|
+
assert_1.default.strictEqual(upRes.outputs["exp_secret"].value, "secret");
|
|
275
|
+
assert_1.default.strictEqual(upRes.outputs["exp_secret"].secret, true);
|
|
276
|
+
assert_1.default.strictEqual(upRes.summary.kind, "update");
|
|
277
|
+
assert_1.default.strictEqual(upRes.summary.result, "succeeded");
|
|
268
278
|
// pulumi preview
|
|
269
279
|
const preRes = yield stack.preview({ userAgent });
|
|
270
|
-
|
|
280
|
+
assert_1.default.strictEqual(preRes.changeSummary.same, 1);
|
|
271
281
|
// pulumi refresh
|
|
272
282
|
const refRes = yield stack.refresh({ userAgent });
|
|
273
|
-
|
|
274
|
-
|
|
283
|
+
assert_1.default.strictEqual(refRes.summary.kind, "refresh");
|
|
284
|
+
assert_1.default.strictEqual(refRes.summary.result, "succeeded");
|
|
275
285
|
// pulumi destroy
|
|
276
286
|
const destroyRes = yield stack.destroy({ userAgent });
|
|
277
|
-
|
|
278
|
-
|
|
287
|
+
assert_1.default.strictEqual(destroyRes.summary.kind, "destroy");
|
|
288
|
+
assert_1.default.strictEqual(destroyRes.summary.result, "succeeded");
|
|
279
289
|
yield stack.workspace.removeStack(stackName);
|
|
280
290
|
})));
|
|
281
291
|
it(`successfully initializes multiple stacks`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -313,32 +323,32 @@ describe("LocalWorkspace", () => {
|
|
|
313
323
|
// pulumi up
|
|
314
324
|
const upResponses = yield Promise.all(stacks.map((stack) => __awaiter(void 0, void 0, void 0, function* () { return stack.up({ userAgent }); })));
|
|
315
325
|
upResponses.map(upRes => {
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
326
|
+
assert_1.default.strictEqual(Object.keys(upRes.outputs).length, 3);
|
|
327
|
+
assert_1.default.strictEqual(upRes.outputs["exp_static"].value, "foo");
|
|
328
|
+
assert_1.default.strictEqual(upRes.outputs["exp_static"].secret, false);
|
|
329
|
+
assert_1.default.strictEqual(upRes.outputs["exp_cfg"].value, "abc");
|
|
330
|
+
assert_1.default.strictEqual(upRes.outputs["exp_cfg"].secret, false);
|
|
331
|
+
assert_1.default.strictEqual(upRes.outputs["exp_secret"].value, "secret");
|
|
332
|
+
assert_1.default.strictEqual(upRes.outputs["exp_secret"].secret, true);
|
|
333
|
+
assert_1.default.strictEqual(upRes.summary.kind, "update");
|
|
334
|
+
assert_1.default.strictEqual(upRes.summary.result, "succeeded");
|
|
325
335
|
});
|
|
326
336
|
// pulumi preview
|
|
327
337
|
const preResponses = yield Promise.all(stacks.map((stack) => __awaiter(void 0, void 0, void 0, function* () { return stack.preview({ userAgent }); })));
|
|
328
338
|
preResponses.map(preRes => {
|
|
329
|
-
|
|
339
|
+
assert_1.default.strictEqual(preRes.changeSummary.same, 1);
|
|
330
340
|
});
|
|
331
341
|
// pulumi refresh
|
|
332
342
|
const refResponses = yield Promise.all(stacks.map((stack) => __awaiter(void 0, void 0, void 0, function* () { return yield stack.refresh({ userAgent }); })));
|
|
333
343
|
refResponses.map(refRes => {
|
|
334
|
-
|
|
335
|
-
|
|
344
|
+
assert_1.default.strictEqual(refRes.summary.kind, "refresh");
|
|
345
|
+
assert_1.default.strictEqual(refRes.summary.result, "succeeded");
|
|
336
346
|
});
|
|
337
347
|
// pulumi destroy
|
|
338
348
|
const destroyResponses = yield Promise.all(stacks.map((stack) => __awaiter(void 0, void 0, void 0, function* () { return yield stack.destroy({ userAgent }); })));
|
|
339
349
|
destroyResponses.map(destroyRes => {
|
|
340
|
-
|
|
341
|
-
|
|
350
|
+
assert_1.default.strictEqual(destroyRes.summary.kind, "destroy");
|
|
351
|
+
assert_1.default.strictEqual(destroyRes.summary.result, "succeeded");
|
|
342
352
|
});
|
|
343
353
|
yield Promise.all(stacks.map((stack) => __awaiter(void 0, void 0, void 0, function* () { return stack.workspace.removeStack(stack.name); })));
|
|
344
354
|
})));
|
|
@@ -367,31 +377,31 @@ describe("LocalWorkspace", () => {
|
|
|
367
377
|
};
|
|
368
378
|
// pulumi preview
|
|
369
379
|
const preRes = yield stack.preview({ onEvent: findSummaryEvent });
|
|
370
|
-
|
|
371
|
-
|
|
380
|
+
assert_1.default.strictEqual(seenSummaryEvent, true, "No SummaryEvent for `preview`");
|
|
381
|
+
assert_1.default.strictEqual(preRes.changeSummary.create, 1);
|
|
372
382
|
// pulumi up
|
|
373
383
|
seenSummaryEvent = false;
|
|
374
384
|
const upRes = yield stack.up({ onEvent: findSummaryEvent });
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
385
|
+
assert_1.default.strictEqual(seenSummaryEvent, true, "No SummaryEvent for `up`");
|
|
386
|
+
assert_1.default.strictEqual(upRes.summary.kind, "update");
|
|
387
|
+
assert_1.default.strictEqual(upRes.summary.result, "succeeded");
|
|
378
388
|
// pulumi preview
|
|
379
389
|
seenSummaryEvent = false;
|
|
380
390
|
const preResAgain = yield stack.preview({ onEvent: findSummaryEvent });
|
|
381
|
-
|
|
382
|
-
|
|
391
|
+
assert_1.default.strictEqual(seenSummaryEvent, true, "No SummaryEvent for `preview`");
|
|
392
|
+
assert_1.default.strictEqual(preResAgain.changeSummary.same, 1);
|
|
383
393
|
// pulumi refresh
|
|
384
394
|
seenSummaryEvent = false;
|
|
385
395
|
const refRes = yield stack.refresh({ onEvent: findSummaryEvent });
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
396
|
+
assert_1.default.strictEqual(seenSummaryEvent, true, "No SummaryEvent for `refresh`");
|
|
397
|
+
assert_1.default.strictEqual(refRes.summary.kind, "refresh");
|
|
398
|
+
assert_1.default.strictEqual(refRes.summary.result, "succeeded");
|
|
389
399
|
// pulumi destroy
|
|
390
400
|
seenSummaryEvent = false;
|
|
391
401
|
const destroyRes = yield stack.destroy({ onEvent: findSummaryEvent });
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
402
|
+
assert_1.default.strictEqual(seenSummaryEvent, true, "No SummaryEvent for `destroy`");
|
|
403
|
+
assert_1.default.strictEqual(destroyRes.summary.kind, "destroy");
|
|
404
|
+
assert_1.default.strictEqual(destroyRes.summary.result, "succeeded");
|
|
395
405
|
yield stack.workspace.removeStack(stackName);
|
|
396
406
|
})));
|
|
397
407
|
// TODO[pulumi/pulumi#7127]: Re-enabled the warning.
|
|
@@ -523,11 +533,11 @@ describe("LocalWorkspace", () => {
|
|
|
523
533
|
break;
|
|
524
534
|
}
|
|
525
535
|
}
|
|
526
|
-
|
|
536
|
+
assert_1.default.strictEqual(found, true, `expected warning not found`);
|
|
527
537
|
}
|
|
528
538
|
for (const unexpected of unexpectedWarnings) {
|
|
529
539
|
for (const warning of warnings) {
|
|
530
|
-
|
|
540
|
+
assert_1.default.strictEqual(warning.includes(unexpected), false, `Unexpected '${unexpected}' found in warning`);
|
|
531
541
|
}
|
|
532
542
|
}
|
|
533
543
|
};
|
|
@@ -563,12 +573,12 @@ describe("LocalWorkspace", () => {
|
|
|
563
573
|
// import stack
|
|
564
574
|
yield stack.importStack(state);
|
|
565
575
|
const configVal = yield stack.getConfig("bar");
|
|
566
|
-
|
|
576
|
+
assert_1.default.strictEqual(configVal.value, "abc");
|
|
567
577
|
}
|
|
568
578
|
finally {
|
|
569
579
|
const destroyRes = yield stack.destroy();
|
|
570
|
-
|
|
571
|
-
|
|
580
|
+
assert_1.default.strictEqual(destroyRes.summary.kind, "destroy");
|
|
581
|
+
assert_1.default.strictEqual(destroyRes.summary.result, "succeeded");
|
|
572
582
|
yield stack.workspace.removeStack(stackName);
|
|
573
583
|
}
|
|
574
584
|
})));
|
|
@@ -586,13 +596,13 @@ describe("LocalWorkspace", () => {
|
|
|
586
596
|
const stackName = automation_1.fullyQualifiedStackName(getTestOrg(), projectName, `int_test${getTestSuffix()}`);
|
|
587
597
|
const stack = yield automation_1.LocalWorkspace.createStack({ stackName, projectName, program });
|
|
588
598
|
const assertOutputs = (outputs) => {
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
599
|
+
assert_1.default.strictEqual(Object.keys(outputs).length, 3, "expected to have 3 outputs");
|
|
600
|
+
assert_1.default.strictEqual(outputs["exp_static"].value, "foo");
|
|
601
|
+
assert_1.default.strictEqual(outputs["exp_static"].secret, false);
|
|
602
|
+
assert_1.default.strictEqual(outputs["exp_cfg"].value, "abc");
|
|
603
|
+
assert_1.default.strictEqual(outputs["exp_cfg"].secret, false);
|
|
604
|
+
assert_1.default.strictEqual(outputs["exp_secret"].value, "secret");
|
|
605
|
+
assert_1.default.strictEqual(outputs["exp_secret"].secret, true);
|
|
596
606
|
};
|
|
597
607
|
try {
|
|
598
608
|
yield stack.setAllConfig({
|
|
@@ -600,19 +610,19 @@ describe("LocalWorkspace", () => {
|
|
|
600
610
|
"buzz": { value: "secret", secret: true },
|
|
601
611
|
});
|
|
602
612
|
const initialOutputs = yield stack.outputs();
|
|
603
|
-
|
|
613
|
+
assert_1.default.strictEqual(Object.keys(initialOutputs).length, 0, "expected initialOutputs to be empty");
|
|
604
614
|
// pulumi up
|
|
605
615
|
const upRes = yield stack.up();
|
|
606
|
-
|
|
607
|
-
|
|
616
|
+
assert_1.default.strictEqual(upRes.summary.kind, "update");
|
|
617
|
+
assert_1.default.strictEqual(upRes.summary.result, "succeeded");
|
|
608
618
|
assertOutputs(upRes.outputs);
|
|
609
619
|
const outputsAfterUp = yield stack.outputs();
|
|
610
620
|
assertOutputs(outputsAfterUp);
|
|
611
621
|
const destroyRes = yield stack.destroy();
|
|
612
|
-
|
|
613
|
-
|
|
622
|
+
assert_1.default.strictEqual(destroyRes.summary.kind, "destroy");
|
|
623
|
+
assert_1.default.strictEqual(destroyRes.summary.result, "succeeded");
|
|
614
624
|
const outputsAfterDestroy = yield stack.outputs();
|
|
615
|
-
|
|
625
|
+
assert_1.default.strictEqual(Object.keys(outputsAfterDestroy).length, 0, "expected outputsAfterDestroy to be empty");
|
|
616
626
|
}
|
|
617
627
|
finally {
|
|
618
628
|
yield stack.workspace.removeStack(stackName);
|
|
@@ -627,11 +637,11 @@ describe("LocalWorkspace", () => {
|
|
|
627
637
|
const stackName = automation_1.fullyQualifiedStackName(getTestOrg(), projectName, `int_test${getTestSuffix()}`);
|
|
628
638
|
const stack = yield automation_1.LocalWorkspace.createStack({ stackName, projectName, program });
|
|
629
639
|
// pulumi up
|
|
630
|
-
yield
|
|
640
|
+
yield assert_1.default.rejects(stack.up());
|
|
631
641
|
// pulumi destroy
|
|
632
642
|
const destroyRes = yield stack.destroy();
|
|
633
|
-
|
|
634
|
-
|
|
643
|
+
assert_1.default.strictEqual(destroyRes.summary.kind, "destroy");
|
|
644
|
+
assert_1.default.strictEqual(destroyRes.summary.result, "succeeded");
|
|
635
645
|
yield stack.workspace.removeStack(stackName);
|
|
636
646
|
})));
|
|
637
647
|
it(`detects inline programs with side by side pulumi and throws an error`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -653,28 +663,28 @@ describe("LocalWorkspace", () => {
|
|
|
653
663
|
const stackName = automation_1.fullyQualifiedStackName(getTestOrg(), projectName, `int_test${getTestSuffix()}`);
|
|
654
664
|
const stack = yield automation_1.LocalWorkspace.createStack({ stackName, projectName, program });
|
|
655
665
|
// pulumi up
|
|
656
|
-
yield
|
|
666
|
+
yield assert_1.default.rejects(stack.up(), (err) => {
|
|
657
667
|
return err.stack.indexOf("Detected multiple versions of '@pulumi/pulumi'") >= 0;
|
|
658
668
|
});
|
|
659
669
|
// pulumi destroy
|
|
660
670
|
const destroyRes = yield stack.destroy();
|
|
661
|
-
|
|
662
|
-
|
|
671
|
+
assert_1.default.strictEqual(destroyRes.summary.kind, "destroy");
|
|
672
|
+
assert_1.default.strictEqual(destroyRes.summary.result, "succeeded");
|
|
663
673
|
yield stack.workspace.removeStack(stackName);
|
|
664
674
|
})));
|
|
665
675
|
it(`sets pulumi version`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
666
676
|
const ws = yield automation_1.LocalWorkspace.create({});
|
|
667
|
-
|
|
668
|
-
|
|
677
|
+
assert_1.default(ws.pulumiVersion);
|
|
678
|
+
assert_1.default.strictEqual(versionRegex.test(ws.pulumiVersion), true);
|
|
669
679
|
})));
|
|
670
680
|
it(`respects existing project settings`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
671
681
|
const projectName = "correct_project";
|
|
672
682
|
const stackName = automation_1.fullyQualifiedStackName(getTestOrg(), projectName, `int_test${getTestSuffix()}`);
|
|
673
683
|
const stack = yield automation_1.LocalWorkspace.createStack({ stackName, projectName, program: () => __awaiter(void 0, void 0, void 0, function* () { return; }) }, { workDir: upath.joinSafe(__dirname, "data", "correct_project") });
|
|
674
684
|
const projectSettings = yield stack.workspace.projectSettings();
|
|
675
|
-
|
|
685
|
+
assert_1.default.strictEqual(projectSettings.name, "correct_project");
|
|
676
686
|
// the description check is enough to verify that the stack wasn't overwritten
|
|
677
|
-
|
|
687
|
+
assert_1.default.strictEqual(projectSettings.description, "This is a description");
|
|
678
688
|
yield stack.workspace.removeStack(stackName);
|
|
679
689
|
})));
|
|
680
690
|
it(`correctly sets config on multiple stacks concurrently`, util_1.asyncTest(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -711,7 +721,7 @@ describe("LocalWorkspace", () => {
|
|
|
711
721
|
workDir,
|
|
712
722
|
});
|
|
713
723
|
const config = yield stack.getAllConfig();
|
|
714
|
-
|
|
724
|
+
assert_1.default.strictEqual(Object.keys(config).length, 20);
|
|
715
725
|
yield stack.workspace.removeStack(stacks[i]);
|
|
716
726
|
}
|
|
717
727
|
})));
|
|
@@ -800,10 +810,10 @@ describe(`checkVersionIsValid`, () => {
|
|
|
800
810
|
it(`validates ${test.name} (${test.currentVersion})`, () => {
|
|
801
811
|
const validate = () => automation_1.parseAndValidatePulumiVersion(minVersion, test.currentVersion, test.optOut);
|
|
802
812
|
if (test.expectError) {
|
|
803
|
-
|
|
813
|
+
assert_1.default.throws(validate, test.expectError);
|
|
804
814
|
}
|
|
805
815
|
else {
|
|
806
|
-
|
|
816
|
+
assert_1.default.doesNotThrow(validate);
|
|
807
817
|
}
|
|
808
818
|
});
|
|
809
819
|
});
|