@pulumi/pulumi 3.135.2-alpha.xaa9ca8a → 3.136.0-alpha.x6315637
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/package.json +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/npm/testdata/nested/project/index.d.ts +0 -0
- package/npm/testdata/nested/project/index.js +0 -16
- package/npm/testdata/nested/project/index.js.map +0 -1
- package/tests/automation/cmd.spec.d.ts +0 -1
- package/tests/automation/cmd.spec.js +0 -186
- package/tests/automation/cmd.spec.js.map +0 -1
- package/tests/automation/data/correct_project/Pulumi.yaml +0 -3
- package/tests/automation/data/import/Pulumi.yaml +0 -2
- package/tests/automation/data/import/expected_generated_code.txt +0 -11
- package/tests/automation/data/json/Pulumi.dev.json +0 -9
- package/tests/automation/data/json/Pulumi.json +0 -5
- package/tests/automation/data/nested_config/Pulumi.dev.yaml +0 -11
- package/tests/automation/data/nested_config/Pulumi.yaml +0 -3
- package/tests/automation/data/tcfg/Pulumi.yaml +0 -4
- package/tests/automation/data/tcfg/index.ts +0 -1
- package/tests/automation/data/tcfg/package-lock.json +0 -3062
- package/tests/automation/data/tcfg/package.json +0 -9
- package/tests/automation/data/tcfg/tsconfig.json +0 -16
- package/tests/automation/data/testproj/Pulumi.yaml +0 -3
- package/tests/automation/data/testproj/go.mod +0 -71
- package/tests/automation/data/testproj/go.sum +0 -299
- package/tests/automation/data/testproj/main.go +0 -19
- package/tests/automation/data/testproj_dotnet/Program.cs +0 -12
- package/tests/automation/data/testproj_dotnet/Pulumi.yaml +0 -3
- package/tests/automation/data/testproj_dotnet/TestProj.csproj +0 -12
- package/tests/automation/data/yaml/Pulumi.dev.yaml +0 -5
- package/tests/automation/data/yaml/Pulumi.yaml +0 -3
- package/tests/automation/data/yml/Pulumi.dev.yml +0 -5
- package/tests/automation/data/yml/Pulumi.yml +0 -3
- package/tests/automation/localWorkspace.spec.d.ts +0 -1
- package/tests/automation/localWorkspace.spec.js +0 -1325
- package/tests/automation/localWorkspace.spec.js.map +0 -1
- package/tests/automation/remoteWorkspace.spec.d.ts +0 -1
- package/tests/automation/remoteWorkspace.spec.js +0 -460
- package/tests/automation/remoteWorkspace.spec.js.map +0 -1
- package/tests/automation/util.d.ts +0 -1
- package/tests/automation/util.js +0 -31
- package/tests/automation/util.js.map +0 -1
- package/tests/config.spec.d.ts +0 -1
- package/tests/config.spec.js +0 -177
- package/tests/config.spec.js.map +0 -1
- package/tests/constants.d.ts +0 -1
- package/tests/constants.js +0 -18
- package/tests/constants.js.map +0 -1
- package/tests/init.spec.d.ts +0 -1
- package/tests/init.spec.js +0 -18
- package/tests/init.spec.js.map +0 -1
- package/tests/iterable.spec.d.ts +0 -1
- package/tests/iterable.spec.js +0 -60
- package/tests/iterable.spec.js.map +0 -1
- package/tests/options.spec.d.ts +0 -1
- package/tests/options.spec.js +0 -233
- package/tests/options.spec.js.map +0 -1
- package/tests/output.spec.d.ts +0 -1
- package/tests/output.spec.js +0 -809
- package/tests/output.spec.js.map +0 -1
- package/tests/provider.spec.d.ts +0 -1
- package/tests/provider.spec.js +0 -524
- package/tests/provider.spec.js.map +0 -1
- package/tests/resource.spec.d.ts +0 -1
- package/tests/resource.spec.js +0 -275
- package/tests/resource.spec.js.map +0 -1
- package/tests/runtime/asyncIterableUtil.spec.d.ts +0 -1
- package/tests/runtime/asyncIterableUtil.spec.js +0 -115
- package/tests/runtime/asyncIterableUtil.spec.js.map +0 -1
- package/tests/runtime/closure-integration-tests.d.ts +0 -1
- package/tests/runtime/closure-integration-tests.js +0 -120
- package/tests/runtime/closure-integration-tests.js.map +0 -1
- package/tests/runtime/findWorkspaceRoot.spec.d.ts +0 -1
- package/tests/runtime/findWorkspaceRoot.spec.js +0 -62
- package/tests/runtime/findWorkspaceRoot.spec.js.map +0 -1
- package/tests/runtime/install-package-tests.d.ts +0 -1
- package/tests/runtime/install-package-tests.js +0 -230
- package/tests/runtime/install-package-tests.js.map +0 -1
- package/tests/runtime/langhost/cases/000.empty/index.js +0 -1
- package/tests/runtime/langhost/cases/001.one_resource/index.js +0 -11
- package/tests/runtime/langhost/cases/002.ten_resources/index.js +0 -13
- package/tests/runtime/langhost/cases/003.one_complex_resource/index.js +0 -77
- package/tests/runtime/langhost/cases/004.ten_complex_resources/index.js +0 -38
- package/tests/runtime/langhost/cases/004.ten_complex_resources/resource.js +0 -30
- package/tests/runtime/langhost/cases/005.resource_thens/index.js +0 -72
- package/tests/runtime/langhost/cases/006.asset/index.js +0 -13
- package/tests/runtime/langhost/cases/006.asset/testdata.txt +0 -4
- package/tests/runtime/langhost/cases/007.promises_io/index.js +0 -25
- package/tests/runtime/langhost/cases/007.promises_io/testdata.txt +0 -4
- package/tests/runtime/langhost/cases/008.ten_depends_on_resources/index.js +0 -46
- package/tests/runtime/langhost/cases/009.invoke/index.js +0 -25
- package/tests/runtime/langhost/cases/010.runtime_settings/index.js +0 -22
- package/tests/runtime/langhost/cases/011.unhandled_error/index.js +0 -1
- package/tests/runtime/langhost/cases/012.assets_archive/index.js +0 -25
- package/tests/runtime/langhost/cases/013.unhandled_promise_rejection/index.js +0 -3
- package/tests/runtime/langhost/cases/014.read_resource/index.js +0 -19
- package/tests/runtime/langhost/cases/015.runtime_sxs/index.js +0 -100
- package/tests/runtime/langhost/cases/016.promise_leak/index.js +0 -3
- package/tests/runtime/langhost/cases/017.parent_defaults/index.js +0 -89
- package/tests/runtime/langhost/cases/018.logging/index.js +0 -15
- package/tests/runtime/langhost/cases/019.stack_exports/index.js +0 -15
- package/tests/runtime/langhost/cases/020.property_dependencies/index.js +0 -39
- package/tests/runtime/langhost/cases/021.parent_child_dependencies/index.js +0 -15
- package/tests/runtime/langhost/cases/022.parent_child_dependencies_2/index.js +0 -16
- package/tests/runtime/langhost/cases/023.parent_child_dependencies_3/index.js +0 -28
- package/tests/runtime/langhost/cases/024.parent_child_dependencies_4/index.js +0 -22
- package/tests/runtime/langhost/cases/025.parent_child_dependencies_5/index.js +0 -24
- package/tests/runtime/langhost/cases/026.parent_child_dependencies_6/index.js +0 -29
- package/tests/runtime/langhost/cases/027.parent_child_dependencies_7/index.js +0 -36
- package/tests/runtime/langhost/cases/028.parent_child_dependencies_8/index.js +0 -28
- package/tests/runtime/langhost/cases/029.parent_child_dependencies_9/index.js +0 -23
- package/tests/runtime/langhost/cases/030.import_resource/index.js +0 -11
- package/tests/runtime/langhost/cases/040.run_error/index.js +0 -3
- package/tests/runtime/langhost/cases/041.component_opt_single_provider/index.js +0 -89
- package/tests/runtime/langhost/cases/042.component_opt_providers_array/index.js +0 -89
- package/tests/runtime/langhost/cases/043.depends_on_non_resource/index.js +0 -11
- package/tests/runtime/langhost/cases/044.versions/index.js +0 -22
- package/tests/runtime/langhost/cases/045.ignore_changes/index.js +0 -11
- package/tests/runtime/langhost/cases/046.recursive_stack_exports/index.js +0 -19
- package/tests/runtime/langhost/cases/047.exported_function/index.js +0 -13
- package/tests/runtime/langhost/cases/048.exported_promise_function/index.js +0 -13
- package/tests/runtime/langhost/cases/049.exported_async_function/index.js +0 -13
- package/tests/runtime/langhost/cases/050.resource_creation_in_function/index.js +0 -11
- package/tests/runtime/langhost/cases/051.resource_creation_in_function_with_result/index.js +0 -12
- package/tests/runtime/langhost/cases/052.resource_creation_in_async_function_with_result/index.js +0 -12
- package/tests/runtime/langhost/cases/060.provider_invokes/index.js +0 -26
- package/tests/runtime/langhost/cases/061.provider_in_parent_invokes/index.js +0 -33
- package/tests/runtime/langhost/cases/062.providerref_invokes/index.js +0 -33
- package/tests/runtime/langhost/cases/063.providerref_in_parent_invokes/index.js +0 -41
- package/tests/runtime/langhost/cases/064.async_components/index.js +0 -44
- package/tests/runtime/langhost/cases/065.large_resource/index.js +0 -17
- package/tests/runtime/langhost/cases/066.replace_on_changes/index.js +0 -11
- package/tests/runtime/langhost/cases/067.native_es_module/index.js +0 -11
- package/tests/runtime/langhost/cases/067.native_es_module/package.json +0 -1
- package/tests/runtime/langhost/cases/068.remote_component_providers/index.js +0 -34
- package/tests/runtime/langhost/cases/068.remote_component_providers/package.json +0 -3
- package/tests/runtime/langhost/cases/069.ambiguous_entrypoints/index.d.ts +0 -1
- package/tests/runtime/langhost/cases/069.ambiguous_entrypoints/index.js +0 -11
- package/tests/runtime/langhost/cases/069.ambiguous_entrypoints/index.js.map +0 -1
- package/tests/runtime/langhost/cases/069.ambiguous_entrypoints/index.ts +0 -23
- package/tests/runtime/langhost/cases/070.unusual_alias_names/index.js +0 -26
- package/tests/runtime/langhost/cases/071.large_alias_counts/index.js +0 -22
- package/tests/runtime/langhost/cases/072.large_alias_lineage_chains/index.js +0 -55
- package/tests/runtime/langhost/cases/073.component_dependencies/index.js +0 -28
- package/tests/runtime/langhost/cases/074.source_position/index.js +0 -17
- package/tests/runtime/langhost/run.spec.d.ts +0 -1
- package/tests/runtime/langhost/run.spec.js +0 -1685
- package/tests/runtime/langhost/run.spec.js.map +0 -1
- package/tests/runtime/pack.d.ts +0 -1
- package/tests/runtime/pack.js +0 -56
- package/tests/runtime/pack.js.map +0 -1
- package/tests/runtime/props.spec.d.ts +0 -1
- package/tests/runtime/props.spec.js +0 -387
- package/tests/runtime/props.spec.js.map +0 -1
- package/tests/runtime/registrations.spec.d.ts +0 -1
- package/tests/runtime/registrations.spec.js +0 -139
- package/tests/runtime/registrations.spec.js.map +0 -1
- package/tests/runtime/rpc.spec.d.ts +0 -1
- package/tests/runtime/rpc.spec.js +0 -79
- package/tests/runtime/rpc.spec.js.map +0 -1
- package/tests/runtime/settings.spec.d.ts +0 -1
- package/tests/runtime/settings.spec.js +0 -57
- package/tests/runtime/settings.spec.js.map +0 -1
- package/tests/runtime/testdata/nested/project/index.d.ts +0 -0
- package/tests/runtime/testdata/nested/project/index.js +0 -16
- package/tests/runtime/testdata/nested/project/index.js.map +0 -1
- package/tests/stackReference.spec.d.ts +0 -1
- package/tests/stackReference.spec.js +0 -86
- package/tests/stackReference.spec.js.map +0 -1
- package/tests/unwrap.spec.d.ts +0 -1
- package/tests/unwrap.spec.js +0 -254
- package/tests/unwrap.spec.js.map +0 -1
- package/tests/util.d.ts +0 -1
- package/tests/util.js +0 -71
- package/tests/util.js.map +0 -1
- package/tests_with_mocks/mocks.spec.d.ts +0 -1
- package/tests_with_mocks/mocks.spec.js +0 -182
- package/tests_with_mocks/mocks.spec.js.map +0 -1
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright 2016-2022, Pulumi Corporation.
|
|
3
|
-
//
|
|
4
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
28
|
-
result["default"] = mod;
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
const assert = __importStar(require("assert"));
|
|
33
|
-
const path = __importStar(require("path"));
|
|
34
|
-
const codePaths_1 = require("../../runtime/closure/codePaths");
|
|
35
|
-
const testdata = (...p) => path.join(__dirname, "..", "..", "..", "tests", "runtime", "testdata", ...p);
|
|
36
|
-
describe("findWorkspaceRoot", () => {
|
|
37
|
-
it("finds the root of a workspace", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
-
const root = yield codePaths_1.findWorkspaceRoot(testdata("workspace", "project"));
|
|
39
|
-
assert.notStrictEqual(root, null);
|
|
40
|
-
assert.strictEqual(root, testdata("workspace"));
|
|
41
|
-
}));
|
|
42
|
-
it("returns null if we are not in a workspace", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
-
const root = yield codePaths_1.findWorkspaceRoot(testdata("nested", "project"));
|
|
44
|
-
assert.strictEqual(root, null);
|
|
45
|
-
}));
|
|
46
|
-
it("finds the root of a workspace when using yarn's extended declaration", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
|
-
const root = yield codePaths_1.findWorkspaceRoot(testdata("workspace-extended", "project"));
|
|
48
|
-
assert.notStrictEqual(root, null);
|
|
49
|
-
assert.strictEqual(root, testdata("workspace-extended"));
|
|
50
|
-
}));
|
|
51
|
-
it("finds the root of a workspace when in a nested directory", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
52
|
-
const root = yield codePaths_1.findWorkspaceRoot(testdata("workspace-nested", "project", "dist"));
|
|
53
|
-
assert.notStrictEqual(root, null);
|
|
54
|
-
assert.strictEqual(root, testdata("workspace-nested"));
|
|
55
|
-
}));
|
|
56
|
-
it("finds the root of a workspace passing a file as argument", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
57
|
-
const root = yield codePaths_1.findWorkspaceRoot(testdata("workspace-nested", "project", "dist", "index.js"));
|
|
58
|
-
assert.notStrictEqual(root, null);
|
|
59
|
-
assert.strictEqual(root, testdata("workspace-nested"));
|
|
60
|
-
}));
|
|
61
|
-
});
|
|
62
|
-
//# sourceMappingURL=findWorkspaceRoot.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"findWorkspaceRoot.spec.js","sourceRoot":"","sources":["../../../tests/runtime/findWorkspaceRoot.spec.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;;;;;;;;;AAEjC,+CAAiC;AACjC,2CAA6B;AAC7B,+DAAoE;AAEpE,MAAM,QAAQ,GAAG,CAAC,GAAG,CAAW,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;AAElH,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,+BAA+B,EAAE,GAAS,EAAE;QAC3C,MAAM,IAAI,GAAG,MAAM,6BAAiB,CAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;QACvE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAClC,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;IACpD,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,2CAA2C,EAAE,GAAS,EAAE;QACvD,MAAM,IAAI,GAAG,MAAM,6BAAiB,CAAC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC;QACpE,MAAM,CAAC,WAA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the Apache License, Version 2.0 (the "License");
|
|
5
|
-
// you may not use this file except in compliance with the License.
|
|
6
|
-
// You may obtain a copy of the License at
|
|
7
|
-
//
|
|
8
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
//
|
|
10
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
// See the License for the specific language governing permissions and
|
|
14
|
-
// limitations under the License.
|
|
15
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
-
});
|
|
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
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
const crypto_1 = require("crypto");
|
|
36
|
-
const execa_1 = __importDefault(require("execa"));
|
|
37
|
-
const fs = __importStar(require("fs/promises"));
|
|
38
|
-
const path = __importStar(require("path"));
|
|
39
|
-
const process = __importStar(require("process"));
|
|
40
|
-
const tmp = __importStar(require("tmp"));
|
|
41
|
-
const pack_1 = require("./pack");
|
|
42
|
-
// Write a package.json that installs the local pulumi package and optional dependencies.
|
|
43
|
-
function writePackageJSON(dir, pulumiPackagePath, dependencies) {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const packageJSON = {
|
|
46
|
-
name: "install-package-tests",
|
|
47
|
-
version: "1.0.0",
|
|
48
|
-
license: "Apache-2.0",
|
|
49
|
-
dependencies: Object.assign({ "@pulumi/pulumi": pulumiPackagePath }, dependencies),
|
|
50
|
-
};
|
|
51
|
-
yield fs.writeFile(path.join(dir, "package.json"), JSON.stringify(packageJSON, undefined, 4));
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function writeTSConfig(dir) {
|
|
55
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const tsconfigJSON = {
|
|
57
|
-
compilerOptions: {
|
|
58
|
-
strict: true,
|
|
59
|
-
target: "es2016",
|
|
60
|
-
module: "commonjs",
|
|
61
|
-
moduleResolution: "node",
|
|
62
|
-
declaration: true,
|
|
63
|
-
resolveJsonModule: true,
|
|
64
|
-
sourceMap: true,
|
|
65
|
-
stripInternal: true,
|
|
66
|
-
experimentalDecorators: true,
|
|
67
|
-
pretty: true,
|
|
68
|
-
noFallthroughCasesInSwitch: true,
|
|
69
|
-
noImplicitReturns: true,
|
|
70
|
-
forceConsistentCasingInFileNames: true,
|
|
71
|
-
esModuleInterop: true,
|
|
72
|
-
},
|
|
73
|
-
include: ["index.ts"],
|
|
74
|
-
};
|
|
75
|
-
yield fs.writeFile(path.join(dir, "tsconfig.json"), JSON.stringify(tsconfigJSON, undefined, 4));
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
// A simple TypeScript Pulumi program to test that we can load and run TypeScript code.
|
|
79
|
-
function writeProgram(dir, projectName) {
|
|
80
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
const indexTS = `import * as pulumi from "@pulumi/pulumi";
|
|
82
|
-
pulumi.runtime.serializeFunction(() => 42);
|
|
83
|
-
export const test: number = 42;
|
|
84
|
-
`;
|
|
85
|
-
yield fs.writeFile(path.join(dir, "index.ts"), indexTS);
|
|
86
|
-
const project = `name: ${projectName}
|
|
87
|
-
runtime: nodejs
|
|
88
|
-
backend:
|
|
89
|
-
url: 'file://~'
|
|
90
|
-
`;
|
|
91
|
-
yield fs.writeFile(path.join(dir, "Pulumi.yaml"), project);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function exec(command, args, options) {
|
|
95
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
96
|
-
const message = `$ ${command} ${args.join(" ")}'\n`;
|
|
97
|
-
const result = yield execa_1.default(command, args, options);
|
|
98
|
-
return message + result.stdout;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
function main() {
|
|
102
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
const sdkRoot = path.join(__dirname, "..", "..", "..");
|
|
104
|
-
const sdkRootBin = path.join(sdkRoot, "bin");
|
|
105
|
-
const tmpPackageDir = tmp.dirSync({ prefix: "pulumi-package-", unsafeCleanup: true });
|
|
106
|
-
try {
|
|
107
|
-
// Add a random suffix to the package name to avoid any issues with yarn caching the tgz.
|
|
108
|
-
const packageName = `pulumi-${crypto_1.randomInt(10000, 99999)}.tgz`;
|
|
109
|
-
const pulumiPackagePath = path.join(tmpPackageDir.name, packageName);
|
|
110
|
-
yield pack_1.pack(sdkRootBin, pulumiPackagePath);
|
|
111
|
-
const packageManagers = [
|
|
112
|
-
{
|
|
113
|
-
name: "npm",
|
|
114
|
-
// This version doesn't install peer dependencies automatically.
|
|
115
|
-
version: "^6.0.0",
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
name: "npm",
|
|
119
|
-
version: "*",
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
name: "yarn",
|
|
123
|
-
// This version doesn't install peer dependencies automatically.
|
|
124
|
-
version: "^1.0.0",
|
|
125
|
-
},
|
|
126
|
-
// We don't support yarn >= 2 yet.
|
|
127
|
-
// {
|
|
128
|
-
// packageManager: "yarn",
|
|
129
|
-
// version: "*", // Latest version.
|
|
130
|
-
// },
|
|
131
|
-
{
|
|
132
|
-
name: "pnpm",
|
|
133
|
-
version: "*",
|
|
134
|
-
},
|
|
135
|
-
];
|
|
136
|
-
// Dependencies to add to package.json.
|
|
137
|
-
const dependencies = [
|
|
138
|
-
{
|
|
139
|
-
// No explicit typescript or ts-node versions, use the vendored versions.
|
|
140
|
-
typescript: undefined,
|
|
141
|
-
"ts-node": undefined,
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
typescript: "~3.8.3",
|
|
145
|
-
"ts-node": "^7.0.1",
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
typescript: "^4.0.0",
|
|
149
|
-
"ts-node": undefined,
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
typescript: "^5.0.0",
|
|
153
|
-
"ts-node": undefined,
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
typescript: "^5.0.0",
|
|
157
|
-
"ts-node": "^10.0.0",
|
|
158
|
-
},
|
|
159
|
-
];
|
|
160
|
-
for (const pm of packageManagers) {
|
|
161
|
-
for (const deps of dependencies) {
|
|
162
|
-
const tmpDir = tmp.dirSync({ prefix: "install-test-", unsafeCleanup: true });
|
|
163
|
-
try {
|
|
164
|
-
yield runTest(tmpDir, pulumiPackagePath, pm.name, pm.version, deps);
|
|
165
|
-
}
|
|
166
|
-
finally {
|
|
167
|
-
tmpDir.removeCallback();
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
finally {
|
|
173
|
-
tmpPackageDir.removeCallback();
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
function runTest(tmpDir, pulumiPackagePath, packageManager, packageManagerVersion, peerDeps) {
|
|
178
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
179
|
-
yield writePackageJSON(tmpDir.name, pulumiPackagePath, peerDeps);
|
|
180
|
-
yield writeTSConfig(tmpDir.name);
|
|
181
|
-
const projectName = `install-test-${packageManager}-${packageManagerVersion}`.replace(/[^a-zA-Z0-9]/g, "-");
|
|
182
|
-
yield writeProgram(tmpDir.name, projectName);
|
|
183
|
-
const dependencies = Object.entries(peerDeps)
|
|
184
|
-
.filter(([_, v]) => v !== undefined)
|
|
185
|
-
.map(([p, v]) => `${p}:${v}`)
|
|
186
|
-
.join(", ");
|
|
187
|
-
const dependenciesString = dependencies.length > 0 ? ` with ${dependencies}` : "";
|
|
188
|
-
let logs = "";
|
|
189
|
-
// Install the package manager to test.
|
|
190
|
-
logs += yield exec(`corepack`, ["enable"], { cwd: tmpDir.name });
|
|
191
|
-
logs += yield exec(`corepack`, ["use", `${packageManager}@${packageManagerVersion}`], { cwd: tmpDir.name });
|
|
192
|
-
const env = {
|
|
193
|
-
PULUMI_CONFIG_PASSPHRASE: "test",
|
|
194
|
-
PULUMI_HOME: tmpDir.name,
|
|
195
|
-
};
|
|
196
|
-
// Up and down a test stack to ensure we're able to load & run typescript code.
|
|
197
|
-
const stackName = `install-test-${crypto_1.randomInt(10000, 99999)}`;
|
|
198
|
-
try {
|
|
199
|
-
logs += yield exec("pulumi", ["stack", "init", stackName], {
|
|
200
|
-
cwd: tmpDir.name,
|
|
201
|
-
env,
|
|
202
|
-
});
|
|
203
|
-
logs += yield exec("pulumi", ["up", "--stack", stackName, "--skip-preview"], {
|
|
204
|
-
cwd: tmpDir.name,
|
|
205
|
-
env,
|
|
206
|
-
});
|
|
207
|
-
console.log(`✅ ${packageManager}@${packageManagerVersion}${dependenciesString}`);
|
|
208
|
-
}
|
|
209
|
-
catch (err) {
|
|
210
|
-
console.log(`❌ Failed to run test with ${packageManager}@${packageManagerVersion}${dependenciesString} in ${tmpDir.name}: ${err}`);
|
|
211
|
-
console.log(`Captured stdout: ${logs}`);
|
|
212
|
-
throw err;
|
|
213
|
-
}
|
|
214
|
-
finally {
|
|
215
|
-
yield exec("pulumi", ["destroy", "--stack", stackName, "--yes"], {
|
|
216
|
-
cwd: tmpDir.name,
|
|
217
|
-
env,
|
|
218
|
-
});
|
|
219
|
-
yield exec("pulumi", ["stack", "rm", stackName, "--yes"], {
|
|
220
|
-
cwd: tmpDir.name,
|
|
221
|
-
env,
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
main().catch((error) => {
|
|
227
|
-
console.error(error);
|
|
228
|
-
process.exit(1);
|
|
229
|
-
});
|
|
230
|
-
//# sourceMappingURL=install-package-tests.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install-package-tests.js","sourceRoot":"","sources":["../../../tests/runtime/install-package-tests.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;;;;;;;;;;;;AAEjC,mCAAmC;AACnC,kDAA0B;AAC1B,gDAAkC;AAClC,2CAA6B;AAC7B,iDAAmC;AACnC,yCAA2B;AAC3B,iCAA8B;AAE9B,yFAAyF;AACzF,SAAe,gBAAgB,CAC3B,GAAW,EACX,iBAAyB,EACzB,YAAgD;;QAEhD,MAAM,WAAW,GAAG;YAChB,IAAI,EAAE,uBAAuB;YAC7B,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,YAAY;YACrB,YAAY,kBACR,gBAAgB,EAAE,iBAAiB,IAChC,YAAY,CAClB;SACJ,CAAC;QAEF,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,EAAE,IAAI,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AAG,EAAE,MAAM,CAAC,IAAI;gBAChB,GAAG;aACN,CAAC,CAAC;YAEH,OAAO,CAAC,GAAG,CAAC,KAAK,cAAc,IAAI,qBAAqB,GAAG,kBAAkB,EAAE,CAAC,CAAC;SACpF;QAAC,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,GAAG,CACP,6BAA6B,cAAc,IAAI,qBAAqB,GAAG,kBAAkB,OAAO,MAAM,CAAC,IAAI,KAAK,GAAG,EAAE,CACxH,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;YACxC,MAAM,GAAG,CAAC;SACb;gBAAS;YACN,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE;gBAC7D,GAAG,EAAE,MAAM,CAAC,IAAI;gBAChB,GAAG;aACN,CAAC,CAAC;YACH,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE;gBACtD,GAAG,EAAE,MAAM,CAAC,IAAI;gBAChB,GAAG;aACN,CAAC,CAAC;SACN;IACL,CAAC;CAAA;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log("Nada");
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This tests the basic creation of a single propertyless resource.
|
|
2
|
-
|
|
3
|
-
let pulumi = require("../../../../../");
|
|
4
|
-
|
|
5
|
-
class MyResource extends pulumi.CustomResource {
|
|
6
|
-
constructor(name) {
|
|
7
|
-
super("test:index:MyResource", name);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
new MyResource("testResource1");
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// This tests the creation of ten propertyless resources.
|
|
2
|
-
|
|
3
|
-
let pulumi = require("../../../../../");
|
|
4
|
-
|
|
5
|
-
class MyResource extends pulumi.CustomResource {
|
|
6
|
-
constructor(name) {
|
|
7
|
-
super("test:index:MyResource", name);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
for (let i = 0; i < 10; i++) {
|
|
12
|
-
new MyResource("testResource" + i);
|
|
13
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
// This tests the creation of a resource that contains "simple" input and output propeprties.
|
|
2
|
-
// In particular, there aren't any fancy dataflow linked properties.
|
|
3
|
-
|
|
4
|
-
let assert = require("assert");
|
|
5
|
-
let pulumi = require("../../../../../");
|
|
6
|
-
|
|
7
|
-
class MyResource extends pulumi.CustomResource {
|
|
8
|
-
constructor(name) {
|
|
9
|
-
super("test:index:MyResource", name, {
|
|
10
|
-
// First a few basic properties that are resolved to values.
|
|
11
|
-
inpropB1: false,
|
|
12
|
-
inpropB2: true,
|
|
13
|
-
inpropN: 42,
|
|
14
|
-
inpropS: "a string",
|
|
15
|
-
inpropA: [true, 99, "what a great property"],
|
|
16
|
-
inpropO: {
|
|
17
|
-
b1: false,
|
|
18
|
-
b2: true,
|
|
19
|
-
n: 42,
|
|
20
|
-
s: "another string",
|
|
21
|
-
a: [66, false, "strings galore"],
|
|
22
|
-
o: { z: "x" },
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
// Next some properties that are completely unresolved (outputs) but will be provided after creation.
|
|
26
|
-
outprop1: undefined,
|
|
27
|
-
outprop2: undefined,
|
|
28
|
-
|
|
29
|
-
// Finally define an output property that will not be provided after creation.
|
|
30
|
-
outprop3: undefined,
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
let res = new MyResource("testResource1");
|
|
36
|
-
res.urn.apply((urn) => {
|
|
37
|
-
console.log(`URN: ${urn}`);
|
|
38
|
-
assert.strictEqual(urn, "test:index:MyResource::testResource1");
|
|
39
|
-
});
|
|
40
|
-
res.id.apply((id) => {
|
|
41
|
-
console.log(`ID: ${id}`);
|
|
42
|
-
assert.strictEqual(id, "testResource1");
|
|
43
|
-
});
|
|
44
|
-
res.outprop1.apply((prop) => {
|
|
45
|
-
console.log(`OutProp1: ${prop}`);
|
|
46
|
-
assert.strictEqual(prop, "output properties ftw");
|
|
47
|
-
});
|
|
48
|
-
res.outprop2.apply((prop) => {
|
|
49
|
-
console.log(`OutProp2: ${prop}`);
|
|
50
|
-
assert.strictEqual(prop, 998.6);
|
|
51
|
-
});
|
|
52
|
-
res.outprop3.apply((prop) => {
|
|
53
|
-
console.log(`OutProp3: ${prop}`);
|
|
54
|
-
assert.strictEqual(prop, undefined);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
let resOutput = pulumi.output(res);
|
|
58
|
-
resOutput.urn.apply((urn) => {
|
|
59
|
-
console.log(`URN: ${urn}`);
|
|
60
|
-
assert.strictEqual(urn, "test:index:MyResource::testResource1");
|
|
61
|
-
});
|
|
62
|
-
resOutput.id.apply((id) => {
|
|
63
|
-
console.log(`ID: ${id}`);
|
|
64
|
-
assert.strictEqual(id, "testResource1");
|
|
65
|
-
});
|
|
66
|
-
resOutput.outprop1.apply((prop) => {
|
|
67
|
-
console.log(`OutProp1: ${prop}`);
|
|
68
|
-
assert.strictEqual(prop, "output properties ftw");
|
|
69
|
-
});
|
|
70
|
-
resOutput.outprop2.apply((prop) => {
|
|
71
|
-
console.log(`OutProp2: ${prop}`);
|
|
72
|
-
assert.strictEqual(prop, 998.6);
|
|
73
|
-
});
|
|
74
|
-
resOutput.outprop3.apply((prop) => {
|
|
75
|
-
console.log(`OutProp3: ${prop}`);
|
|
76
|
-
assert.strictEqual(prop, undefined);
|
|
77
|
-
});
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// This tests the creation of ten resources that contains "simple" input and output propeprties.
|
|
2
|
-
// In particular, there aren't any fancy dataflow linked properties.
|
|
3
|
-
|
|
4
|
-
let assert = require("assert");
|
|
5
|
-
let MyResource = require("./resource").MyResource;
|
|
6
|
-
|
|
7
|
-
for (let i = 0; i < 10; i++) {
|
|
8
|
-
let name = "testResource" + i;
|
|
9
|
-
let res = new MyResource(name, i);
|
|
10
|
-
res.urn.apply((urn) => {
|
|
11
|
-
console.log(`${name}.URN: ${urn}`);
|
|
12
|
-
assert.strictEqual(urn, "test:index:MyResource::" + name);
|
|
13
|
-
});
|
|
14
|
-
res.id.apply((id) => {
|
|
15
|
-
if (id) {
|
|
16
|
-
console.log(`${name}.ID: ${id}`);
|
|
17
|
-
assert.strictEqual(id, name);
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
res.outseq.apply((seq) => {
|
|
21
|
-
if (seq) {
|
|
22
|
-
console.log(`${name}.Seq: ${seq}`);
|
|
23
|
-
assert.strictEqual(seq, i);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
res.outprop1.apply((prop) => {
|
|
27
|
-
if (prop) {
|
|
28
|
-
console.log(`${name}.OutProp1: ${prop}`);
|
|
29
|
-
assert.strictEqual(prop, "output properties ftw");
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
res.outprop2.apply((prop) => {
|
|
33
|
-
if (prop) {
|
|
34
|
-
console.log(`${name}.OutProp2: ${prop}`);
|
|
35
|
-
assert.strictEqual(prop, 998.6);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Define and export a resource class that can be used by index.js.
|
|
2
|
-
|
|
3
|
-
let pulumi = require("../../../../../");
|
|
4
|
-
|
|
5
|
-
exports.MyResource = class MyResource extends pulumi.CustomResource {
|
|
6
|
-
constructor(name, seq) {
|
|
7
|
-
super("test:index:MyResource", name, {
|
|
8
|
-
// First a few basic properties that are resolved to values.
|
|
9
|
-
inseq: seq,
|
|
10
|
-
inpropB1: false,
|
|
11
|
-
inpropB2: true,
|
|
12
|
-
inpropN: 42,
|
|
13
|
-
inpropS: "a string",
|
|
14
|
-
inpropA: [true, 99, "what a great property"],
|
|
15
|
-
inpropO: {
|
|
16
|
-
b1: false,
|
|
17
|
-
b2: true,
|
|
18
|
-
n: 42,
|
|
19
|
-
s: "another string",
|
|
20
|
-
a: [66, false, "strings galore"],
|
|
21
|
-
o: { z: "x" },
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
// Next some properties that are completely unresolved (outputs).
|
|
25
|
-
outseq: undefined,
|
|
26
|
-
outprop1: undefined,
|
|
27
|
-
outprop2: undefined,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
};
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// This test case links one resource's property to another.
|
|
2
|
-
|
|
3
|
-
let assert = require("assert");
|
|
4
|
-
let pulumi = require("../../../../../");
|
|
5
|
-
|
|
6
|
-
class ResourceA extends pulumi.CustomResource {
|
|
7
|
-
constructor(name) {
|
|
8
|
-
super("test:index:ResourceA", name, {
|
|
9
|
-
inprop: 777,
|
|
10
|
-
outprop: undefined,
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
class ResourceB extends pulumi.CustomResource {
|
|
16
|
-
constructor(name, other) {
|
|
17
|
-
super("test:index:ResourceB", name, {
|
|
18
|
-
otherIn: other.inprop,
|
|
19
|
-
otherOut: other.outprop,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// First create and validate a simple resource A with an input and output.
|
|
25
|
-
let a = new ResourceA("resourceA");
|
|
26
|
-
a.urn.apply((urn) => {
|
|
27
|
-
console.log(`A.URN: ${urn}`);
|
|
28
|
-
assert.strictEqual(urn, "test:index:ResourceA::resourceA");
|
|
29
|
-
});
|
|
30
|
-
a.id.apply((id) => {
|
|
31
|
-
if (id) {
|
|
32
|
-
console.log(`A.ID: ${id}`);
|
|
33
|
-
assert.strictEqual(id, "resourceA");
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
a.inprop.apply((prop) => {
|
|
37
|
-
if (prop) {
|
|
38
|
-
console.log(`A.InProp: ${prop}`);
|
|
39
|
-
assert.strictEqual(prop, 777);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
a.outprop.apply((prop) => {
|
|
43
|
-
if (prop) {
|
|
44
|
-
console.log(`A.OutProp: ${prop}`);
|
|
45
|
-
assert.strictEqual(prop, "output yeah");
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
// Next, create and validate another resource B which depends upon resource A.
|
|
50
|
-
let b = new ResourceB("resourceB", a);
|
|
51
|
-
b.urn.apply((urn) => {
|
|
52
|
-
console.log(`B.URN: ${urn}`);
|
|
53
|
-
assert.strictEqual(urn, "test:index:ResourceB::resourceB");
|
|
54
|
-
});
|
|
55
|
-
b.id.apply((id) => {
|
|
56
|
-
if (id) {
|
|
57
|
-
console.log(`B.ID: ${id}`);
|
|
58
|
-
assert.strictEqual(id, "resourceB");
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
b.otherIn.apply((prop) => {
|
|
62
|
-
if (prop) {
|
|
63
|
-
console.log(`B.OtherIn: ${prop}`);
|
|
64
|
-
assert.strictEqual(prop, 777);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
b.otherOut.apply((prop) => {
|
|
68
|
-
if (prop) {
|
|
69
|
-
console.log(`B.OtherOut: ${prop}`);
|
|
70
|
-
assert.strictEqual(prop, "output yeah");
|
|
71
|
-
}
|
|
72
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// This tests simple creation of assets.
|
|
2
|
-
|
|
3
|
-
let pulumi = require("../../../../../");
|
|
4
|
-
|
|
5
|
-
class FileResource extends pulumi.CustomResource {
|
|
6
|
-
constructor(name, data) {
|
|
7
|
-
super("test:index:FileResource", name, {
|
|
8
|
-
data: data,
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
new FileResource("file1", new pulumi.asset.FileAsset("./testdata.txt"));
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// This tests the ability to use promises for resource properties.
|
|
2
|
-
|
|
3
|
-
let pulumi = require("../../../../../");
|
|
4
|
-
let fs = require("fs");
|
|
5
|
-
|
|
6
|
-
class FileResource extends pulumi.CustomResource {
|
|
7
|
-
constructor(name, data) {
|
|
8
|
-
super("test:index:FileResource", name, {
|
|
9
|
-
data: data,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
new FileResource(
|
|
15
|
-
"file1",
|
|
16
|
-
new Promise((resolve, reject) => {
|
|
17
|
-
fs.readFile("./testdata.txt", (err, data) => {
|
|
18
|
-
if (err) {
|
|
19
|
-
reject(err);
|
|
20
|
-
} else {
|
|
21
|
-
resolve(data.toString("utf-8"));
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}),
|
|
25
|
-
);
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// This tests the creation of ten propertyless resources.
|
|
2
|
-
|
|
3
|
-
let pulumi = require("../../../../../");
|
|
4
|
-
|
|
5
|
-
class MyResource extends pulumi.CustomResource {
|
|
6
|
-
constructor(name, deps) {
|
|
7
|
-
super("test:index:MyResource", name, {}, deps);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
let all = [];
|
|
12
|
-
let last = undefined;
|
|
13
|
-
for (let i = 0; i < 10; i++) {
|
|
14
|
-
// Test all permutations of accepted dependsOn input:
|
|
15
|
-
// - undefined
|
|
16
|
-
// - Resource
|
|
17
|
-
// - Resource[]
|
|
18
|
-
// - Promise<Resource>
|
|
19
|
-
// - Output<Resource>
|
|
20
|
-
// - Promise<Resource[]>
|
|
21
|
-
// - Output<Resource[]>
|
|
22
|
-
// - Promise<Promise<Resource>[]>
|
|
23
|
-
// - Promise<Output<Resource>[]>
|
|
24
|
-
// - Output<Promise<Resource>[]>
|
|
25
|
-
// - Output<Output<Resource>[]>
|
|
26
|
-
let r0 = new MyResource("testResource" + i * 10, { dependsOn: last });
|
|
27
|
-
let r1 = new MyResource("testResource" + i * 10 + 1, { dependsOn: all });
|
|
28
|
-
let r2 = new MyResource("testResource" + i * 10 + 2, { dependsOn: Promise.resolve(last) });
|
|
29
|
-
let r3 = new MyResource("testResource" + i * 10 + 3, { dependsOn: pulumi.Output.create(last) });
|
|
30
|
-
let r4 = new MyResource("testResource" + i * 10 + 4, { dependsOn: Promise.resolve(all) });
|
|
31
|
-
let r5 = new MyResource("testResource" + i * 10 + 5, { dependsOn: pulumi.Output.create(all) });
|
|
32
|
-
let r6 = new MyResource("testResource" + i * 10 + 6, {
|
|
33
|
-
dependsOn: Promise.resolve(all.map((a) => Promise.resolve(a))),
|
|
34
|
-
});
|
|
35
|
-
let r7 = new MyResource("testResource" + i * 10 + 7, {
|
|
36
|
-
dependsOn: Promise.resolve(all.map((a) => pulumi.Output.create(a))),
|
|
37
|
-
});
|
|
38
|
-
let r8 = new MyResource("testResource" + i * 10 + 8, {
|
|
39
|
-
dependsOn: pulumi.Output.create(all).apply((a) => Promise.resolve(a)),
|
|
40
|
-
});
|
|
41
|
-
let r9 = new MyResource("testResource" + i * 10 + 9, {
|
|
42
|
-
dependsOn: pulumi.Output.create(all).apply((a) => pulumi.Output.create(a)),
|
|
43
|
-
});
|
|
44
|
-
all = all.concat([r0, r1, r2, r3, r4, r5, r6, r7, r8, r9]);
|
|
45
|
-
last = r0;
|
|
46
|
-
}
|