Open ericmacfa opened 7 years ago
Project structure:
project_root | package.json | example-config.yml +---tests/ | example-test.yml +---util/ | request-utils.js
Command run: npm run artillery --config example-config.yml tests/example-test.yml
npm run artillery --config example-config.yml tests/example-test.yml
example-config.yml contains processor: './util/request-utils.js' (see end of post for attached files)
example-config.yml
processor: './util/request-utils.js'
When the command is run, an error occurs: Error: Cannot find module 'project_root/tests/util/request-utils.js'
Error: Cannot find module 'project_root/tests/util/request-utils.js'
The filepath specified by processor is interpreted as relative to the script file, instead of relative to the config file.
processor
So, unless all test files are in the same dir as the file specified by processor, the processor property is unusable in a config file
Perhaps the path can be interpreted at the time that the config file is loaded, before the config is passed to the script?
Yes I agree that's not intuitive behavior.
Any news on this? Still seem to be problems when using the --config flag.
--config
Background
Project structure:
Command run:
npm run artillery --config example-config.yml tests/example-test.yml
example-config.yml
containsprocessor: './util/request-utils.js'
(see end of post for attached files)Issue
When the command is run, an error occurs:
Error: Cannot find module 'project_root/tests/util/request-utils.js'
The filepath specified by
processor
is interpreted as relative to the script file, instead of relative to the config file.So, unless all test files are in the same dir as the file specified by
processor
, theprocessor
property is unusable in a config filePerhaps the path can be interpreted at the time that the config file is loaded, before the config is passed to the script?
Attached files