@squiz/dxp-cli-next 5.15.0-develop.2 → 5.15.0-develop.3
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.
|
@@ -58,20 +58,19 @@ const createGetPortCommand = () => {
|
|
|
58
58
|
console.log(`Download report: ${reportLink}`);
|
|
59
59
|
console.log(`Download artifacts: ${artifactsLink}`);
|
|
60
60
|
console.log('');
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
const excludedStages = [
|
|
62
|
+
dxp_porter_shared_1.Stage['component-transform'],
|
|
63
|
+
dxp_porter_shared_1.Stage['design-dedupe'],
|
|
64
|
+
// Hide validation stage from user (PERSONIZE-771)
|
|
65
|
+
dxp_porter_shared_1.Stage.validation,
|
|
66
|
+
];
|
|
67
|
+
const stagesToLog = Object.values(dxp_porter_shared_1.Stage).filter(stage => !excludedStages.includes(stage));
|
|
68
|
+
for (const stage of stagesToLog) {
|
|
66
69
|
const stageString = stage.replace(/-/, ' ');
|
|
67
70
|
console.log(`Stage ${stageString} status: ${stages[stage].status}`);
|
|
68
71
|
}
|
|
69
72
|
console.log('');
|
|
70
|
-
for (const stage of
|
|
71
|
-
if (stage === dxp_porter_shared_1.Stage['component-transform'] ||
|
|
72
|
-
stage === dxp_porter_shared_1.Stage['design-dedupe']) {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
73
|
+
for (const stage of stagesToLog) {
|
|
75
74
|
const stageString = stage.replace(/-/, ' ');
|
|
76
75
|
console.log(`Stage ${stageString} settings:`, stageSettings[stage]);
|
|
77
76
|
}
|
|
@@ -187,14 +187,23 @@ describe('getPort', () => {
|
|
|
187
187
|
expect(logSpy).toHaveBeenNthCalledWith(7, 'Stage crawl status: complete');
|
|
188
188
|
expect(logSpy).toHaveBeenNthCalledWith(8, 'Stage index status: skipped');
|
|
189
189
|
expect(logSpy).toHaveBeenNthCalledWith(9, 'Stage template dedupe status: skipped');
|
|
190
|
-
|
|
191
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
196
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
197
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
190
|
+
// Validation stage is not logged (PERSONIZE-771)
|
|
191
|
+
// expect(logSpy).toHaveBeenNthCalledWith(
|
|
192
|
+
// 10,
|
|
193
|
+
// 'Stage validation status: skipped'
|
|
194
|
+
// );
|
|
195
|
+
expect(logSpy).toHaveBeenNthCalledWith(10, 'Stage report status: skipped');
|
|
196
|
+
expect(logSpy).toHaveBeenNthCalledWith(11, '');
|
|
197
|
+
expect(logSpy).toHaveBeenNthCalledWith(12, 'Stage crawl settings:', mockGetResponse['stage-settings'].crawl);
|
|
198
|
+
expect(logSpy).toHaveBeenNthCalledWith(13, 'Stage index settings:', mockGetResponse['stage-settings'].index);
|
|
199
|
+
expect(logSpy).toHaveBeenNthCalledWith(14, 'Stage template dedupe settings:', mockGetResponse['stage-settings']['template-dedupe']);
|
|
200
|
+
// Validation stage is not logged (PERSONIZE-771)
|
|
201
|
+
// expect(logSpy).toHaveBeenNthCalledWith(
|
|
202
|
+
// 16,
|
|
203
|
+
// 'Stage validation settings:',
|
|
204
|
+
// mockGetResponse['stage-settings'].validation
|
|
205
|
+
// );
|
|
206
|
+
expect(logSpy).toHaveBeenNthCalledWith(15, 'Stage report settings:', mockGetResponse['stage-settings'].report);
|
|
198
207
|
}));
|
|
199
208
|
it('should successfully retrieve the port details and log this to the console with non-null links', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
200
209
|
const mockStatus = dxp_porter_shared_1.PortStatus.complete;
|
|
@@ -243,13 +252,22 @@ describe('getPort', () => {
|
|
|
243
252
|
expect(logSpy).toHaveBeenNthCalledWith(7, 'Stage crawl status: complete');
|
|
244
253
|
expect(logSpy).toHaveBeenNthCalledWith(8, 'Stage index status: skipped');
|
|
245
254
|
expect(logSpy).toHaveBeenNthCalledWith(9, 'Stage template dedupe status: skipped');
|
|
246
|
-
|
|
247
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
252
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
253
|
-
expect(logSpy).toHaveBeenNthCalledWith(
|
|
255
|
+
// Validation stage is not logged (PERSONIZE-771)
|
|
256
|
+
// expect(logSpy).toHaveBeenNthCalledWith(
|
|
257
|
+
// 10,
|
|
258
|
+
// 'Stage validation status: skipped'
|
|
259
|
+
// );
|
|
260
|
+
expect(logSpy).toHaveBeenNthCalledWith(10, 'Stage report status: skipped');
|
|
261
|
+
expect(logSpy).toHaveBeenNthCalledWith(11, '');
|
|
262
|
+
expect(logSpy).toHaveBeenNthCalledWith(12, 'Stage crawl settings:', mockGetResponse['stage-settings'].crawl);
|
|
263
|
+
expect(logSpy).toHaveBeenNthCalledWith(13, 'Stage index settings:', mockGetResponse['stage-settings'].index);
|
|
264
|
+
expect(logSpy).toHaveBeenNthCalledWith(14, 'Stage template dedupe settings:', mockGetResponse['stage-settings']['template-dedupe']);
|
|
265
|
+
// Validation stage is not logged (PERSONIZE-771)
|
|
266
|
+
// expect(logSpy).toHaveBeenNthCalledWith(
|
|
267
|
+
// 16,
|
|
268
|
+
// 'Stage validation settings:',
|
|
269
|
+
// mockGetResponse['stage-settings'].validation
|
|
270
|
+
// );
|
|
271
|
+
expect(logSpy).toHaveBeenNthCalledWith(15, 'Stage report settings:', mockGetResponse['stage-settings'].report);
|
|
254
272
|
}));
|
|
255
273
|
});
|
|
@@ -23,7 +23,12 @@ const dxp_porter_shared_1 = require("@squiz/dxp-porter-shared");
|
|
|
23
23
|
const constants_1 = require("../../constants");
|
|
24
24
|
const { version: cliVersion } = require('../../../../package.json');
|
|
25
25
|
const allPortStages = Object.values(dxp_porter_shared_1.Stage);
|
|
26
|
-
const
|
|
26
|
+
const stagesToSkip = [
|
|
27
|
+
dxp_porter_shared_1.Stage['component-transform'],
|
|
28
|
+
dxp_porter_shared_1.Stage['design-dedupe'],
|
|
29
|
+
dxp_porter_shared_1.Stage.validation,
|
|
30
|
+
];
|
|
31
|
+
const stageDirsToCreate = allPortStages.filter(stage => !stagesToSkip.includes(stage));
|
|
27
32
|
const createAddProjectCommand = () => {
|
|
28
33
|
const addCommand = new commander_1.Command('addProject')
|
|
29
34
|
.description('Adds a new project')
|
|
@@ -205,10 +205,12 @@ describe('addProject', () => {
|
|
|
205
205
|
expect(PorterUtils.buildPorterUrl).toHaveBeenCalled();
|
|
206
206
|
expect(PorterUtils.doesPathExist).toHaveBeenCalled();
|
|
207
207
|
expect(promises_1.default.access).toHaveBeenCalled();
|
|
208
|
-
// Create project dir, create "stage-configs" directory, create directories for (crawl, index, template-dedupe,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
// Create project dir, create "stage-configs" directory, create directories for (crawl, index, template-dedupe, report)
|
|
209
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
210
|
+
expect(promises_1.default.mkdir).toHaveBeenCalledTimes(6);
|
|
211
|
+
// Create project config.json as well as 4 example config.json (for each stage)
|
|
212
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
213
|
+
expect(promises_1.default.writeFile).toHaveBeenCalledTimes(5);
|
|
212
214
|
expect(promises_1.default.writeFile).toHaveBeenNthCalledWith(1, expect.any(String), expect.stringContaining(mockCliVersion));
|
|
213
215
|
expect(mockClient.put).toHaveBeenCalled();
|
|
214
216
|
expect(promises_1.default.rm).toHaveBeenCalled();
|
|
@@ -233,9 +235,11 @@ describe('addProject', () => {
|
|
|
233
235
|
expect(PorterUtils.doesPathExist).toHaveBeenCalled();
|
|
234
236
|
expect(promises_1.default.access).toHaveBeenCalled();
|
|
235
237
|
// Create project dir, create "stage-configs" directory, create directories for (crawl, index, template-dedupe, validation, report)
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
238
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
239
|
+
expect(promises_1.default.mkdir).toHaveBeenCalledTimes(6);
|
|
240
|
+
// Create project config.json as well as 4 example config.json (for each stage)
|
|
241
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
242
|
+
expect(promises_1.default.writeFile).toHaveBeenCalledTimes(5);
|
|
239
243
|
expect(promises_1.default.writeFile).toHaveBeenNthCalledWith(1, expect.any(String), expect.stringContaining(mockCliVersion));
|
|
240
244
|
expect(mockClient.put).toHaveBeenCalled();
|
|
241
245
|
expect(PorterUtils.handleCommandError).not.toHaveBeenCalled();
|
|
@@ -258,9 +262,11 @@ describe('addProject', () => {
|
|
|
258
262
|
expect(PorterUtils.doesPathExist).toHaveBeenCalled();
|
|
259
263
|
expect(promises_1.default.access).toHaveBeenCalled();
|
|
260
264
|
// Create project dir, create "stage-configs" directory, create directories for (crawl, index, template-dedupe, validation, report)
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
265
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
266
|
+
expect(promises_1.default.mkdir).toHaveBeenCalledTimes(6);
|
|
267
|
+
// Create project config.json as well as 4 example config.json (for each stage)
|
|
268
|
+
// But validation stage is not created (PERSONIZE-771)
|
|
269
|
+
expect(promises_1.default.writeFile).toHaveBeenCalledTimes(5);
|
|
264
270
|
expect(promises_1.default.writeFile).toHaveBeenNthCalledWith(1, expect.any(String), expect.stringContaining(mockCliVersion));
|
|
265
271
|
expect(mockClient.put).toHaveBeenCalled();
|
|
266
272
|
expect(promises_1.default.rm).not.toHaveBeenCalled();
|
|
@@ -11,8 +11,8 @@ const createProjectCommand = () => {
|
|
|
11
11
|
const projectCommand = new commander_1.Command('project');
|
|
12
12
|
projectCommand
|
|
13
13
|
.description('Porter project commands')
|
|
14
|
-
.addCommand((0, get_1.default)())
|
|
15
14
|
.addCommand((0, add_1.default)())
|
|
15
|
+
.addCommand((0, get_1.default)())
|
|
16
16
|
.addCommand((0, remove_1.default)());
|
|
17
17
|
return projectCommand;
|
|
18
18
|
};
|