I am trying to use config files to specify scenarios. I have one for each type of test (smoke, load, etc.). Config files seem to work fine with normal default scenarios but when I introduce custom scenarios it never pulls in the config correctly.
Also, precedence seems to be reversed. If I specify rps
in options and the config file, it takes the options rps
.
command line:
k6 run main.js --config config/load-test.json
config/load-test.json:
{
"rps": 3,
"thresholds": {
"checks": ["rate>1"],
"'http_req_duration{type:upload}'": ["p(95)<15000"],
"'http_req_duration{type:download}'": ["p(95)<3000"],
"'http_req_duration{type:normal}'": ["p(95)<250"]
},
"senerios": {
"main": {
"executor": "ramping-vus",
"exec": "main",
"stages": [
{ "duration": "1m", "target": 5 },
{ "duration": "1m", "target": 5 },
{ "duration": "1m", "target": 0 }
]
},
"retrieve": {
"executor": "ramping-vus",
"exec": "retrieve",
"stages": [
{ "duration": "1m", "target": 5 },
{ "duration": "1m", "target": 5 },
{ "duration": "1m", "target": 0 }
]
},
"download": {
"executor": "ramping-vus",
"exec": "download",
"stages": [
{ "duration": "1m", "target": 5 },
{ "duration": "1m", "target": 5 },
{ "duration": "1m", "target": 0 }
]
},
"search": {
"executor": "ramping-vus",
"exec": "search",
"stages": [
{ "duration": "1m", "target": 5 },
{ "duration": "1m", "target": 5 },
{ "duration": "1m", "target": 0 }
]
}
}
}
error:
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io
ERRO[0000] There were problems with the specified script configuration:
- executor default: function 'default' not found in exports