I’ve been running this test script locally without issue, but when I try to run it in the grafana/k6 container it fails with exit code 104 and this message:
time=“2022-10-21T20:02:07Z” level=error msg=“There were problems with the specified script configuration:\n\t- executor default: function ‘default’ not found in exports”
My script does not have a default function but it runs fine locally on my macbook pro. Here’s the main script:
import http from 'k6/http';
import { check, group } from 'k6';
import { SharedArray } from 'k6/data';
import * as query from './queryLib.js';
let orgName = 'prerelease-performance-2';//`${__ENV.orgName}`
const BASE_URL = 'https://' + orgName + '.greenlight.guru'
const userData = new SharedArray('userData', function () {
return JSON.parse(open('./userData.json')).users;
});
let metrics = [];
export function setup(){
let userObject = {"users": [], "org": orgName};
userData.forEach(function(v,i,a){
let theUser = {};
theUser['email'] = v.email;
theUser['pword'] = v.pword;
theUser['userName'] = v.user;
userObject['users'].push(theUser);
});
return userObject;
}
export const options = {
scenarios: {
groupOne: {
executor: 'constant-arrival-rate',
exec: 'groupOne',
rate: 1,//5,
timeUnit: '1s',
duration: '120s',
preAllocatedVUs: 10
},
groupTwo: {
executor: 'constant-arrival-rate',
exec: 'groupTwo',
rate: 1,
duration: '120s',
preAllocatedVUs: 10
}
}
};
export function groupOne(data) {
query.groupOne(data);
}
export function groupTwo(data) {
query.groupTwo(data);
}
So I have 2 questions. Why doesn’t this run in the docker container and is there a work around?
Thanks.