Skip to content

Commit d42fb8f

Browse files
authored
fix: resolve config.processor relative to the config file (#3657)
1 parent ad7b2b8 commit d42fb8f

File tree

1 file changed

+3
-8
lines changed
  • packages/artillery/lib/platform/aws-ecs/legacy

1 file changed

+3
-8
lines changed

packages/artillery/lib/platform/aws-ecs/legacy/bom.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,25 +236,20 @@ function getCustomEngines(context, next) {
236236

237237
function getCustomJsDependencies(context, next) {
238238
if (context.opts.scriptData.config?.processor) {
239-
// When using a separate config file, resolve paths relative to the scenario file
240-
// Otherwise, resolve relative to the config file
241-
const baseDir = context.opts.scenarioPath
242-
? path.dirname(context.opts.scenarioPath)
243-
: path.dirname(context.opts.absoluteScriptPath);
244-
245239
//
246240
// Path to the main processor file:
247241
//
242+
248243
const procPath = path.resolve(
249-
baseDir,
244+
path.dirname(context.opts.absoluteScriptPath),
250245
context.opts.scriptData.config.processor
251246
);
252247
context.localFilePaths.push(procPath);
253248

254249
// Get the tree of requires from the main processor file:
255250
const tree = depTree.toList({
256251
filename: procPath,
257-
directory: baseDir,
252+
directory: path.dirname(context.opts.absoluteScriptPath),
258253
filter: (path) => path.indexOf('node_modules') === -1 // optional
259254
});
260255

0 commit comments

Comments
 (0)