@artilleryio/int-core 2.6.0-fedb959 → 2.7.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/lib/runner.js +10 -1
- package/package.json +2 -2
package/lib/runner.js
CHANGED
|
@@ -337,7 +337,11 @@ function runScenario(script, metrics, runState, contextVars, options) {
|
|
|
337
337
|
if (options.scenarioName) {
|
|
338
338
|
let foundIndex;
|
|
339
339
|
const foundScenario = script.scenarios.filter((scenario, index) => {
|
|
340
|
-
const
|
|
340
|
+
const hasScenarioByRegex = new RegExp(options.scenarioName).test(
|
|
341
|
+
scenario.name
|
|
342
|
+
);
|
|
343
|
+
const hasScenarioByName = scenario.name === options.scenarioName;
|
|
344
|
+
const hasScenario = hasScenarioByName || hasScenarioByRegex;
|
|
341
345
|
|
|
342
346
|
if (hasScenario) {
|
|
343
347
|
foundIndex = index;
|
|
@@ -461,6 +465,10 @@ function createContext(script, contextVars, additionalProperties = {}) {
|
|
|
461
465
|
...additionalPropertiesWithoutOverride
|
|
462
466
|
};
|
|
463
467
|
|
|
468
|
+
if (script._configPath) {
|
|
469
|
+
INITIAL_CONTEXT.vars.$dirname = path.dirname(script._configPath);
|
|
470
|
+
}
|
|
471
|
+
|
|
464
472
|
let result = INITIAL_CONTEXT;
|
|
465
473
|
|
|
466
474
|
// variables from payloads:
|
|
@@ -472,6 +480,7 @@ function createContext(script, contextVars, additionalProperties = {}) {
|
|
|
472
480
|
|
|
473
481
|
result._uid = uuidv4();
|
|
474
482
|
result.vars.$uuid = result._uid;
|
|
483
|
+
|
|
475
484
|
return result;
|
|
476
485
|
}
|
|
477
486
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artilleryio/int-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@artilleryio/int-commons": "2.
|
|
7
|
+
"@artilleryio/int-commons": "2.3.0",
|
|
8
8
|
"@artilleryio/sketches-js": "^2.1.1",
|
|
9
9
|
"agentkeepalive": "^4.1.0",
|
|
10
10
|
"arrivals": "^2.1.2",
|