@gatling.io/cli 3.14.500 → 3.14.600

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": "@gatling.io/cli",
3
- "version": "3.14.500",
3
+ "version": "3.14.600",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://gatling.io",
6
6
  "repository": "github:gatling/gatling-js",
@@ -36,11 +36,11 @@
36
36
  "devDependencies": {
37
37
  "@types/archiver": "6.0.3",
38
38
  "@types/make-fetch-happen": "10.0.4",
39
- "@types/node": "18.19.127",
39
+ "@types/node": "18.19.130",
40
40
  "@types/readline-sync": "1.4.8",
41
41
  "prettier": "3.6.2",
42
42
  "rimraf": "6.0.1",
43
- "typescript": "5.9.2"
43
+ "typescript": "5.9.3"
44
44
  },
45
45
  "scripts": {
46
46
  "clean": "rimraf target",
@@ -1,9 +1,12 @@
1
1
  import { SimulationFile } from "../simulations";
2
2
  export interface BundleOptions {
3
3
  sourcesFolder: string;
4
+ protoFolder: string;
4
5
  bundleFile: string;
6
+ protoTargetFolder: string;
5
7
  postman?: string;
6
8
  typescript: boolean;
7
9
  simulations: SimulationFile[];
10
+ protocPath: string;
8
11
  }
9
12
  export declare const bundle: (options: BundleOptions) => Promise<void>;
@@ -42,9 +42,11 @@ const esbuild_plugin_tsc_1 = __importDefault(require("esbuild-plugin-tsc"));
42
42
  const path_1 = require("path");
43
43
  const log_1 = require("../log");
44
44
  const polyfills_1 = require("./polyfills");
45
+ const protoc_1 = require("./protoc");
45
46
  const bundle = async (options) => {
46
47
  log_1.logger.info(`Bundling a Gatling simulation with options:
47
48
  - sourcesFolder: ${options.sourcesFolder}
49
+ - protoFolder: ${options.protoFolder}
48
50
  - bundleFile: ${options.bundleFile}
49
51
  - typescript: ${options.typescript}`);
50
52
  const contents = options.simulations.map((s) => `export { default as "${s.name}" } from "./${s.path}";`).join("\n");
@@ -66,5 +68,6 @@ const bundle = async (options) => {
66
68
  plugins,
67
69
  external: polyfills_1.polyfills
68
70
  });
71
+ await (0, protoc_1.compileProtoFiles)(options.protocPath, options.protoFolder, options.protoTargetFolder);
69
72
  };
70
73
  exports.bundle = bundle;
