@gatling.io/cli 3.11.7 → 3.12.0
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 +4 -4
- package/src/bundle.ts +36 -0
- package/src/commands/build.ts +30 -0
- package/src/commands/enterpriseDeploy.ts +88 -0
- package/src/commands/enterprisePackage.ts +41 -0
- package/src/commands/enterpriseStart.ts +113 -0
- package/src/commands/index.ts +25 -0
- package/src/commands/install.ts +19 -0
- package/src/commands/options.ts +263 -0
- package/src/commands/recorder.ts +41 -0
- package/src/commands/run.ts +78 -0
- package/src/commands/runOnly.ts +56 -0
- package/src/dependencies/coursier.ts +82 -0
- package/src/dependencies/download.ts +11 -0
- package/src/dependencies/graalVm.ts +74 -0
- package/src/dependencies/index.ts +44 -0
- package/src/dependencies/os.ts +24 -0
- package/src/dependencies/versions.ts +12 -0
- package/src/enterprise.ts +225 -0
- package/src/index.ts +5 -0
- package/src/java.ts +48 -0
- package/src/log.ts +19 -0
- package/src/readline.ts +39 -0
- package/src/run.ts +67 -0
- package/src/simulations.ts +29 -0
- package/target/commands/build.d.ts +3 -0
- package/target/commands/build.js +20 -0
- package/target/commands/enterpriseDeploy.d.ts +3 -0
- package/target/commands/enterpriseDeploy.js +59 -0
- package/target/commands/enterprisePackage.d.ts +3 -0
- package/target/commands/enterprisePackage.js +26 -0
- package/target/commands/enterpriseStart.d.ts +3 -0
- package/target/commands/enterpriseStart.js +75 -0
- package/target/commands/index.d.ts +2 -0
- package/target/commands/index.js +28 -0
- package/target/commands/install.d.ts +3 -0
- package/target/commands/install.js +18 -0
- package/target/commands/options.d.ts +46 -0
- package/target/commands/options.js +169 -0
- package/target/commands/recorder.d.ts +3 -0
- package/target/commands/recorder.js +28 -0
- package/target/commands/run.d.ts +3 -0
- package/target/commands/run.js +51 -0
- package/target/commands/runOnly.d.ts +3 -0
- package/target/commands/runOnly.js +37 -0
- package/target/dependencies/index.d.ts +1 -0
- package/target/dependencies/index.js +3 -1
- package/target/dependencies/versions.js +2 -2
- package/target/enterprise.js +5 -5
- package/target/index.js +2 -337
- package/target/run.js +4 -2
- package/tsconfig.json +18 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.waitForRunEndOptionValue = exports.waitForRunEndOption = exports.runDescriptionOptionValue = exports.runDescriptionOption = exports.runTitleOptionValue = exports.runTitleOption = exports.enterpriseSimulationOptionValue = exports.enterpriseSimulationOption = exports.packageDescriptorFilenameOptionValue = exports.packageDescriptorFilenameOption = exports.controlPlaneUrlOptionValue = exports.controlPlaneUrlOption = exports.apiTokenOptionValue = exports.apiTokenOption = exports.urlOptionValue = exports.urlOption = exports.parseRunParametersArgument = exports.runParametersArgument = exports.nonInteractiveOptionValue = exports.nonInteractiveOption = exports.memoryOptionValue = exports.memoryOption = exports.jvmClasspathMandatoryOptionValue = exports.jvmClasspathMandatoryOption = exports.graalvmHomeMandatoryOptionValue = exports.graalvmHomeMandatoryOption = exports.typescriptOptionValueWithDefaults = exports.typescriptOption = exports.resultsFolderOptionValue = exports.resultsFolderOption = exports.resourcesFolderOptionValue = exports.resourcesFolderOption = exports.packageFileOptionValue = exports.packageFileOption = exports.bundleFileOptionValue = exports.bundleFileOption = exports.simulationMandatoryOptionValue = exports.simulationMandatoryOption = exports.simulationOptionValueWithDefaults = exports.simulationOption = exports.sourcesFolderOptionValue = exports.sourcesFolderOption = exports.gatlingHomeOptionValueWithDefaults = exports.gatlingHomeOption = void 0;
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const os_1 = __importDefault(require("os"));
|
|
9
|
+
const readline_1 = require("../readline");
|
|
10
|
+
const log_1 = require("../log");
|
|
11
|
+
const getStringValueOptional = (option) => (options) => {
|
|
12
|
+
const value = options[option.attributeName()];
|
|
13
|
+
if (typeof value === "string" || typeof value === "undefined") {
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
throw Error(`Expected type string|undefined for attribute ${option.attributeName()}, got ${typeof value} - please report this as a bug.`);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const getStringValueMandatory = (option) => (options) => {
|
|
21
|
+
const value = options[option.attributeName()];
|
|
22
|
+
if (typeof value === "string") {
|
|
23
|
+
return value;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
throw Error(`Expected type string for attribute ${option.attributeName()}, got ${typeof value} - please report this as a bug.`);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const getBooleanValueOptional = (option) => (options) => {
|
|
30
|
+
const value = options[option.attributeName()];
|
|
31
|
+
if (typeof value === "boolean" || typeof value === "undefined") {
|
|
32
|
+
return value;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw Error(`Expected type boolean|undefined for attribute ${option.attributeName()}, got ${typeof value} - please report this as a bug.`);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const getBooleanValueMandatory = (option) => (options) => {
|
|
39
|
+
const value = options[option.attributeName()];
|
|
40
|
+
if (typeof value === "boolean") {
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
throw Error(`Expected type boolean for attribute ${option.attributeName()}, got ${typeof value} - please report this as a bug.`);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const getNumberValueOptional = (option) => (options) => {
|
|
48
|
+
const value = options[option.attributeName()];
|
|
49
|
+
if (typeof value === "number" || typeof value === "undefined") {
|
|
50
|
+
return value;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
throw Error(`Expected type number|undefined for attribute ${option.attributeName()}, got ${typeof value} - please report this as a bug.`);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
exports.gatlingHomeOption = new commander_1.Option("--gatling-home <value>", 'The folder used to download and install Gatling components (default: "~/.gatling")');
|
|
57
|
+
const gatlingHomeOptionValueWithDefaults = (options) => getStringValueOptional(exports.gatlingHomeOption)(options) || `${os_1.default.homedir()}/.gatling`;
|
|
58
|
+
exports.gatlingHomeOptionValueWithDefaults = gatlingHomeOptionValueWithDefaults;
|
|
59
|
+
exports.sourcesFolderOption = new commander_1.Option("--sources-folder <value>", "The sources folder path").default("src");
|
|
60
|
+
exports.sourcesFolderOptionValue = getStringValueMandatory(exports.sourcesFolderOption);
|
|
61
|
+
exports.simulationOption = new commander_1.Option("--simulation <value>", "The simulation entry point function name (default: if only one *.gatling.js or *.gatling.ts file is found, will execute that simulation)");
|
|
62
|
+
const simulationOptionValueWithDefaults = (options, simulationsFound, interactive) => {
|
|
63
|
+
const declaredSimulation = getStringValueOptional(exports.simulationOption)(options);
|
|
64
|
+
if (declaredSimulation !== undefined) {
|
|
65
|
+
return declaredSimulation;
|
|
66
|
+
}
|
|
67
|
+
else if (simulationsFound.length === 1) {
|
|
68
|
+
return simulationsFound[0].name;
|
|
69
|
+
}
|
|
70
|
+
else if (simulationsFound.length === 0) {
|
|
71
|
+
throw new Error("No simulation found, simulations must be defined in a <simulation name>.gatling.js or <simulation name>.gatling.ts file)");
|
|
72
|
+
}
|
|
73
|
+
else if (interactive) {
|
|
74
|
+
const idx = (0, readline_1.keyInSelectPaginated)(simulationsFound.map((s) => s.name).sort((a, b) => a.localeCompare(b)), "Choose a simulation to run");
|
|
75
|
+
if (idx >= 0) {
|
|
76
|
+
const simulation = simulationsFound[idx].name;
|
|
77
|
+
log_1.logger.info(`Simulation '${simulation}' was chosen.`);
|
|
78
|
+
return simulation;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
throw new Error("Simulation choice was cancelled.");
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
throw new Error(`Several simulations found, specify one using the --simulation option (available simulations: ${simulationsFound.map((s) => s.name)})`);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
exports.simulationOptionValueWithDefaults = simulationOptionValueWithDefaults;
|
|
89
|
+
exports.simulationMandatoryOption = new commander_1.Option("--simulation <value>", "The simulation entry point function name").makeOptionMandatory(true);
|
|
90
|
+
exports.simulationMandatoryOptionValue = getStringValueMandatory(exports.simulationMandatoryOption);
|
|
91
|
+
exports.bundleFileOption = new commander_1.Option("--bundle-file <value>", "The target bundle file path when building simulations (must have a .js extension)")
|
|
92
|
+
.default("target/bundle.js")
|
|
93
|
+
.argParser((value) => {
|
|
94
|
+
if (!value.endsWith(".js")) {
|
|
95
|
+
throw Error(`'${value}' is not a valid bundle file path: should have a .js extension`);
|
|
96
|
+
}
|
|
97
|
+
return value;
|
|
98
|
+
});
|
|
99
|
+
exports.bundleFileOptionValue = getStringValueMandatory(exports.bundleFileOption);
|
|
100
|
+
exports.packageFileOption = new commander_1.Option("--package-file <value>", "The target package file path when packaging simulations for Gatling Enterprise (must have a .zip extension)")
|
|
101
|
+
.default("target/package.zip")
|
|
102
|
+
.argParser((value) => {
|
|
103
|
+
if (!value.endsWith(".zip")) {
|
|
104
|
+
throw Error(`'${value}' is not a valid package file path: should have a .zip extension`);
|
|
105
|
+
}
|
|
106
|
+
return value;
|
|
107
|
+
});
|
|
108
|
+
exports.packageFileOptionValue = getStringValueMandatory(exports.packageFileOption);
|
|
109
|
+
exports.resourcesFolderOption = new commander_1.Option("--resources-folder <value>", "The resources folder path").default("resources");
|
|
110
|
+
exports.resourcesFolderOptionValue = getStringValueMandatory(exports.resourcesFolderOption);
|
|
111
|
+
exports.resultsFolderOption = new commander_1.Option("--results-folder <value>", "The results folder path").default("target/gatling");
|
|
112
|
+
exports.resultsFolderOptionValue = getStringValueMandatory(exports.resultsFolderOption);
|
|
113
|
+
exports.typescriptOption = new commander_1.Option("--typescript", "Use the typescript compiler to compile your code (default: true if the sourcesFolder contains any *.gatling.ts file, false otherwise)");
|
|
114
|
+
const typescriptOptionValueWithDefaults = (options, simulationsFound) => {
|
|
115
|
+
const value = getBooleanValueOptional(exports.typescriptOption)(options);
|
|
116
|
+
return value !== undefined ? value : simulationsFound.findIndex((s) => s.type === "typescript") >= 0;
|
|
117
|
+
};
|
|
118
|
+
exports.typescriptOptionValueWithDefaults = typescriptOptionValueWithDefaults;
|
|
119
|
+
exports.graalvmHomeMandatoryOption = new commander_1.Option("--graalvm-home <value>", "Path to the GraalVM home").makeOptionMandatory(true);
|
|
120
|
+
exports.graalvmHomeMandatoryOptionValue = getStringValueMandatory(exports.graalvmHomeMandatoryOption);
|
|
121
|
+
exports.jvmClasspathMandatoryOption = new commander_1.Option("--jvm-classpath <value>", "The classpath containing all Gatling JVM components").makeOptionMandatory(true);
|
|
122
|
+
exports.jvmClasspathMandatoryOptionValue = getStringValueMandatory(exports.jvmClasspathMandatoryOption);
|
|
123
|
+
exports.memoryOption = new commander_1.Option("--memory <value>", "Heap space memory size in MiB for Gatling. Half the total available memory is usually a good default, as the Gatling process will use more memory than just the heap space.").argParser((value) => {
|
|
124
|
+
const parsedValue = parseInt(value, 10);
|
|
125
|
+
if (isNaN(parsedValue)) {
|
|
126
|
+
throw new Error(`${value} is not a valid memory size, must be an integer number`);
|
|
127
|
+
}
|
|
128
|
+
return parsedValue;
|
|
129
|
+
});
|
|
130
|
+
exports.memoryOptionValue = getNumberValueOptional(exports.memoryOption);
|
|
131
|
+
exports.nonInteractiveOption = new commander_1.Option("--non-interactive", "Switch to non-interactive mode and fail if no simulation is explicitly specified").default(false);
|
|
132
|
+
exports.nonInteractiveOptionValue = getBooleanValueMandatory(exports.nonInteractiveOption);
|
|
133
|
+
exports.runParametersArgument = new commander_1.Argument("[optionKey=optionValue...]", "Specify one or more parameter which can be read in the simulation script with the getParameter() function; format must be key=value");
|
|
134
|
+
const parseRunParametersArgument = (args) => {
|
|
135
|
+
const parsedParameters = {};
|
|
136
|
+
for (const arg of args) {
|
|
137
|
+
const i = arg.indexOf("=");
|
|
138
|
+
if (i < 0) {
|
|
139
|
+
throw Error(`Parameter '${arg}' is not valid: format should be key=value`);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
const key = arg.slice(0, i).trim();
|
|
143
|
+
parsedParameters[key] = arg.slice(i + 1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return parsedParameters;
|
|
147
|
+
};
|
|
148
|
+
exports.parseRunParametersArgument = parseRunParametersArgument;
|
|
149
|
+
exports.urlOption = new commander_1.Option("--url <value>", "URL of Gatling Enterprise")
|
|
150
|
+
.default("https://cloud.gatling.io")
|
|
151
|
+
.hideHelp();
|
|
152
|
+
exports.urlOptionValue = getStringValueMandatory(exports.urlOption);
|
|
153
|
+
exports.apiTokenOption = new commander_1.Option("--api-token <value>", "API Token on Gatling Enterprise. Prefer configuration using `GATLING_ENTERPRISE_API_TOKEN` environment variable.");
|
|
154
|
+
exports.apiTokenOptionValue = getStringValueOptional(exports.apiTokenOption);
|
|
155
|
+
// Plugin configuration
|
|
156
|
+
exports.controlPlaneUrlOption = new commander_1.Option("--control-plane-url <value>", "URL of a control plane for Gatling Enterprise providing a private repository. If this parameter is provided, packages will be registered as private packages and uploaded through this private control plane.");
|
|
157
|
+
exports.controlPlaneUrlOptionValue = getStringValueOptional(exports.controlPlaneUrlOption);
|
|
158
|
+
// Descriptor file
|
|
159
|
+
exports.packageDescriptorFilenameOption = new commander_1.Option("--package-descriptor-filename <value>", "Path to a package descriptor inside the .gatling folder").default("package.conf");
|
|
160
|
+
exports.packageDescriptorFilenameOptionValue = getStringValueMandatory(exports.packageDescriptorFilenameOption);
|
|
161
|
+
// Deployment info
|
|
162
|
+
exports.enterpriseSimulationOption = new commander_1.Option("--enterprise-simulation <value>", "Specify the simulation name directly to bypass the prompt using the following command.");
|
|
163
|
+
exports.enterpriseSimulationOptionValue = getStringValueOptional(exports.enterpriseSimulationOption);
|
|
164
|
+
exports.runTitleOption = new commander_1.Option("--run-title <value>", "Allows setting a title for your run reports.");
|
|
165
|
+
exports.runTitleOptionValue = getStringValueOptional(exports.runTitleOption);
|
|
166
|
+
exports.runDescriptionOption = new commander_1.Option("--run-description <value>", "Allows setting a description for your run reports summary.");
|
|
167
|
+
exports.runDescriptionOptionValue = getStringValueOptional(exports.runDescriptionOption);
|
|
168
|
+
exports.waitForRunEndOption = new commander_1.Option("--wait-for-run-end", "Wait for the result after starting the simulation on Gatling Enterprise, and complete with an error if the simulation ends with any error status").default(false);
|
|
169
|
+
exports.waitForRunEndOptionValue = getBooleanValueMandatory(exports.waitForRunEndOption);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const options_1 = require("./options");
|
|
4
|
+
const simulations_1 = require("../simulations");
|
|
5
|
+
const dependencies_1 = require("../dependencies");
|
|
6
|
+
const log_1 = require("../log");
|
|
7
|
+
const run_1 = require("../run");
|
|
8
|
+
exports.default = (program) => {
|
|
9
|
+
program
|
|
10
|
+
.command("recorder")
|
|
11
|
+
.description("Run the Gatling recorder")
|
|
12
|
+
.addOption(options_1.gatlingHomeOption)
|
|
13
|
+
.addOption(options_1.sourcesFolderOption)
|
|
14
|
+
.addOption(options_1.typescriptOption)
|
|
15
|
+
.addOption(options_1.resourcesFolderOption)
|
|
16
|
+
.action(async (options) => {
|
|
17
|
+
const gatlingHome = (0, options_1.gatlingHomeOptionValueWithDefaults)(options);
|
|
18
|
+
const sourcesFolder = (0, options_1.sourcesFolderOptionValue)(options);
|
|
19
|
+
const resourcesFolder = (0, options_1.resourcesFolderOptionValue)(options);
|
|
20
|
+
const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
|
|
21
|
+
const typescript = (0, options_1.typescriptOptionValueWithDefaults)(options, simulations);
|
|
22
|
+
const { graalvmHome, coursierBinary, jvmClasspath } = await (0, dependencies_1.installRecorder)({ gatlingHome });
|
|
23
|
+
log_1.logger.debug(`graalvmHome=${graalvmHome}`);
|
|
24
|
+
log_1.logger.debug(`coursierBinary=${coursierBinary}`);
|
|
25
|
+
log_1.logger.debug(`jvmClasspath=${jvmClasspath}`);
|
|
26
|
+
await (0, run_1.runRecorder)({ graalvmHome, jvmClasspath, sourcesFolder, typescript, resourcesFolder });
|
|
27
|
+
});
|
|
28
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const options_1 = require("./options");
|
|
4
|
+
const simulations_1 = require("../simulations");
|
|
5
|
+
const dependencies_1 = require("../dependencies");
|
|
6
|
+
const log_1 = require("../log");
|
|
7
|
+
const bundle_1 = require("../bundle");
|
|
8
|
+
const run_1 = require("../run");
|
|
9
|
+
exports.default = (program) => {
|
|
10
|
+
program
|
|
11
|
+
.command("run")
|
|
12
|
+
.description("Build and run a Gatling simulation, after installing all required components and dependencies for Gatling")
|
|
13
|
+
.addOption(options_1.sourcesFolderOption)
|
|
14
|
+
.addOption(options_1.simulationOption)
|
|
15
|
+
.addOption(options_1.typescriptOption)
|
|
16
|
+
.addOption(options_1.bundleFileOption)
|
|
17
|
+
.addOption(options_1.resourcesFolderOption)
|
|
18
|
+
.addOption(options_1.resultsFolderOption)
|
|
19
|
+
.addOption(options_1.gatlingHomeOption)
|
|
20
|
+
.addOption(options_1.memoryOption)
|
|
21
|
+
.addOption(options_1.nonInteractiveOption)
|
|
22
|
+
.addArgument(options_1.runParametersArgument)
|
|
23
|
+
.action(async (args, options) => {
|
|
24
|
+
const gatlingHome = (0, options_1.gatlingHomeOptionValueWithDefaults)(options);
|
|
25
|
+
const sourcesFolder = (0, options_1.sourcesFolderOptionValue)(options);
|
|
26
|
+
const bundleFile = (0, options_1.bundleFileOptionValue)(options);
|
|
27
|
+
const resourcesFolder = (0, options_1.resourcesFolderOptionValue)(options);
|
|
28
|
+
const resultsFolder = (0, options_1.resultsFolderOptionValue)(options);
|
|
29
|
+
const memory = (0, options_1.memoryOptionValue)(options);
|
|
30
|
+
const nonInteractive = (0, options_1.nonInteractiveOptionValue)(options);
|
|
31
|
+
const runParameters = (0, options_1.parseRunParametersArgument)(args);
|
|
32
|
+
const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
|
|
33
|
+
const typescript = (0, options_1.typescriptOptionValueWithDefaults)(options, simulations);
|
|
34
|
+
const simulation = (0, options_1.simulationOptionValueWithDefaults)(options, simulations, !nonInteractive);
|
|
35
|
+
const { graalvmHome, coursierBinary, jvmClasspath } = await (0, dependencies_1.installGatlingJs)({ gatlingHome });
|
|
36
|
+
log_1.logger.debug(`graalvmHome=${graalvmHome}`);
|
|
37
|
+
log_1.logger.debug(`coursierBinary=${coursierBinary}`);
|
|
38
|
+
log_1.logger.debug(`jvmClasspath=${jvmClasspath}`);
|
|
39
|
+
await (0, bundle_1.bundle)({ sourcesFolder, bundleFile, typescript, simulations });
|
|
40
|
+
await (0, run_1.runSimulation)({
|
|
41
|
+
graalvmHome,
|
|
42
|
+
jvmClasspath,
|
|
43
|
+
simulation,
|
|
44
|
+
bundleFile,
|
|
45
|
+
resourcesFolder,
|
|
46
|
+
resultsFolder,
|
|
47
|
+
memory,
|
|
48
|
+
runParameters
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const options_1 = require("./options");
|
|
4
|
+
const run_1 = require("../run");
|
|
5
|
+
exports.default = (program) => {
|
|
6
|
+
program
|
|
7
|
+
.command("run-only")
|
|
8
|
+
.description("Run a Gatling simulation from an already built bundle")
|
|
9
|
+
.addOption(options_1.graalvmHomeMandatoryOption)
|
|
10
|
+
.addOption(options_1.jvmClasspathMandatoryOption)
|
|
11
|
+
.addOption(options_1.simulationMandatoryOption)
|
|
12
|
+
.addOption(options_1.bundleFileOption)
|
|
13
|
+
.addOption(options_1.resourcesFolderOption)
|
|
14
|
+
.addOption(options_1.resultsFolderOption)
|
|
15
|
+
.addOption(options_1.memoryOption)
|
|
16
|
+
.addArgument(options_1.runParametersArgument)
|
|
17
|
+
.action(async (args, options) => {
|
|
18
|
+
const graalvmHome = (0, options_1.graalvmHomeMandatoryOptionValue)(options);
|
|
19
|
+
const jvmClasspath = (0, options_1.jvmClasspathMandatoryOptionValue)(options);
|
|
20
|
+
const simulation = (0, options_1.simulationMandatoryOptionValue)(options);
|
|
21
|
+
const bundleFile = (0, options_1.bundleFileOptionValue)(options);
|
|
22
|
+
const resourcesFolder = (0, options_1.resourcesFolderOptionValue)(options);
|
|
23
|
+
const resultsFolder = (0, options_1.resultsFolderOptionValue)(options);
|
|
24
|
+
const memory = (0, options_1.memoryOptionValue)(options);
|
|
25
|
+
const runParameters = (0, options_1.parseRunParametersArgument)(args);
|
|
26
|
+
await (0, run_1.runSimulation)({
|
|
27
|
+
graalvmHome,
|
|
28
|
+
jvmClasspath,
|
|
29
|
+
simulation: simulation,
|
|
30
|
+
bundleFile,
|
|
31
|
+
resourcesFolder,
|
|
32
|
+
resultsFolder,
|
|
33
|
+
memory,
|
|
34
|
+
runParameters
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
};
|
|
@@ -3,10 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.installRecorder = exports.installGatlingJs = void 0;
|
|
6
|
+
exports.installRecorder = exports.installGatlingJs = exports.versions = void 0;
|
|
7
7
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
8
8
|
const coursier_1 = require("./coursier");
|
|
9
9
|
const graalVm_1 = require("./graalVm");
|
|
10
|
+
var versions_1 = require("./versions");
|
|
11
|
+
Object.defineProperty(exports, "versions", { enumerable: true, get: function () { return versions_1.versions; } });
|
|
10
12
|
const installGatlingJs = async (options) => {
|
|
11
13
|
const downloadDir = `${options.gatlingHome}/tmp/download`;
|
|
12
14
|
await promises_1.default.mkdir(downloadDir, { recursive: true });
|
package/target/enterprise.js
CHANGED
|
@@ -8,7 +8,7 @@ const archiver_1 = __importDefault(require("archiver"));
|
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const promises_1 = require("stream/promises");
|
|
10
10
|
const zlib_1 = require("zlib");
|
|
11
|
-
const
|
|
11
|
+
const dependencies_1 = require("./dependencies");
|
|
12
12
|
const java_1 = require("./java");
|
|
13
13
|
const log_1 = require("./log");
|
|
14
14
|
const enterprisePackage = async (options) => {
|
|
@@ -41,11 +41,11 @@ const generateManifest = (simulationNames) => {
|
|
|
41
41
|
"Manifest-Version: 1.0",
|
|
42
42
|
"Specification-Vendor: GatlingCorp",
|
|
43
43
|
"Gatling-Context: js",
|
|
44
|
-
`Gatling-Version: ${
|
|
44
|
+
`Gatling-Version: ${dependencies_1.versions.gatling.core}`,
|
|
45
45
|
"Gatling-Packager: js-cli",
|
|
46
|
-
`Gatling-Packager-Version: ${
|
|
46
|
+
`Gatling-Packager-Version: ${dependencies_1.versions.gatling.jsAdapter}`,
|
|
47
47
|
`Gatling-Simulations: ${simulationNames.join(",")}`,
|
|
48
|
-
`Java-Version: ${
|
|
48
|
+
`Java-Version: ${dependencies_1.versions.graalvm.jdk.split(".")[0]}`
|
|
49
49
|
];
|
|
50
50
|
const pkg = getPackageNameAndVersion();
|
|
51
51
|
lines.push(`Implementation-Title: ${pkg.name}`);
|
|
@@ -119,7 +119,7 @@ const javaArgsFromPluginOptions = (options) => {
|
|
|
119
119
|
javaArgs.push(`-Dgatling.enterprise.controlPlaneUrl=${options.controlPlaneUrl}`);
|
|
120
120
|
}
|
|
121
121
|
javaArgs.push("-Dgatling.enterprise.buildTool=js-cli");
|
|
122
|
-
javaArgs.push(`-Dgatling.enterprise.pluginVersion=${
|
|
122
|
+
javaArgs.push(`-Dgatling.enterprise.pluginVersion=${dependencies_1.versions.gatling.jsAdapter}`);
|
|
123
123
|
if (options.nonInteractive) {
|
|
124
124
|
javaArgs.push(`-Dgatling.enterprise.batchMode=true`);
|
|
125
125
|
}
|