org id fix for load test

This commit is contained in:
Marcus Efraimsson
2019-01-24 23:49:45 +01:00
parent 6454de74e4
commit cfd8bd711b
4 changed files with 37 additions and 24 deletions
+6 -1
View File
@@ -1,13 +1,18 @@
export const createTestOrgIfNotExists = (client) => {
let orgId = 0;
let res = client.orgs.getByName('k6');
if (res.status === 404) {
res = client.orgs.create('k6');
if (res.status !== 200) {
throw new Error('Expected 200 response status when creating org');
}
orgId = res.json().orgId;
} else {
orgId = res.json().id;
}
client.withOrgId(res.json().orgId);
client.withOrgId(orgId);
return orgId;
}
export const createTestdataDatasourceIfNotExists = (client) => {