@@ -0,0 +1 @@
1
+ export declare const compileProtoFiles: (protocPath: string, protoFolder: string, protoTargetFolder: string) => Promise<void>;
@@ -0,0 +1,75 @@
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.compileProtoFiles = void 0;
7
+ const node_child_process_1 = require("node:child_process");
8
+ const promises_1 = __importDefault(require("node:fs/promises"));
9
+ const node_path_1 = __importDefault(require("node:path"));
10
+ const log_1 = require("../log");
11
+ const compileProtoFiles = async (protocPath, protoFolder, protoTargetFolder) => {
12
+ await promises_1.default.rm(protoTargetFolder, { recursive: true, force: true });
13
+ const protoFiles = await getFiles(protoFolder, "");
14
+ const allGeneratedFiles = [];
15
+ for (const protoFile of protoFiles) {
16
+ const sourceFile = node_path_1.default.join(protoFolder, protoFile);
17
+ const protoPath = node_path_1.default.dirname(sourceFile);
18
+ const targetFile = protoFile + "c";
19
+ const targetPath = node_path_1.default.join(protoTargetFolder, targetFile);
20
+ await promises_1.default.mkdir(node_path_1.default.dirname(targetPath), { recursive: true });
21
+ await runProtoc(protocPath, sourceFile, protoPath, targetPath);
22
+ allGeneratedFiles.push(targetFile);
23
+ }
24
+ if (protoFiles.length > 0) {
25
+ await promises_1.default.writeFile(node_path_1.default.join(protoTargetFolder, "compiled-protobuf-files"), allGeneratedFiles.join("\n"), {
26
+ encoding: "utf-8"
27
+ });
28
+ }
29
+ };
30
+ exports.compileProtoFiles = compileProtoFiles;
31
+ const getFiles = async (dir, relativePath) => {
32
+ const dirents = await listFiles(dir);
33
+ const files = await Promise.all(dirents.map((dirent) => {
34
+ const res = node_path_1.default.resolve(dir, dirent.name);
35
+ return dirent.isDirectory()
36
+ ? getFiles(res, node_path_1.default.join(relativePath, dirent.name))
37
+ : dirent.name.endsWith(".proto")
38
+ ? [node_path_1.default.join(relativePath, dirent.name)]
39
+ : [];
40
+ }));
41
+ return files.flat();
42
+ };
43
+ const listFiles = async (dir) => {
44
+ try {
45
+ return await promises_1.default.readdir(dir, { withFileTypes: true });
46
+ }
47
+ catch (e) {
48
+ if (e?.code === "ENOENT") {
49
+ // Directory does not exist: there are no proto files to compile.
50
+ return [];
51
+ }
52
+ else {
53
+ throw e;
54
+ }
55
+ }
56
+ };
57
+ const runProtoc = async (protocPath, sourceFile, protoPath, targetFile) => {
58
+ // FIXME can't build simulations without the bundle...
59
+ const args = [`--proto_path=${protoPath}`, `--descriptor_set_out=${targetFile}`, sourceFile];
60
+ const spawned = (0, node_child_process_1.spawn)(protocPath, args, {
61
+ env: process.env,
62
+ stdio: [process.stdin, process.stdout, process.stderr]
63
+ });
64
+ return new Promise((resolve, reject) => {
65
+ spawned.on("error", (error) => log_1.logger.error("Failed to run protoc process: " + error.toString()));
66
+ spawned.on("close", (code) => {
67
+ if (code === 0) {
68
+ resolve();
69
+ }
70
+ else {
71
+ reject(Error("Protoc process finished with code " + code));
72
+ }
73
+ });
74
+ });
75
+ };
@@ -3,20 +3,37 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const options_1 = require("./options");
4
4
  const simulations_1 = require("../simulations");
5
5
  const bundle_1 = require("../bundle");
6
+ const dependencies_1 = require("../dependencies");
6
7
  exports.default = (program) => {
7
8
  program
8
9
  .command("build")
9
10
  .description("Build Gatling simulations")
10
11
  .addOption(options_1.sourcesFolderOption)
12
+ .addOption(options_1.protoFolderOption)
11
13
  .addOption(options_1.bundleFileOption)
14
+ .addOption(options_1.protoTargetFolderOption)
12
15
  .addOption(options_1.postmanOption)
13
16
  .addOption(options_1.typescriptOption)
17
+ .addOption(options_1.gatlingHomeOption)
14
18
  .action(async (options) => {
15
19
  const sourcesFolder = (0, options_1.sourcesFolderOptionValue)(options);
20
+ const protoFolder = (0, options_1.protoFolderOptionValue)(options);
16
21
  const bundleFile = (0, options_1.bundleFileOptionValue)(options);
22
+ const protoTargetFolder = (0, options_1.protoTargetFolderOptionValue)(options);
23
+ const gatlingHome = (0, options_1.gatlingHomeOptionValueWithDefaults)(options);
17
24
  const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
18
25
  const postman = (0, options_1.postmanOptionValueWithDefaults)(options);
19
26
  const typescript = (0, options_1.typescriptOptionValueWithDefaults)(options, simulations);
20
- await (0, bundle_1.bundle)({ sourcesFolder, bundleFile, postman, typescript, simulations });
27
+ const { protocPath } = await (0, dependencies_1.resolveBundle)({ gatlingHome });
28
+ await (0, bundle_1.bundle)({
29
+ sourcesFolder,
30
+ protoFolder,
31
+ bundleFile,
32
+ protoTargetFolder,
33
+ postman,
34
+ typescript,
35
+ simulations,
36
+ protocPath
37
+ });
21
38
  });
22
39
  };
