@gatling.io/cli 0.1.1 → 3.11.2
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/target/dependencies/versions.js +2 -2
- package/target/index.js +7 -7
- package/target/run.d.ts +1 -1
- package/target/run.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gatling.io/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.11.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"gatling-js-cli": "target/index.js"
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"axios": "1.6.8",
|
|
12
12
|
"commander": "12.0.0",
|
|
13
13
|
"decompress": "4.2.1",
|
|
14
|
-
"esbuild": "0.
|
|
14
|
+
"esbuild": "0.21.2",
|
|
15
15
|
"esbuild-plugin-tsc": "0.4.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/decompress": "4.2.7",
|
|
19
|
-
"@types/node": "20.12.
|
|
19
|
+
"@types/node": "20.12.12",
|
|
20
20
|
"prettier": "3.2.5",
|
|
21
|
-
"rimraf": "5.0.
|
|
21
|
+
"rimraf": "5.0.7",
|
|
22
22
|
"typescript": "5.4.5"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
package/target/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const program = new commander_1.Command()
|
|
|
17
17
|
const gatlingHomeOption = new commander_1.Option("--gatling-home <value>", 'The folder used to download and install Gatling components (default: "~/.gatling")');
|
|
18
18
|
const gatlingHomeDirWithDefaults = (options) => options.gatlingHome || `${os_1.default.homedir()}/.gatling`;
|
|
19
19
|
const entrypointFileOption = new commander_1.Option("--entrypoint-file <value>", 'The simulation entry point source file path (default: "src/index.js", or "src/index.ts" when using the "--typescript" option)');
|
|
20
|
-
const
|
|
20
|
+
const simulationNameOption = new commander_1.Option("--simulation-name <value>", "The simulation entry point function name").default("default", '"default", compatible with using "export default"');
|
|
21
21
|
const entrypointFileWithDefaults = (options) => options.entrypointFile || (options.typescript ? "src/index.ts" : "src/index.js");
|
|
22
22
|
const bundleFileOption = new commander_1.Option("--bundle-file <value>", "The simulation target bundle file path").default("target/bundle.js");
|
|
23
23
|
const resourcesFolderOption = new commander_1.Option("--resources-folder <value>", "The resources folder path").default("resources");
|
|
@@ -53,24 +53,24 @@ program
|
|
|
53
53
|
.description("Run a Gatling simulation")
|
|
54
54
|
.addOption(graalvmHomeMandatoryOption)
|
|
55
55
|
.addOption(jvmClasspathMandatoryOption)
|
|
56
|
-
.addOption(
|
|
56
|
+
.addOption(simulationNameOption)
|
|
57
57
|
.addOption(bundleFileOption)
|
|
58
58
|
.addOption(resourcesFolderOption)
|
|
59
59
|
.addOption(resultsFolderOption)
|
|
60
60
|
.action(async (options) => {
|
|
61
61
|
const graalvmHome = options.graalvmHome;
|
|
62
62
|
const jvmClasspath = options.jvmClasspath;
|
|
63
|
-
const
|
|
63
|
+
const simulationName = options.simulationName;
|
|
64
64
|
const bundleFile = options.bundleFile;
|
|
65
65
|
const resourcesFolder = options.resourcesFolder;
|
|
66
66
|
const resultsFolder = options.resultsFolder;
|
|
67
|
-
await (0, run_1.run)({ graalvmHome, jvmClasspath,
|
|
67
|
+
await (0, run_1.run)({ graalvmHome, jvmClasspath, simulationName, bundleFile, resourcesFolder, resultsFolder });
|
|
68
68
|
});
|
|
69
69
|
program
|
|
70
70
|
.command("run")
|
|
71
71
|
.description("Build and run a Gatling simulation, after installing all required components and dependencies for Gatling")
|
|
72
72
|
.addOption(entrypointFileOption)
|
|
73
|
-
.addOption(
|
|
73
|
+
.addOption(simulationNameOption)
|
|
74
74
|
.addOption(typescriptOption)
|
|
75
75
|
.addOption(bundleFileOption)
|
|
76
76
|
.addOption(resourcesFolderOption)
|
|
@@ -79,7 +79,7 @@ program
|
|
|
79
79
|
.action(async (options) => {
|
|
80
80
|
const gatlingHome = gatlingHomeDirWithDefaults(options);
|
|
81
81
|
const entrypointFile = entrypointFileWithDefaults(options);
|
|
82
|
-
const
|
|
82
|
+
const simulationName = options.simulationName;
|
|
83
83
|
const bundleFile = options.bundleFile;
|
|
84
84
|
const resourcesFolder = options.resourcesFolder;
|
|
85
85
|
const resultsFolder = options.resultsFolder;
|
|
@@ -89,6 +89,6 @@ program
|
|
|
89
89
|
log_1.logger.debug(`coursierBinary=${coursierBinary}`);
|
|
90
90
|
log_1.logger.debug(`jvmClasspath=${jvmClasspath}`);
|
|
91
91
|
await (0, bundle_1.bundle)({ entrypointFile, bundleFile, typescript });
|
|
92
|
-
await (0, run_1.run)({ graalvmHome, jvmClasspath,
|
|
92
|
+
await (0, run_1.run)({ graalvmHome, jvmClasspath, simulationName, bundleFile, resourcesFolder, resultsFolder });
|
|
93
93
|
});
|
|
94
94
|
program.parse(process.argv);
|
package/target/run.d.ts
CHANGED
package/target/run.js
CHANGED
|
@@ -29,7 +29,7 @@ const path = __importStar(require("path"));
|
|
|
29
29
|
const log_1 = require("./log");
|
|
30
30
|
const run = async (options) => {
|
|
31
31
|
log_1.logger.info(`Running a Gatling simulation with options:
|
|
32
|
-
-
|
|
32
|
+
- simulationName: ${options.simulationName}
|
|
33
33
|
- bundleFile: ${options.bundleFile}`);
|
|
34
34
|
const bundleFolder = path.parse(options.bundleFile).dir;
|
|
35
35
|
const bundleFileName = path.parse(options.bundleFile).base;
|
|
@@ -43,7 +43,7 @@ const run = async (options) => {
|
|
|
43
43
|
"-classpath",
|
|
44
44
|
`${bundleFolder}:${options.resourcesFolder}:${options.jvmClasspath}`,
|
|
45
45
|
`-Dgatling.js.bundle.resourcePath=${bundleFileName}`,
|
|
46
|
-
`-Dgatling.js.
|
|
46
|
+
`-Dgatling.js.simulationName=${options.simulationName}`,
|
|
47
47
|
"io.gatling.app.Gatling",
|
|
48
48
|
"--results-folder",
|
|
49
49
|
options.resultsFolder,
|