Running
import http from 'k6/http';
function checkStatus() {}
export function editVoice(tenant, environment, domain) {
var username = "pesho"
var authToken = "joro"
var stepNum = 5
var iterNum = __ITER;
// Edit Profile
var vuserID=__VU;
let response = http.get(`https://${tenant}.${environment}.${domain}/api/platform-admin/v1/users/${username}/retrieve`, {
headers: {
'Accept': '*/*',
'Cookie': 'sso="' + authToken + '"'
},
tags: { name: `${stepNum} - https://${tenant}.${environment}.${domain}/api/platform-admin/v1/users/<username>/retrieve` },
});
checkStatus(response, vuserID, iterNum, 200);
let profileId = "something";
response = http.get(`https://${tenant}.${environment}.${domain}/api/platform-admin/v1/licenses/profile/${profileId}`, {
headers: {
'Accept': '*/*',
'Cookie': 'sso="' + authToken + '"'
},
tags: { name: `${stepNum} - https://${tenant}.${environment}.${domain}/api/platform-admin/v1/licenses/profile/<profileId>` },
});
checkStatus(response, vuserID, iterNum, 200);
response = http.get(`https://${tenant}.${environment}.${domain}/api//users/${profileId}/phone-numbers`, {
headers: {
'Accept': '*/*',
'Cookie': 'sso="' + authToken + '"'
},
tags: { name: `${stepNum} - https://${tenant}.${environment}.${domain}/api//users/<profileId>/phone-numbers` },
});
response = http.get(`https://${tenant}.${environment}.${domain}/api//users/${profileId}/info`, {
headers: {
'Accept': '*/*',
'Cookie': 'sso="' + authToken + '"'
},
tags: { name: `${stepNum} - https://${tenant}.${environment}.${domain}/api//users/<profileId>/info` },
});
checkStatus(response, vuserID, iterNum, 200);
response = http.get(`https://${tenant}.${environment}.${domain}/api//licenses/features?profileId=${profileId}`, {
headers: {
'Accept': '*/*',
'Cookie': 'sso="' + authToken + '"'
},
tags: { name: `${stepNum} - https://${tenant}.${environment}.${domain}/api//licenses/features?profileId=<profileId>` },
});
checkStatus(response, vuserID, iterNum, 200);
response = http.get(`https://${tenant}.${environment}.${domain}/api//users/${profileId}/phone/primary`, {
headers: {
'Accept': '*/*',
'Cookie': 'sso="' + authToken + '"'
},
tags: { name: `${stepNum} - https://${tenant}.${environment}.${domain}/api//users/<profileId>/phone/primary` },
});
checkStatus(response, vuserID, iterNum, 200);
}
export default function () {
editVoice("test", "k6", "io");
}
Which is your script with the variables given some values:
with k6.v0.31.1 run -o json=out.json forum-1639.js
grep http_req_duration out.json | jq .data.tags.url
produces:
"https://test.k6.io/api/platform-admin/v1/users/pesho/retrieve"
"https://test.k6.io/api/platform-admin/v1/licenses/profile/something"
"https://test.k6.io/api//users/something/phone-numbers"
"https://test.k6.io/api//users/something/info"
"https://test.k6.io/api//licenses/features?profileId=something"
"https://test.k6.io/api//users/something/phone/primary"
which looks correct to me.
So I have no idea what is happening when you run it