codify-plugin-test 0.0.33 → 0.0.35
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/dist/plugin-process.d.ts +13 -0
- package/dist/plugin-process.js +115 -0
- package/dist/plugin-process.js.map +1 -0
- package/dist/plugin-tester.d.ts +4 -14
- package/dist/plugin-tester.js +103 -185
- package/dist/plugin-tester.js.map +1 -1
- package/package.json +3 -2
- package/src/plugin-process.ts +183 -0
- package/src/plugin-tester.ts +113 -263
- package/test/plugin-tester.test.ts +71 -67
- package/test/test-plugin.ts +10 -10
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApplyRequestData, ImportRequestData, ImportResponseData, InitializeResponseData, PlanRequestData, PlanResponseData, ValidateRequestData, ValidateResponseData } from 'codify-schemas';
|
|
2
|
+
import { ChildProcess } from 'node:child_process';
|
|
3
|
+
export declare class PluginProcess {
|
|
4
|
+
childProcess: ChildProcess;
|
|
5
|
+
constructor(pluginPath: string);
|
|
6
|
+
initialize(): Promise<InitializeResponseData>;
|
|
7
|
+
validate(data: ValidateRequestData): Promise<ValidateResponseData>;
|
|
8
|
+
plan(data: PlanRequestData): Promise<PlanResponseData>;
|
|
9
|
+
apply(data: ApplyRequestData): Promise<void>;
|
|
10
|
+
import(data: ImportRequestData): Promise<ImportResponseData>;
|
|
11
|
+
kill(): void;
|
|
12
|
+
private handleSudoRequests;
|
|
13
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import Ajv from 'ajv';
|
|
2
|
+
import { IpcMessageSchema, MessageCmd, SpawnStatus, SudoRequestDataSchema } from 'codify-schemas';
|
|
3
|
+
import { nanoid } from 'nanoid';
|
|
4
|
+
import { fork, spawn } from 'node:child_process';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { CodifyTestUtils } from './test-utils.js';
|
|
7
|
+
const ajv = new Ajv.default({
|
|
8
|
+
strict: true
|
|
9
|
+
});
|
|
10
|
+
const ipcMessageValidator = ajv.compile(IpcMessageSchema);
|
|
11
|
+
const sudoRequestValidator = ajv.compile(SudoRequestDataSchema);
|
|
12
|
+
export class PluginProcess {
|
|
13
|
+
childProcess;
|
|
14
|
+
constructor(pluginPath) {
|
|
15
|
+
if (!path.isAbsolute(pluginPath)) {
|
|
16
|
+
throw new Error('A fully qualified path must be supplied to PluginTester');
|
|
17
|
+
}
|
|
18
|
+
this.childProcess = fork(pluginPath, [], {
|
|
19
|
+
env: { ...process.env },
|
|
20
|
+
execArgv: ['--import', 'tsx/esm'],
|
|
21
|
+
stdio: 'pipe',
|
|
22
|
+
});
|
|
23
|
+
this.childProcess.stderr?.pipe(process.stderr);
|
|
24
|
+
this.childProcess.stdout?.pipe(process.stdout);
|
|
25
|
+
this.handleSudoRequests(this.childProcess);
|
|
26
|
+
}
|
|
27
|
+
async initialize() {
|
|
28
|
+
return CodifyTestUtils.sendMessageAndAwaitResponse(this.childProcess, {
|
|
29
|
+
cmd: 'initialize',
|
|
30
|
+
data: {},
|
|
31
|
+
requestId: nanoid(6),
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
async validate(data) {
|
|
35
|
+
return CodifyTestUtils.sendMessageAndAwaitResponse(this.childProcess, {
|
|
36
|
+
cmd: 'validate',
|
|
37
|
+
data,
|
|
38
|
+
requestId: nanoid(6),
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async plan(data) {
|
|
42
|
+
return CodifyTestUtils.sendMessageAndAwaitResponse(this.childProcess, {
|
|
43
|
+
cmd: 'plan',
|
|
44
|
+
data,
|
|
45
|
+
requestId: nanoid(6),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
async apply(data) {
|
|
49
|
+
return CodifyTestUtils.sendMessageAndAwaitResponse(this.childProcess, {
|
|
50
|
+
cmd: 'apply',
|
|
51
|
+
data,
|
|
52
|
+
requestId: nanoid(6),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
async import(data) {
|
|
56
|
+
return CodifyTestUtils.sendMessageAndAwaitResponse(this.childProcess, {
|
|
57
|
+
cmd: 'import',
|
|
58
|
+
data,
|
|
59
|
+
requestId: nanoid(6),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
kill() {
|
|
63
|
+
this.childProcess.kill();
|
|
64
|
+
}
|
|
65
|
+
handleSudoRequests(process) {
|
|
66
|
+
process.on('message', async (message) => {
|
|
67
|
+
if (!ipcMessageValidator(message)) {
|
|
68
|
+
throw new Error(`Invalid message from plugin. ${JSON.stringify(message, null, 2)}`);
|
|
69
|
+
}
|
|
70
|
+
if (message.cmd === MessageCmd.SUDO_REQUEST) {
|
|
71
|
+
const { data, requestId } = message;
|
|
72
|
+
if (!sudoRequestValidator(data)) {
|
|
73
|
+
throw new Error(`Invalid sudo request from plugin. ${JSON.stringify(sudoRequestValidator.errors, null, 2)}`);
|
|
74
|
+
}
|
|
75
|
+
const { command, options } = data;
|
|
76
|
+
console.log(`Running command with sudo: 'sudo ${command}'`);
|
|
77
|
+
const result = await sudoSpawn(command, options);
|
|
78
|
+
process.send({
|
|
79
|
+
cmd: MessageCmd.SUDO_REQUEST + '_Response',
|
|
80
|
+
data: result,
|
|
81
|
+
requestId,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async function sudoSpawn(cmd, opts) {
|
|
88
|
+
return new Promise((resolve) => {
|
|
89
|
+
const output = [];
|
|
90
|
+
const _cmd = `sudo ${cmd}`;
|
|
91
|
+
const _process = spawn(`source ~/.zshrc; ${_cmd}`, [], {
|
|
92
|
+
...opts,
|
|
93
|
+
shell: 'zsh',
|
|
94
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
95
|
+
});
|
|
96
|
+
const { stderr, stdout } = _process;
|
|
97
|
+
stdout.setEncoding('utf8');
|
|
98
|
+
stderr.setEncoding('utf8');
|
|
99
|
+
stdout.on('data', (data) => {
|
|
100
|
+
output.push(data.toString());
|
|
101
|
+
});
|
|
102
|
+
stderr.on('data', (data) => {
|
|
103
|
+
output.push(data.toString());
|
|
104
|
+
});
|
|
105
|
+
stdout.pipe(process.stdout);
|
|
106
|
+
stderr.pipe(process.stderr);
|
|
107
|
+
_process.on('close', (code) => {
|
|
108
|
+
resolve({
|
|
109
|
+
data: output.join(''),
|
|
110
|
+
status: code === 0 ? SpawnStatus.SUCCESS : SpawnStatus.ERROR,
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=plugin-process.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-process.js","sourceRoot":"","sources":["../src/plugin-process.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAGL,gBAAgB,EAEhB,UAAU,EACV,WAAW,EAEX,qBAAqB,EACtB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAA8B,IAAI,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC;IAC1B,MAAM,EAAE,IAAI;CACb,CAAC,CAAC;AAEH,MAAM,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1D,MAAM,oBAAoB,GAAG,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;AAEhE,MAAM,OAAO,aAAa;IACxB,YAAY,CAAc;IAO1B,YAAY,UAAkB;QAC5B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;QAC7E,CAAC;QAED,IAAI,CA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IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK;aAC7D,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/plugin-tester.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChildProcess } from 'node:child_process';
|
|
1
|
+
import { ImportResponseData, PlanResponseData, ResourceConfig } from 'codify-schemas';
|
|
3
2
|
export declare class PluginTester {
|
|
4
|
-
|
|
5
|
-
constructor(pluginPath: string);
|
|
6
|
-
fullTest(configs: ResourceConfig[], options?: {
|
|
3
|
+
static fullTest(pluginPath: string, configs: ResourceConfig[], options?: {
|
|
7
4
|
skipUninstall?: boolean;
|
|
8
5
|
validatePlan?: (plans: PlanResponseData[]) => Promise<void> | void;
|
|
9
6
|
validateApply?: (plans: PlanResponseData[]) => Promise<void> | void;
|
|
@@ -14,15 +11,8 @@ export declare class PluginTester {
|
|
|
14
11
|
validateModify?: (plans: PlanResponseData[]) => Promise<void> | void;
|
|
15
12
|
};
|
|
16
13
|
}): Promise<void>;
|
|
17
|
-
uninstall(configs: ResourceConfig[], options?: {
|
|
14
|
+
static uninstall(pluginPath: string, configs: ResourceConfig[], options?: {
|
|
18
15
|
validateDestroy?: (plans: PlanResponseData[]) => Promise<void> | void;
|
|
19
16
|
}): Promise<void>;
|
|
20
|
-
|
|
21
|
-
validate(data: ValidateRequestData): Promise<ValidateResponseData>;
|
|
22
|
-
plan(data: PlanRequestData): Promise<PlanResponseData>;
|
|
23
|
-
apply(data: ApplyRequestData): Promise<void>;
|
|
24
|
-
import(data: ImportRequestData): Promise<ImportResponseData>;
|
|
25
|
-
kill(): void;
|
|
26
|
-
private handleSudoRequests;
|
|
27
|
-
private addNamesToConfigs;
|
|
17
|
+
private static addNamesToConfigs;
|
|
28
18
|
}
|
package/dist/plugin-tester.js
CHANGED
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { ResourceOperation, } from 'codify-schemas';
|
|
3
3
|
import unionBy from 'lodash.unionby';
|
|
4
|
-
import {
|
|
5
|
-
import { fork, spawn } from 'node:child_process';
|
|
6
|
-
import path from 'node:path';
|
|
7
|
-
import { CodifyTestUtils } from './test-utils.js';
|
|
8
|
-
const ajv = new Ajv.default({
|
|
9
|
-
strict: true
|
|
10
|
-
});
|
|
11
|
-
const ipcMessageValidator = ajv.compile(IpcMessageSchema);
|
|
12
|
-
const sudoRequestValidator = ajv.compile(SudoRequestDataSchema);
|
|
4
|
+
import { PluginProcess } from './plugin-process.js';
|
|
13
5
|
export class PluginTester {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
throw new Error('A fully qualified path must be supplied to PluginTester');
|
|
18
|
-
}
|
|
19
|
-
this.childProcess = fork(pluginPath, [], {
|
|
20
|
-
env: { ...process.env },
|
|
21
|
-
execArgv: ['--import', 'tsx/esm', '--inspect=9221'],
|
|
22
|
-
});
|
|
23
|
-
this.handleSudoRequests(this.childProcess);
|
|
24
|
-
}
|
|
25
|
-
async fullTest(configs, options) {
|
|
6
|
+
static async fullTest(pluginPath, configs, options) {
|
|
7
|
+
const ids = configs.map((c) => c.name ? `${c.type}.${c.name}` : c.type).join(', ');
|
|
8
|
+
console.info(chalk.cyan(`Starting full test of [ ${ids} ]...`));
|
|
26
9
|
const { skipUninstall = false, } = options ?? {};
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
isStateful: false,
|
|
46
|
-
state: undefined,
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
if (options?.validatePlan) {
|
|
50
|
-
await options.validatePlan(plans);
|
|
51
|
-
}
|
|
52
|
-
console.info(`Testing apply for ${ids}...`);
|
|
53
|
-
for (const plan of plans) {
|
|
54
|
-
await this.apply({
|
|
55
|
-
planId: plan.planId
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
if (options?.validateApply) {
|
|
59
|
-
await options.validateApply(plans);
|
|
60
|
-
}
|
|
61
|
-
console.info(`Testing import for ${ids}...`);
|
|
62
|
-
const importResults = [];
|
|
63
|
-
for (const config of configs) {
|
|
64
|
-
const importResult = await this.import({ config });
|
|
65
|
-
importResults.push(importResult);
|
|
66
|
-
}
|
|
67
|
-
if (options?.validateImport) {
|
|
68
|
-
await options.validateImport(importResults.map((r) => r.result[0]));
|
|
69
|
-
}
|
|
70
|
-
if (options?.testModify) {
|
|
71
|
-
console.info(`Testing modify for ${ids}...`);
|
|
72
|
-
const modifyPlans = [];
|
|
73
|
-
for (const config of options.testModify.modifiedConfigs) {
|
|
74
|
-
modifyPlans.push(await this.plan({
|
|
10
|
+
const plugin = new PluginProcess(pluginPath);
|
|
11
|
+
try {
|
|
12
|
+
console.info(chalk.cyan('Testing initialization...'));
|
|
13
|
+
const initializeResult = await plugin.initialize();
|
|
14
|
+
const unsupportedConfigs = configs.filter((c) => !initializeResult.resourceDefinitions.some((rd) => rd.type === c.type));
|
|
15
|
+
if (unsupportedConfigs.length > 0) {
|
|
16
|
+
throw new Error(`The plugin does not support the following configs supplied:\n ${JSON.stringify(unsupportedConfigs, null, 2)}\n Initialize result: ${JSON.stringify(initializeResult)}`);
|
|
17
|
+
}
|
|
18
|
+
console.info(chalk.cyan('Testing validate...'));
|
|
19
|
+
const validate = await plugin.validate({ configs });
|
|
20
|
+
const invalidConfigs = validate.resourceValidations.filter((v) => !v.isValid);
|
|
21
|
+
if (invalidConfigs.length > 0) {
|
|
22
|
+
throw new Error(`The following configs did not validate:\n ${JSON.stringify(invalidConfigs, null, 2)}`);
|
|
23
|
+
}
|
|
24
|
+
console.info(chalk.cyan('Testing plan...'));
|
|
25
|
+
const plans = [];
|
|
26
|
+
for (const config of configs) {
|
|
27
|
+
plans.push(await plugin.plan({
|
|
75
28
|
desired: config,
|
|
76
29
|
isStateful: false,
|
|
77
30
|
state: undefined,
|
|
78
31
|
}));
|
|
79
32
|
}
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
${JSON.stringify(modifyPlans, null, 2)}`);
|
|
33
|
+
if (options?.validatePlan) {
|
|
34
|
+
await options.validatePlan(plans);
|
|
83
35
|
}
|
|
84
|
-
|
|
85
|
-
|
|
36
|
+
console.info(chalk.cyan('Testing apply...'));
|
|
37
|
+
for (const plan of plans) {
|
|
38
|
+
await plugin.apply({
|
|
86
39
|
planId: plan.planId
|
|
87
40
|
});
|
|
88
41
|
}
|
|
89
|
-
if (options
|
|
90
|
-
await options.
|
|
42
|
+
if (options?.validateApply) {
|
|
43
|
+
await options.validateApply(plans);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
finally {
|
|
47
|
+
plugin.kill();
|
|
48
|
+
}
|
|
49
|
+
const importPlugin = new PluginProcess(pluginPath);
|
|
50
|
+
try {
|
|
51
|
+
console.info(chalk.cyan('Testing import...'));
|
|
52
|
+
const importResults = [];
|
|
53
|
+
for (const config of configs) {
|
|
54
|
+
const importResult = await importPlugin.import({ config });
|
|
55
|
+
importResults.push(importResult);
|
|
56
|
+
}
|
|
57
|
+
if (options?.validateImport) {
|
|
58
|
+
await options.validateImport(importResults.map((r) => r.result[0]));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
finally {
|
|
62
|
+
importPlugin.kill();
|
|
63
|
+
}
|
|
64
|
+
if (options?.testModify) {
|
|
65
|
+
const modifyPlugin = new PluginProcess(pluginPath);
|
|
66
|
+
try {
|
|
67
|
+
console.info(chalk.cyan('Testing modify...'));
|
|
68
|
+
const modifyPlans = [];
|
|
69
|
+
for (const config of options.testModify.modifiedConfigs) {
|
|
70
|
+
modifyPlans.push(await modifyPlugin.plan({
|
|
71
|
+
desired: config,
|
|
72
|
+
isStateful: false,
|
|
73
|
+
state: undefined,
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
if (modifyPlans.some((p) => p.operation !== ResourceOperation.MODIFY)) {
|
|
77
|
+
throw new Error(`Error while testing modify. Non-modify results were found in the plan:
|
|
78
|
+
${JSON.stringify(modifyPlans, null, 2)}`);
|
|
79
|
+
}
|
|
80
|
+
for (const plan of modifyPlans) {
|
|
81
|
+
await modifyPlugin.apply({
|
|
82
|
+
planId: plan.planId
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (options.testModify.validateModify) {
|
|
86
|
+
await options.testModify.validateModify(modifyPlans);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
finally {
|
|
90
|
+
modifyPlugin.kill();
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
if (!skipUninstall) {
|
|
@@ -95,92 +95,38 @@ ${JSON.stringify(modifyPlans, null, 2)}`);
|
|
|
95
95
|
const modifiedConfigs = this.addNamesToConfigs(options?.testModify?.modifiedConfigs ?? []);
|
|
96
96
|
const id = (config) => config.type + (config.name ? `.${config.name}` : '');
|
|
97
97
|
const configsToDestroy = unionBy(modifiedConfigs, configsWithNames, id);
|
|
98
|
-
await this.uninstall(configsToDestroy.toReversed(), options);
|
|
98
|
+
await this.uninstall(pluginPath, configsToDestroy.toReversed(), options);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
async uninstall(configs, options) {
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
for (const plan of plans) {
|
|
113
|
-
if (plan.operation !== ResourceOperation.DESTROY) {
|
|
114
|
-
throw new Error(`Expect resource operation to be 'destroy' but instead received plan: \n ${JSON.stringify(plan, null, 2)}`);
|
|
115
|
-
}
|
|
116
|
-
await this.apply({
|
|
117
|
-
planId: plan.planId
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
if (options?.validateDestroy) {
|
|
121
|
-
await options.validateDestroy(plans);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
async initialize() {
|
|
125
|
-
return CodifyTestUtils.sendMessageAndAwaitResponse(this.childProcess, {
|
|
126
|
-
cmd: 'initialize',
|
|
127
|
-
data: {},
|
|
128
|
-
requestId: nanoid(6),
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
async validate(data) {
|
|
132
|
-
return CodifyTestUtils.sendMessageAndAwaitResponse(this.childProcess, {
|
|
133
|
-
cmd: 'validate',
|
|
134
|
-
data,
|
|
135
|
-
requestId: nanoid(6),
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
async plan(data) {
|
|
139
|
-
return CodifyTestUtils.sendMessageAndAwaitResponse(this.childProcess, {
|
|
140
|
-
cmd: 'plan',
|
|
141
|
-
data,
|
|
142
|
-
requestId: nanoid(6),
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
async apply(data) {
|
|
146
|
-
return CodifyTestUtils.sendMessageAndAwaitResponse(this.childProcess, {
|
|
147
|
-
cmd: 'apply',
|
|
148
|
-
data,
|
|
149
|
-
requestId: nanoid(6),
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
async import(data) {
|
|
153
|
-
return CodifyTestUtils.sendMessageAndAwaitResponse(this.childProcess, {
|
|
154
|
-
cmd: 'import',
|
|
155
|
-
data,
|
|
156
|
-
requestId: nanoid(6),
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
kill() {
|
|
160
|
-
this.childProcess.kill();
|
|
161
|
-
}
|
|
162
|
-
handleSudoRequests(process) {
|
|
163
|
-
process.on('message', async (message) => {
|
|
164
|
-
if (!ipcMessageValidator(message)) {
|
|
165
|
-
throw new Error(`Invalid message from plugin. ${JSON.stringify(message, null, 2)}`);
|
|
101
|
+
static async uninstall(pluginPath, configs, options) {
|
|
102
|
+
const destroyPlugin = new PluginProcess(pluginPath);
|
|
103
|
+
try {
|
|
104
|
+
console.info(chalk.cyan('Testing destroy...'));
|
|
105
|
+
const plans = [];
|
|
106
|
+
for (const config of configs) {
|
|
107
|
+
plans.push(await destroyPlugin.plan({
|
|
108
|
+
isStateful: true,
|
|
109
|
+
state: config,
|
|
110
|
+
desired: undefined
|
|
111
|
+
}));
|
|
166
112
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
throw new Error(`Invalid sudo request from plugin. ${JSON.stringify(sudoRequestValidator.errors, null, 2)}`);
|
|
113
|
+
for (const plan of plans) {
|
|
114
|
+
if (plan.operation !== ResourceOperation.DESTROY) {
|
|
115
|
+
throw new Error(`Expect resource operation to be 'destroy' but instead received plan: \n ${JSON.stringify(plans, null, 2)}`);
|
|
171
116
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
const result = await sudoSpawn(command, options);
|
|
175
|
-
process.send({
|
|
176
|
-
cmd: MessageCmd.SUDO_REQUEST + '_Response',
|
|
177
|
-
data: result,
|
|
178
|
-
requestId,
|
|
117
|
+
await destroyPlugin.apply({
|
|
118
|
+
planId: plan.planId
|
|
179
119
|
});
|
|
180
120
|
}
|
|
181
|
-
|
|
121
|
+
if (options?.validateDestroy) {
|
|
122
|
+
await options.validateDestroy(plans);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
destroyPlugin.kill();
|
|
127
|
+
}
|
|
182
128
|
}
|
|
183
|
-
addNamesToConfigs(configs) {
|
|
129
|
+
static addNamesToConfigs(configs) {
|
|
184
130
|
const configsWithNames = new Array();
|
|
185
131
|
const typeSet = new Set(configs.map((c) => c.type));
|
|
186
132
|
for (const type of typeSet) {
|
|
@@ -193,32 +139,4 @@ ${JSON.stringify(modifyPlans, null, 2)}`);
|
|
|
193
139
|
return configsWithNames;
|
|
194
140
|
}
|
|
195
141
|
}
|
|
196
|
-
async function sudoSpawn(cmd, opts) {
|
|
197
|
-
return new Promise((resolve) => {
|
|
198
|
-
const output = [];
|
|
199
|
-
const _cmd = `sudo ${cmd}`;
|
|
200
|
-
const _process = spawn(`source ~/.zshrc; ${_cmd}`, [], {
|
|
201
|
-
...opts,
|
|
202
|
-
shell: 'zsh',
|
|
203
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
204
|
-
});
|
|
205
|
-
const { stderr, stdout } = _process;
|
|
206
|
-
stdout.setEncoding('utf8');
|
|
207
|
-
stderr.setEncoding('utf8');
|
|
208
|
-
stdout.on('data', (data) => {
|
|
209
|
-
output.push(data.toString());
|
|
210
|
-
});
|
|
211
|
-
stderr.on('data', (data) => {
|
|
212
|
-
output.push(data.toString());
|
|
213
|
-
});
|
|
214
|
-
stdout.pipe(process.stdout);
|
|
215
|
-
stderr.pipe(process.stderr);
|
|
216
|
-
_process.on('close', (code) => {
|
|
217
|
-
resolve({
|
|
218
|
-
data: output.join(''),
|
|
219
|
-
status: code === 0 ? SpawnStatus.SUCCESS : SpawnStatus.ERROR,
|
|
220
|
-
});
|
|
221
|
-
});
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
142
|
//# sourceMappingURL=plugin-tester.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-tester.js","sourceRoot":"","sources":["../src/plugin-tester.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"plugin-tester.js","sourceRoot":"","sources":["../src/plugin-tester.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAIL,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,OAAO,YAAY;IACvB,MAAM,CAAC,KAAK,CAAC,QAAQ,CAC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AAC;YAC3B,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;YAC/D,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC/B,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAA,CAAC,CAAC,CAAC,CAAC;YAC7E,CAAC;YAED,gBAAgB,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codify-plugin-test",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"lodash.matches": "^4.6.0",
|
|
20
20
|
"lodash.differencewith": "4.5.0",
|
|
21
21
|
"lodash.unionby": "^4.8.0",
|
|
22
|
-
"nanoid": "^5.0.9"
|
|
22
|
+
"nanoid": "^5.0.9",
|
|
23
|
+
"chalk": "^5.4.1"
|
|
23
24
|
},
|
|
24
25
|
"devDependencies": {
|
|
25
26
|
"@oclif/prettier-config": "^0.2.1",
|