devenv: Add docker load test which authenticates with API key (#28905)

* Add loadtest which authenticates with API key
- Edit load tests to assign the orgId in the default function, as the setup function is only called once for all VUs and therefore the change is not persisted to each VU.
- Remove side effect from orgId setup function and explicitly set orgId in setup client

* sort semicolons, whitespace
This commit is contained in:
Dafydd
2020-11-24 07:34:47 +00:00
committed by GitHub
parent 763e958d9d
commit d29f73b197
8 changed files with 156 additions and 22 deletions

View File

@@ -12,15 +12,18 @@ const client = createClient(endpoint);
export const setup = () => {
const basicAuthClient = createBasicAuthClient(endpoint, 'admin', 'admin');
const orgId = createTestOrgIfNotExists(basicAuthClient);
basicAuthClient.withOrgId(orgId);
const datasourceId = createTestdataDatasourceIfNotExists(basicAuthClient);
client.withOrgId(orgId);
return {
orgId: orgId,
datasourceId: datasourceId,
orgId,
datasourceId,
};
};
export default data => {
client.withOrgId(data.orgId);
group('user auth token test', () => {
if (__ITER === 0) {
group('user authenticates through ui with username and password', () => {