-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
36 lines (28 loc) · 852 Bytes
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
export * from './scripts/index.js';
import { Config } from './objects/config.js';
import { Data } from './objects/data.js';
import exec from 'k6/x/exec';
if (__ENV.CONFIG_FILES) {
exec.command('./common/config_setup.sh', __ENV.CONFIG_FILES.split(','));
} else {
exec.command('./common/config_setup.sh');
}
const configFiles = JSON.parse(open('./load_config.json'));
let config = new Config(configFiles);
const [scenarios, thresholds, data] = config.getConfig();
export const options = {
scenarios: scenarios,
thresholds: thresholds,
};
export function setup() {
console.info('Executing setup');
let setupData = new Data(__ENV.URL, data);
return setupData.getData();
}
export default function () {
console.warn('default main function');
}
export function teardown() {
console.info('Executing teardown');
//TEARDOWN ACTIONS
}