@zowe/cli 6.40.3 → 6.40.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zowe/cli",
3
- "version": "6.40.3",
3
+ "version": "6.40.6",
4
4
  "description": "Zowe CLI is a command line interface (CLI) that provides a simple and streamlined way to interact with IBM z/OS.",
5
5
  "author": "Zowe",
6
6
  "license": "EPL-2.0",
@@ -55,18 +55,18 @@
55
55
  "typedocSpecifySrc": "typedoc --options ./typedoc.json"
56
56
  },
57
57
  "dependencies": {
58
- "@zowe/core-for-zowe-sdk": "6.40.3",
59
- "@zowe/imperative": "4.18.5",
58
+ "@zowe/core-for-zowe-sdk": "6.40.6",
59
+ "@zowe/imperative": "4.18.8",
60
60
  "@zowe/perf-timing": "1.0.7",
61
- "@zowe/provisioning-for-zowe-sdk": "6.40.3",
62
- "@zowe/zos-console-for-zowe-sdk": "6.40.3",
63
- "@zowe/zos-files-for-zowe-sdk": "6.40.3",
64
- "@zowe/zos-jobs-for-zowe-sdk": "6.40.3",
65
- "@zowe/zos-logs-for-zowe-sdk": "6.40.3",
66
- "@zowe/zos-tso-for-zowe-sdk": "6.40.3",
67
- "@zowe/zos-uss-for-zowe-sdk": "6.40.3",
68
- "@zowe/zos-workflows-for-zowe-sdk": "6.40.3",
69
- "@zowe/zosmf-for-zowe-sdk": "6.40.3",
61
+ "@zowe/provisioning-for-zowe-sdk": "6.40.6",
62
+ "@zowe/zos-console-for-zowe-sdk": "6.40.6",
63
+ "@zowe/zos-files-for-zowe-sdk": "6.40.6",
64
+ "@zowe/zos-jobs-for-zowe-sdk": "6.40.6",
65
+ "@zowe/zos-logs-for-zowe-sdk": "6.40.6",
66
+ "@zowe/zos-tso-for-zowe-sdk": "6.40.6",
67
+ "@zowe/zos-uss-for-zowe-sdk": "6.40.6",
68
+ "@zowe/zos-workflows-for-zowe-sdk": "6.40.6",
69
+ "@zowe/zosmf-for-zowe-sdk": "6.40.6",
70
70
  "get-stdin": "7.0.0",
71
71
  "minimatch": "3.0.4"
72
72
  },