@@ -10,8 +10,10 @@ exports.default = (program) => {
10
10
  .command("enterprise-deploy")
11
11
  .description("Deploy a package and configured simulations")
12
12
  .addOption(options_1.sourcesFolderOption)
13
+ .addOption(options_1.protoFolderOption)
13
14
  .addOption(options_1.resourcesFolderOption)
14
15
  .addOption(options_1.bundleFileOption)
16
+ .addOption(options_1.protoTargetFolderOption)
15
17
  .addOption(options_1.resultsFolderOption)
16
18
  .addOption(options_1.postmanOption)
17
19
  .addOption(options_1.typescriptOption)
@@ -31,11 +33,13 @@ exports.default = (program) => {
31
33
  .addOption(options_1.packageFileOption)
32
34
  .action(async (options) => {
33
35
  const sourcesFolder = (0, options_1.sourcesFolderOptionValue)(options);
36
+ const protoFolder = (0, options_1.protoFolderOptionValue)(options);
34
37
  const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
35
38
  const postman = (0, options_1.postmanOptionValueWithDefaults)(options);
36
39
  const typescript = (0, options_1.typescriptOptionValueWithDefaults)(options, simulations);
37
40
  const resourcesFolder = (0, options_1.resourcesFolderOptionValue)(options);
38
41
  const bundleFile = (0, options_1.bundleFileOptionValue)(options);
42
+ const protoTargetFolder = (0, options_1.protoTargetFolderOptionValue)(options);
39
43
  const resultsFolder = (0, options_1.resultsFolderOptionValue)(options);
40
44
  const gatlingHome = (0, options_1.gatlingHomeOptionValueWithDefaults)(options);
41
45
  const apiUrl = (0, options_1.apiUrlOptionValue)(options);
@@ -47,9 +51,18 @@ exports.default = (program) => {
47
51
  const nonInteractive = (0, options_1.nonInteractiveOptionValue)(options);
48
52
  const packageDescriptorFilename = (0, options_1.packageDescriptorFilenameOptionValue)(options);
49
53
  const packageFile = (0, options_1.packageFileOptionValue)(options);
50
- const { graalvmHome, jvmClasspath } = await (0, dependencies_1.resolveBundle)({ gatlingHome });
51
- await (0, bundle_1.bundle)({ sourcesFolder, bundleFile, postman, typescript, simulations });
52
- await (0, enterprise_1.enterprisePackage)({ bundleFile, resourcesFolder, packageFile, postman, simulations });
54
+ const { graalvmHome, jvmClasspath, protocPath } = await (0, dependencies_1.resolveBundle)({ gatlingHome });
55
+ await (0, bundle_1.bundle)({
56
+ sourcesFolder,
57
+ protoFolder,
58
+ bundleFile,
59
+ protoTargetFolder,
60
+ postman,
61
+ typescript,
62
+ simulations,
63
+ protocPath
64
+ });
65
+ await (0, enterprise_1.enterprisePackage)({ bundleFile, resourcesFolder, protoTargetFolder, packageFile, postman, simulations });
53
66
  await (0, enterprise_1.enterpriseDeploy)({
54
67
  graalvmHome,
55
68
  jvmClasspath,
@@ -4,25 +4,42 @@ const options_1 = require("./options");
4
4
  const simulations_1 = require("../simulations");
5
5
  const bundle_1 = require("../bundle");
6
6
  const enterprise_1 = require("../enterprise");
7
+ const dependencies_1 = require("../dependencies");
7
8
  exports.default = (program) => {
8
9
  program
9
10
  .command("enterprise-package")
10
11
  .description("Build Gatling simulations and package them for Gatling Enterprise")
11
12
  .addOption(options_1.sourcesFolderOption)
13
+ .addOption(options_1.protoFolderOption)
12
14
  .addOption(options_1.resourcesFolderOption)
13
15
  .addOption(options_1.bundleFileOption)
16
+ .addOption(options_1.protoTargetFolderOption)
14
17
  .addOption(options_1.packageFileOption)
15
18
  .addOption(options_1.postmanOption)
16
19
  .addOption(options_1.typescriptOption)
20
+ .addOption(options_1.gatlingHomeOption)
17
21
  .action(async (options) => {
18
22
  const sourcesFolder = (0, options_1.sourcesFolderOptionValue)(options);
23
+ const protoFolder = (0, options_1.protoFolderOptionValue)(options);
19
24
  const resourcesFolder = (0, options_1.resourcesFolderOptionValue)(options);
20
25
  const bundleFile = (0, options_1.bundleFileOptionValue)(options);
26
+ const protoTargetFolder = (0, options_1.protoTargetFolderOptionValue)(options);
21
27
  const packageFile = (0, options_1.packageFileOptionValue)(options);
28
+ const gatlingHome = (0, options_1.gatlingHomeOptionValueWithDefaults)(options);
22
29
  const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
23
30
  const postman = (0, options_1.postmanOptionValueWithDefaults)(options);
24
31
  const typescript = (0, options_1.typescriptOptionValueWithDefaults)(options, simulations);
25
- await (0, bundle_1.bundle)({ sourcesFolder, bundleFile, postman, typescript, simulations });
26
- await (0, enterprise_1.enterprisePackage)({ bundleFile, resourcesFolder, packageFile, postman, simulations });
32
+ const { protocPath } = await (0, dependencies_1.resolveBundle)({ gatlingHome });
33
+ await (0, bundle_1.bundle)({
34
+ sourcesFolder,
35
+ protoFolder,
36
+ bundleFile,
37
+ protoTargetFolder,
38
+ postman,
39
+ typescript,
40
+ simulations,
41
+ protocPath
42
+ });
43
+ await (0, enterprise_1.enterprisePackage)({ bundleFile, resourcesFolder, protoTargetFolder, packageFile, postman, simulations });
27
44
  });
28
45
  };
@@ -10,8 +10,10 @@ exports.default = (program) => {
10
10
  .command("enterprise-start")
11
11
  .description("Start a simulation deployed with `enterprise-deploy`")
12
12
  .addOption(options_1.sourcesFolderOption)
13
+ .addOption(options_1.protoFolderOption)
13
14
  .addOption(options_1.resourcesFolderOption)
14
15
  .addOption(options_1.bundleFileOption)
16
+ .addOption(options_1.protoTargetFolderOption)
15
17
  .addOption(options_1.resultsFolderOption)
16
18
  .addOption(options_1.postmanOption)
17
19
  .addOption(options_1.typescriptOption)
@@ -36,11 +38,13 @@ exports.default = (program) => {
36
38
  .addOption(options_1.waitForRunEndOption)
37
39
  .action(async (options) => {
38
40
  const sourcesFolder = (0, options_1.sourcesFolderOptionValue)(options);
41
+ const protoFolder = (0, options_1.protoFolderOptionValue)(options);
39
42
  const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
40
43
  const postman = (0, options_1.postmanOptionValueWithDefaults)(options);
41
44
  const typescript = (0, options_1.typescriptOptionValueWithDefaults)(options, simulations);
42
45
  const resourcesFolder = (0, options_1.resourcesFolderOptionValue)(options);
43
46
  const bundleFile = (0, options_1.bundleFileOptionValue)(options);
47
+ const protoTargetFolder = (0, options_1.protoTargetFolderOptionValue)(options);
44
48
  const resultsFolder = (0, options_1.resultsFolderOptionValue)(options);
45
49
  const gatlingHome = (0, options_1.gatlingHomeOptionValueWithDefaults)(options);
46
50
  const apiUrl = (0, options_1.apiUrlOptionValue)(options);
@@ -59,9 +63,18 @@ exports.default = (program) => {
59
63
  if ((0, options_1.nonInteractiveOptionValue)(options) && enterpriseSimulation === undefined) {
60
64
  throw new Error(`No simulation specified when using non-interactive mode`);
61
65
  }
62
- const { graalvmHome, jvmClasspath } = await (0, dependencies_1.resolveBundle)({ gatlingHome });
63
- await (0, bundle_1.bundle)({ sourcesFolder, bundleFile, postman, typescript, simulations });
64
- await (0, enterprise_1.enterprisePackage)({ bundleFile, resourcesFolder, packageFile, postman, simulations });
66
+ const { graalvmHome, jvmClasspath, protocPath } = await (0, dependencies_1.resolveBundle)({ gatlingHome });
67
+ await (0, bundle_1.bundle)({
68
+ sourcesFolder,
69
+ protoFolder,
70
+ bundleFile,
71
+ protoTargetFolder,
72
+ postman,
73
+ typescript,
74
+ simulations,
75
+ protocPath
76
+ });
77
+ await (0, enterprise_1.enterprisePackage)({ bundleFile, resourcesFolder, protoTargetFolder, packageFile, postman, simulations });
65
78
  await (0, enterprise_1.enterpriseStart)({
66
79
  graalvmHome,
67
80
  jvmClasspath,
@@ -4,6 +4,10 @@ export declare const gatlingHomeOption: Option;
4
4
  export declare const gatlingHomeOptionValueWithDefaults: (options: any) => string;
5
5
  export declare const sourcesFolderOption: Option;
6
6
  export declare const sourcesFolderOptionValue: (options: any) => string;
7
+ export declare const protoFolderOption: Option;
8
+ export declare const protoFolderOptionValue: (options: any) => string;
9
+ export declare const protoTargetFolderOption: Option;
10
+ export declare const protoTargetFolderOptionValue: (options: any) => string;
7
11
  export declare const simulationOption: Option;
8
12
  export declare const simulationOptionValueWithDefaults: (options: any, simulationsFound: SimulationFile[], interactive: boolean) => string;
9
13
  export declare const simulationMandatoryOption: Option;
@@ -3,8 +3,8 @@ 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.runDescriptionOption = exports.runTitleOptionValue = exports.runTitleOption = exports.enterpriseSimulationOptionValue = exports.enterpriseSimulationOption = exports.packageDescriptorFilenameOptionValue = exports.packageDescriptorFilenameOption = exports.trustStorePasswordOptionValue = exports.trustStorePasswordOption = exports.trustStoreOptionValue = exports.trustStoreOption = exports.controlPlaneUrlOptionValue = exports.controlPlaneUrlOption = exports.apiTokenOptionValue = exports.apiTokenOption = exports.webAppUrlOptionValue = exports.webAppUrlOption = exports.apiUrlOptionValue = exports.apiUrlOption = exports.bundleFileArgument = exports.parseRunParametersArgument = exports.runParametersArgument = exports.postmanOptionValueWithDefaults = exports.postmanOption = 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
- exports.waitForRunEndOptionValue = exports.waitForRunEndOption = exports.runDescriptionOptionValue = void 0;
6
+ exports.enterpriseSimulationOption = exports.packageDescriptorFilenameOptionValue = exports.packageDescriptorFilenameOption = exports.trustStorePasswordOptionValue = exports.trustStorePasswordOption = exports.trustStoreOptionValue = exports.trustStoreOption = exports.controlPlaneUrlOptionValue = exports.controlPlaneUrlOption = exports.apiTokenOptionValue = exports.apiTokenOption = exports.webAppUrlOptionValue = exports.webAppUrlOption = exports.apiUrlOptionValue = exports.apiUrlOption = exports.bundleFileArgument = exports.parseRunParametersArgument = exports.runParametersArgument = exports.postmanOptionValueWithDefaults = exports.postmanOption = 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.protoTargetFolderOptionValue = exports.protoTargetFolderOption = exports.protoFolderOptionValue = exports.protoFolderOption = exports.sourcesFolderOptionValue = exports.sourcesFolderOption = exports.gatlingHomeOptionValueWithDefaults = exports.gatlingHomeOption = void 0;
7
+ exports.waitForRunEndOptionValue = exports.waitForRunEndOption = exports.runDescriptionOptionValue = exports.runDescriptionOption = exports.runTitleOptionValue = exports.runTitleOption = exports.enterpriseSimulationOptionValue = void 0;
8
8
  const commander_1 = require("commander");
9
9
  const fs_1 = __importDefault(require("fs"));
10
10
  const os_1 = __importDefault(require("os"));
@@ -61,6 +61,10 @@ const gatlingHomeOptionValueWithDefaults = (options) => getStringValueOptional(e
61
61
  exports.gatlingHomeOptionValueWithDefaults = gatlingHomeOptionValueWithDefaults;
62
62
  exports.sourcesFolderOption = new commander_1.Option("--sources-folder <value>", "The sources folder path").default("src");
63
63
  exports.sourcesFolderOptionValue = getStringValueMandatory(exports.sourcesFolderOption);
64
+ exports.protoFolderOption = new commander_1.Option("--protobuf-folder <value>", "The path of the protobuf definition files folder").default("protobuf");
65
+ exports.protoFolderOptionValue = getStringValueMandatory(exports.protoFolderOption);
66
+ exports.protoTargetFolderOption = new commander_1.Option("--protobuf-target-folder <value>", "The path of the protobuf compilation target folder").default("target/protobuf");
67
+ exports.protoTargetFolderOptionValue = getStringValueMandatory(exports.protoTargetFolderOption);
64
68
  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)");
65
69
  const simulationOptionValueWithDefaults = (options, simulationsFound, interactive) => {
66
70
  const declaredSimulation = getStringValueOptional(exports.simulationOption)(options);
@@ -11,9 +11,11 @@ exports.default = (program) => {
11
11
  .command("run")
12
12
  .description("Build and run a Gatling simulation, after installing all required components and dependencies for Gatling")
13
13
  .addOption(options_1.sourcesFolderOption)
14
+ .addOption(options_1.protoFolderOption)
14
15
  .addOption(options_1.simulationOption)
15
16
  .addOption(options_1.typescriptOption)
16
17
  .addOption(options_1.bundleFileOption)
18
+ .addOption(options_1.protoTargetFolderOption)
17
19
  .addOption(options_1.resourcesFolderOption)
18
20
  .addOption(options_1.resultsFolderOption)
19
21
  .addOption(options_1.gatlingHomeOption)
@@ -24,7 +26,9 @@ exports.default = (program) => {
24
26
  .action(async (args, options) => {
25
27
  const gatlingHome = (0, options_1.gatlingHomeOptionValueWithDefaults)(options);
26
28
  const sourcesFolder = (0, options_1.sourcesFolderOptionValue)(options);
29
+ const protoFolder = (0, options_1.protoFolderOptionValue)(options);
27
30
  const bundleFile = (0, options_1.bundleFileOptionValue)(options);
31
+ const protoTargetFolder = (0, options_1.protoTargetFolderOptionValue)(options);
28
32
  const resourcesFolder = (0, options_1.resourcesFolderOptionValue)(options);
29
33
  const resultsFolder = (0, options_1.resultsFolderOptionValue)(options);
30
34
  const memory = (0, options_1.memoryOptionValue)(options);
@@ -34,16 +38,26 @@ exports.default = (program) => {
34
38
  const simulations = await (0, simulations_1.findSimulations)(sourcesFolder);
35
39
  const typescript = (0, options_1.typescriptOptionValueWithDefaults)(options, simulations);
36
40
  const simulation = (0, options_1.simulationOptionValueWithDefaults)(options, simulations, !nonInteractive);
37
- const { graalvmHome, jvmClasspath } = await (0, dependencies_1.resolveBundle)({ gatlingHome });
41
+ const { graalvmHome, jvmClasspath, protocPath } = await (0, dependencies_1.resolveBundle)({ gatlingHome });
38
42
  log_1.logger.debug(`graalvmHome=${graalvmHome}`);
39
43
  log_1.logger.debug(`jvmClasspath=${jvmClasspath}`);
40
- await (0, bundle_1.bundle)({ sourcesFolder, bundleFile, postman, typescript, simulations });
44
+ await (0, bundle_1.bundle)({
45
+ sourcesFolder,
46
+ protoFolder,
47
+ bundleFile,
48
+ protoTargetFolder,
49
+ postman,
50
+ typescript,
51
+ simulations,
52
+ protocPath
53
+ });
41
54
  await (0, run_1.runSimulation)({
42
55
  graalvmHome,
43
56
  jvmClasspath,
44
57
  simulation,
45
58
  bundleFile,
46
59
  resourcesFolder,
60
+ protoTargetFolder,
47
61
  resultsFolder,
48
62
  memory,
49
63
  runParameters
@@ -10,6 +10,7 @@ exports.default = (program) => {
10
10
  .addOption(options_1.jvmClasspathMandatoryOption)
11
11
  .addOption(options_1.simulationMandatoryOption)
12
12
  .addOption(options_1.bundleFileOption)
13
+ .addOption(options_1.protoTargetFolderOption)
13
14
  .addOption(options_1.resourcesFolderOption)
14
15
  .addOption(options_1.resultsFolderOption)
15
16
  .addOption(options_1.memoryOption)
@@ -19,6 +20,7 @@ exports.default = (program) => {
19
20
  const jvmClasspath = (0, options_1.jvmClasspathMandatoryOptionValue)(options);
20
21
  const simulation = (0, options_1.simulationMandatoryOptionValue)(options);
21
22
  const bundleFile = (0, options_1.bundleFileOptionValue)(options);
23
+ const protoTargetFolder = (0, options_1.protoTargetFolderOptionValue)(options);
22
24
  const resourcesFolder = (0, options_1.resourcesFolderOptionValue)(options);
23
25
  const resultsFolder = (0, options_1.resultsFolderOptionValue)(options);
24
26
  const memory = (0, options_1.memoryOptionValue)(options);
@@ -29,6 +31,7 @@ exports.default = (program) => {
29
31
  simulation: simulation,
30
32
  bundleFile,
31
33
  resourcesFolder,
34
+ protoTargetFolder,
32
35
  resultsFolder,
33
36
  memory,
34
37
  runParameters
@@ -8,6 +8,7 @@ export interface BundleInstallOptions extends BundleOptions {
8
8
  export interface ResolvedBundle {
9
9
  graalvmHome: string;
10
10
  jvmClasspath: string;
11
+ protocPath: string;
11
12
  }
12
13
  export declare const installBundleFile: (options: BundleInstallOptions) => Promise<ResolvedBundle>;
13
14
  export declare const resolveBundle: (options: BundleOptions) => Promise<ResolvedBundle>;
@@ -65,10 +65,16 @@ const installBundleFile = async (options) => {
65
65
  await promises_1.default.mkdir(bundlePath, { recursive: true });
66
66
  await zip.extract(null, bundlePath);
67
67
  if (os_1.osType !== "Windows_NT") {
68
+ // FIXME permissions should be preserved from the zip file
68
69
  const graalVmBinDir = node_path_1.default.join(bundlePath, "graalvm", "bin");
69
- const binFiles = await promises_1.default.readdir(graalVmBinDir);
70
+ const graalvmBinFiles = await promises_1.default.readdir(graalVmBinDir);
71
+ for (const graalvmBinFile of graalvmBinFiles) {
72
+ await promises_1.default.chmod(node_path_1.default.join(graalVmBinDir, graalvmBinFile), 0o744); // chmod +x
73
+ }
74
+ const binDir = node_path_1.default.join(bundlePath, "bin");
75
+ const binFiles = await promises_1.default.readdir(binDir);
70
76
  for (const binFile of binFiles) {
71
- await promises_1.default.chmod(node_path_1.default.join(graalVmBinDir, binFile), 0o744); // chmod +x
77
+ await promises_1.default.chmod(node_path_1.default.join(binDir, binFile), 0o744); // chmod +x
72
78
  }
73
79
  }
74
80
  log_1.logger.info(`Gatling JS dependencies bundle installed in ${bundlePath}`);
@@ -115,7 +121,8 @@ const canReadPath = async (path) => {
115
121
  };
116
122
  const getResolvedBundle = (bundlePath) => ({
117
123
  graalvmHome: node_path_1.default.join(bundlePath, "graalvm"),
118
- jvmClasspath: node_path_1.default.join(bundlePath, "lib", "java", "*")
124
+ jvmClasspath: node_path_1.default.join(bundlePath, "lib", "java", "*"),
125
+ protocPath: node_path_1.default.join(bundlePath, "bin", "protoc.exe")
119
126
  });
120
127
  const downloadAndInstallBundle = async (options) => {
121
128
  const tmpFolder = node_path_1.default.join(options.gatlingHome, "tmp");
@@ -10,6 +10,10 @@ export declare const versions: {
10
10
  core: string;
11
11
  enterprisePluginCommons: string;
12
12
  jsAdapter: string;
13
+ grpc: string;
13
14
  mqtt: string;
14
15
  };
16
+ protobuf: {
17
+ protoc: string;
18
+ };
15
19
  };
@@ -10,9 +10,13 @@ exports.versions = {
10
10
  compilerRelease: "21"
11
11
  },
12
12
  gatling: {
13
- core: "3.14.5",
14
- enterprisePluginCommons: "1.20.2",
15
- jsAdapter: "3.14.500",
16
- mqtt: "3.14.5"
13
+ core: "3.14.6",
14
+ enterprisePluginCommons: "1.20.4",
15
+ jsAdapter: "3.14.600",
16
+ grpc: "3.14.6",
17
+ mqtt: "3.14.6"
18
+ },
19
+ protobuf: {
20
+ protoc: "4.32.1"
17
21
  }
18
22
  };
@@ -3,6 +3,7 @@ import { SimulationFile } from "./simulations";
3
3
  export interface EnterprisePackageOptions {
4
4
  bundleFile: string;
5
5
  resourcesFolder: string;
6
+ protoTargetFolder: string;
6
7
  packageFile: string;
7
8
  postman: string | undefined;
8
9
  simulations: SimulationFile[];
@@ -29,6 +29,7 @@ const enterprisePackage = async (options) => {
29
29
  archive.file(options.bundleFile, { name: "bundle.js" });
30
30
  archive.append(Buffer.from(manifest), { name: "META-INF/MANIFEST.MF" });
31
31
  archive.directory(options.resourcesFolder + "/", false);
32
+ archive.directory(options.protoTargetFolder + "/", false);
32
33
  archive.finalize();
33
34
  await (0, promises_1.pipeline)(archive, output);
34
35
  log_1.logger.info(`Package for Gatling Enterprise created at ${options.packageFile}`);
package/target/run.d.ts CHANGED
@@ -3,6 +3,7 @@ export interface RunSimulationOptions extends RunJavaProcessOptions {
3
3
  simulation: string;
4
4
  bundleFile: string;
5
5
  resourcesFolder: string;
6
+ protoTargetFolder: string;
6
7
  resultsFolder: string;
7
8
  memory?: number;
8
9
  runParameters: Record<string, string>;
package/target/run.js CHANGED
@@ -10,7 +10,7 @@ const runSimulation = async (options) => {
10
10
  - bundleFile: ${options.bundleFile}
11
11
  - resourcesFolder: ${options.resourcesFolder}
12
12
  - resultsFolder: ${options.resultsFolder}`);
13
- const additionalClasspathElements = [options.resourcesFolder];
13
+ const additionalClasspathElements = [options.resourcesFolder, options.protoTargetFolder];
14
14
  const jitTuningArgs = ["-XX:JVMCINativeLibraryThreadFraction=0.8", "-Djdk.graal.MethodInlineBailoutLimit=500"];
15
15
  const memoryArgs = options.memory !== undefined ? [`-Xms${options.memory}M`, `-Xmx${options.memory}M`] : [];
16
16
  const javaArgs = [