@@ -1,85 +0,0 @@
1
- /*
2
- * This program and the accompanying materials are made available under the terms of the
3
- * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4
- * https://www.eclipse.org/legal/epl-v20.html
5
- *
6
- * SPDX-License-Identifier: EPL-2.0
7
- *
8
- * Copyright Contributors to the Zowe Project.
9
- *
10
- */
11
-
12
- /**
13
- * Read in a directory containing json files of runs of scripts/performanceTest.js
14
- * from different systems, and analyze the results, providing a summary
15
- */
16
-
17
- const fs = require("fs");
18
- const {TextUtils} = require("@brightside/imperative");
19
- const {resolve} = require("path");
20
- const jsonFilesDirectory = resolve(process.argv[2]);
21
- if (jsonFilesDirectory == null) {
22
- console.error("You must specify a directory containing performance test JSON files as the " +
23
- "first positional argument to this script.");
24
- process.exit(1);
25
- }
26
-
27
- console.log("Analyzing performance test results in the directory '%s'", jsonFilesDirectory);
28
- const filesInDir = fs.readdirSync(jsonFilesDirectory);
29
- const jsonFiles = [];
30
- for (const file of filesInDir) {
31
- if (file.indexOf(".json") >= 0) {
32
- jsonFiles.push(file);
33
- }
34
- }
35
-
36
- const finalResults = {};
37
-
38
- for (const file of jsonFiles) {
39
- const jsonResult = require(resolve(jsonFilesDirectory + "/" + file));
40
- for (const result of jsonResult.results) {
41
- if (finalResults[result.label] == null) {
42
- // if this is the first time we've seen this label, initialize the result for the task
43
- finalResults[result.label] = {
44
- longest: -1,
45
- shortest: 99999999999999999999999999999,
46
- numResults: 0,
47
- total: 0,
48
- average: 0
49
- };
50
- }
51
-
52
- finalResults[result.label].total += result.elapsedTime;
53
- finalResults[result.label].numResults++;
54
- if (finalResults[result.label].longest < result.elapsedTime) {
55
- finalResults[result.label].longest = result.elapsedTime;
56
- }
57
- if (finalResults[result.label].shortest > result.elapsedTime) {
58
- finalResults[result.label].shortest = result.elapsedTime;
59
- }
60
- }
61
- }
62
-
63
- for (const label of Object.keys(finalResults)) {
64
- finalResults[label].average = (finalResults[label].total / finalResults[label].numResults).toFixed(2);
65
- }
66
-
67
- /**
68
- * Get a report of the results
69
- *
70
- * First, add human-readable keys to the result object
71
- */
72
- const stringifiedResults = Object.keys(finalResults).map(function (label) {
73
- const result = finalResults[label];
74
- const newResult = {};
75
- newResult.Task = label;
76
- newResult["Shortest time (ms)"] = result.shortest;
77
- newResult["Average time (ms)"] = result.average;
78
- newResult["Longest time (ms)"] = result.longest;
79
- newResult["Number of tests"] = result.numResults;
80
- delete newResult.elapsedTime;
81
- return newResult;
82
- });
83
-
84
- const resultTable = TextUtils.getTable(stringifiedResults, "blue", undefined, undefined, true);
85
- console.log("\n" + resultTable);
@@ -1,128 +0,0 @@
1
- /*
2
- * This program and the accompanying materials are made available under the terms of the
3
- * Eclipse Public License v2.0 which accompanies this distribution, and is available at
4
- * https://www.eclipse.org/legal/epl-v20.html
5
- *
6
- * SPDX-License-Identifier: EPL-2.0
7
- *
8
- * Copyright Contributors to the Zowe Project.
9
- *
10
- */
11
-
12
- const childProcess = require("child_process");
13
- const moment = require("moment");
14
- const os = require("os");
15
- const {IO, TextUtils} = require("@brightside/imperative");
16
- const fs = require("fs");
17
- const {resolve, join} = require("path");
18
-
19
- const tempHomeDir = resolve(__dirname + "/../__tests__/__results__/performance");
20
- const resultFile = tempHomeDir + "/results.txt";
21
- IO.createDirsSyncFromFilePath(resultFile);
22
- const resultJSONFile = join(tempHomeDir, `results_${moment().format('x')}.json`);
23
- const packageName = "@brightside/core";
24
- const binName = "bright";
25
-
26
- const header = `Performance Tests\nCurrent time ${moment()}\nPlatform '${os.platform()}'. Architecture '${os.arch()}'\n` +
27
- `Total Memory: ${os.totalmem()}. Free memory ${os.freemem()}\n` +
28
- `Number of CPUs ${os.cpus().length}.\n` +
29
- `User name: ${os.userInfo().username}\n`;
30
- console.log(header);
31
- IO.writeFile(resultFile, header);
32
-
33
- const results = [];
34
-
35
- /**
36
- * Set the current home directory
37
- */
38
- const env = JSON.parse(JSON.stringify(process.env)); // copy the current environmental variables
39
- env.ZOWE_CLI_HOME = tempHomeDir;
40
- deleteHomeDirectory();
41
- uninstallBrightside();
42
-
43
- /**
44
- * Execute our list of performance test tasks here
45
- */
46
- results.push(execTimed(`npm install -g ${packageName}@next`, "Install @next version of Brightside"));
47
- results.push(execTimed(`${binName} --help`, `Issue ${binName} --help (no plugins) `));
48
- results.push(execTimed(`${binName} profiles list zosmf --rfj`, "List zosmf profiles (no plugins) "));
49
- results.push(execTimed(`${binName} plugins install @brightside/filemasterplus`, "Install filemaster plugin "));
50
- results.push(execTimed(`${binName} --help`, `Issue ${binName} --help (1 plugin) `));
51
- results.push(execTimed(`${binName} plugins install @brightside/endevor`, "Install endevor plugin (with filemaster installed) "));
52
- results.push(execTimed(`${binName} --help`, `Issue ${binName} --help (2 plugins) `));
53
- results.push(execTimed(`${binName} profiles list zosmf --rfj`, "List zosmf profiles (2 plugins) "));
54
-
55
- /**
56
- * Get a report of the results
57
- *
58
- * First, add human-readable keys to the result object
59
- */
60
- const stringifiedResults = results.map(function (result) {
61
- const newResult = JSON.parse(JSON.stringify(result)); // copy the result before modifying
62
- if (newResult.Passed != null) {
63
- newResult.Passed = newResult.Passed ? TextUtils.chalk.green(":)") : TextUtils.chalk.red("X");
64
- }
65
- newResult["Elapsed Time (ms)"] = newResult.elapsedTime;
66
- newResult.Task = newResult.label;
67
- delete newResult.label;
68
- delete newResult.elapsedTime;
69
- return newResult;
70
- });
71
- const resultTable = TextUtils.getTable(stringifiedResults, "blue", undefined, undefined, true);
72
- console.log("\n" + resultTable);
73
- IO.writeFile(resultFile, resultTable);
74
- IO.writeFile(resultJSONFile, JSON.stringify({header, results}, null, 2));
75
-
76
- /**
77
- * Execute a command synchronously and time how long it takes to execute
78
- * @param command - the command to execute
79
- * @param label - label for the action you are performing with this command
80
- * @param expectedTime - the amount of time in milliseconds you expect this command to take
81
- */
82
- function execTimed(command, label, expectedTime) {
83
- console.log("Running '%s'\n", command);
84
- const beforeTimeStamp = moment();
85
- const outputFileName = join(tempHomeDir, "output/" + label + ".txt");
86
- IO.createDirsSyncFromFilePath(outputFileName);
87
- const outputFileStream = fs.openSync(outputFileName, "w+");
88
-
89
- childProcess.execSync(command, {env, stdio: ["inherit", outputFileStream, outputFileStream]});
90
- const afterTimeStamp = moment();
91
- const elapsedTime = afterTimeStamp.diff(beforeTimeStamp);
92
- let timeGreaterThanExpected = undefined;
93
- const result = {label, elapsedTime};
94
- if (expectedTime != null) {
95
- timeGreaterThanExpected = elapsedTime > expectedTime;
96
- if (timeGreaterThanExpected) {
97
- result.Passed = false;
98
- } else if (timeGreaterThanExpected === false) {
99
- // don't set timeGreaterThanExpected if there's no expected time
100
- result.Passed = true;
101
- }
102
- }
103
-
104
- return result;
105
- }
106
-
107
- /**
108
- * Delete the temporary brightside home directory
109
- */
110
- function deleteHomeDirectory() {
111
- console.log("Deleting %s...", tempHomeDir);
112
- try {
113
- require("rimraf").sync(tempHomeDir);
114
- } catch (rimrafError) {
115
- throw new Error("Failed to delete " + tempHomeDir + ". Rimraf error:" + rimrafError);
116
- }
117
- }
118
-
119
- function uninstallBrightside() {
120
- console.log("Uninstalling %s before global install\n", packageName);
121
- const outputFileName = join(tempHomeDir, "output/uninstall.txt");
122
- IO.createDirsSyncFromFilePath(outputFileName);
123
- const outputFileStream = fs.openSync(outputFileName, "w+");
124
- childProcess.execSync(`npm uninstall -g ${packageName}`, {
125
- env,
126
- stdio: ["inherit", outputFileStream, outputFileStream]
127
- });
128
- }