From f27e7d0fe2d17661617e9f7db68fd87fd4ed90b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Skogstad?= Date: Wed, 12 Feb 2025 19:18:00 +0100 Subject: [PATCH 1/2] url --- tests/k6/common/uuid.js | 2 +- tests/k6/tests/enduser/performance/enduser-search.js | 2 +- tests/k6/tests/graphql/performance/graphql-search.js | 2 +- tests/k6/tests/performancetest_common/createDialog.js | 2 +- tests/k6/tests/performancetest_common/simpleSearch.js | 2 +- .../k6/tests/scenarios/performance/create-dialog-and-search.js | 2 +- .../k6/tests/serviceowner/performance/createDialogBreakpoint.js | 2 +- .../serviceowner/performance/createTransmissionsBreakpoint.js | 2 +- tests/k6/tests/serviceowner/performance/purge-dialogs.js | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/k6/common/uuid.js b/tests/k6/common/uuid.js index 00a4c4771..590443fea 100644 --- a/tests/k6/common/uuid.js +++ b/tests/k6/common/uuid.js @@ -1,4 +1,4 @@ -export { uuidv4 } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js'; +export { uuidv4 } from './k6-utils.js'; export function uuidv7() { diff --git a/tests/k6/tests/enduser/performance/enduser-search.js b/tests/k6/tests/enduser/performance/enduser-search.js index a488791d0..f1f4cdace 100644 --- a/tests/k6/tests/enduser/performance/enduser-search.js +++ b/tests/k6/tests/enduser/performance/enduser-search.js @@ -1,6 +1,6 @@ import { enduserSearch, emptySearchThresholds } from '../../performancetest_common/simpleSearch.js' import { getEndUserTokens } from '../../../common/token.js'; -import { randomItem } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js'; +import { randomItem } from '../../../common/k6-utils.js'; const defaultNumberOfEndUsers = 2799; // Max number of endusers from altinn-testtools now. diff --git a/tests/k6/tests/graphql/performance/graphql-search.js b/tests/k6/tests/graphql/performance/graphql-search.js index f58761323..0b94b6e47 100644 --- a/tests/k6/tests/graphql/performance/graphql-search.js +++ b/tests/k6/tests/graphql/performance/graphql-search.js @@ -2,7 +2,7 @@ * The performance test for GraphQL search. * Run: k6 run tests/k6/tests/graphql/performance/graphql-search.js --vus 1 --iterations 1 -e env=yt01 */ -import { randomItem } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js'; +import { randomItem } from '../../../common/k6-utils.js'; import { graphqlSearch } from "../../performancetest_common/simpleSearch.js"; import { getEndUserTokens } from '../../../common/token.js'; diff --git a/tests/k6/tests/performancetest_common/createDialog.js b/tests/k6/tests/performancetest_common/createDialog.js index 08e9d32e1..306ff32cf 100644 --- a/tests/k6/tests/performancetest_common/createDialog.js +++ b/tests/k6/tests/performancetest_common/createDialog.js @@ -1,7 +1,7 @@ /** * Common functions for creating dialogs. */ -import { uuidv4 } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js'; +import { uuidv4 } from '../../common/k6-utils.js'; import { describe } from "../../common/describe.js"; import { postSO, purgeSO } from "../../common/request.js"; import { expect } from "../../common/testimports.js"; diff --git a/tests/k6/tests/performancetest_common/simpleSearch.js b/tests/k6/tests/performancetest_common/simpleSearch.js index 1b8cc71ac..a42dfa785 100644 --- a/tests/k6/tests/performancetest_common/simpleSearch.js +++ b/tests/k6/tests/performancetest_common/simpleSearch.js @@ -2,7 +2,7 @@ * This file contains common functions for performing simple searches * and GraphQL searches. */ -import { randomItem, uuidv4 } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js'; +import { randomItem, uuidv4 } from '../../common/k6-utils.js'; import { expect, expectStatusFor } from "../../common/testimports.js"; import { describe } from '../../common/describe.js'; import { getEU, postGQ, getSO } from '../../common/request.js'; diff --git a/tests/k6/tests/scenarios/performance/create-dialog-and-search.js b/tests/k6/tests/scenarios/performance/create-dialog-and-search.js index ab1b32950..33189b859 100644 --- a/tests/k6/tests/scenarios/performance/create-dialog-and-search.js +++ b/tests/k6/tests/scenarios/performance/create-dialog-and-search.js @@ -2,7 +2,7 @@ * Performance test for creating dialogs and searching dialogs. * Run: k6 run tests/k6/tests/scenarios/performance/create-dialog-and-search.js -e env=yt01 -e svus=1 -e evus=1 -e duration=1m */ -import { randomItem } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js'; +import { randomItem } from '../../../common/k6-utils.js'; import { enduserSearch } from '../../performancetest_common/simpleSearch.js'; import { createDialog } from '../../performancetest_common/createDialog.js'; import { serviceOwners, endUsersWithTokens } from '../../performancetest_common/readTestdata.js'; diff --git a/tests/k6/tests/serviceowner/performance/createDialogBreakpoint.js b/tests/k6/tests/serviceowner/performance/createDialogBreakpoint.js index cad6af59c..2171ed363 100644 --- a/tests/k6/tests/serviceowner/performance/createDialogBreakpoint.js +++ b/tests/k6/tests/serviceowner/performance/createDialogBreakpoint.js @@ -1,6 +1,6 @@ import { createDialog } from '../../performancetest_common/createDialog.js' import { endUsers, serviceOwners } from '../../performancetest_common/readTestdata.js'; -import { randomItem } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js'; +import { randomItem } from '../../../common/k6-utils.js'; const traceCalls = (__ENV.traceCalls ?? 'false') === 'true'; const stages_duration = (__ENV.stages_duration ?? '1m'); diff --git a/tests/k6/tests/serviceowner/performance/createTransmissionsBreakpoint.js b/tests/k6/tests/serviceowner/performance/createTransmissionsBreakpoint.js index 678e14550..015179f77 100644 --- a/tests/k6/tests/serviceowner/performance/createTransmissionsBreakpoint.js +++ b/tests/k6/tests/serviceowner/performance/createTransmissionsBreakpoint.js @@ -1,6 +1,6 @@ import { createTransmissions } from '../../performancetest_common/createDialog.js'; import { serviceOwners, endUsersPart, validateTestData } from '../../performancetest_common/readTestdata.js'; -import { randomItem } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js'; +import { randomItem } from '../../../common/k6-utils.js'; const traceCalls = (__ENV.traceCalls ?? 'false') === 'true'; const numberOfTransmissions = (__ENV.numberOfTransmissions ?? '10'); diff --git a/tests/k6/tests/serviceowner/performance/purge-dialogs.js b/tests/k6/tests/serviceowner/performance/purge-dialogs.js index c43237c61..6deac8d5a 100644 --- a/tests/k6/tests/serviceowner/performance/purge-dialogs.js +++ b/tests/k6/tests/serviceowner/performance/purge-dialogs.js @@ -7,7 +7,7 @@ * * Run: k6 run tests/k6/tests/serviceowner/performance/purge-dialogs.js -e env=yt01 */ -import { uuidv4 } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js'; +import { uuidv4 } from '../../../common/k6-utils.js'; import { getSO, purgeSO } from '../../../common/request.js'; import { serviceOwners } from '../../performancetest_common/readTestdata.js'; import { expect, expectStatusFor } from "../../../common/testimports.js"; From e16dd678cf33ce1eae14d1ceeee73cf31fdef01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20J=C3=B8rgen=20Skogstad?= Date: Wed, 12 Feb 2025 19:19:57 +0100 Subject: [PATCH 2/2] accidentaly a file --- tests/k6/common/k6-utils.js | 1 + 1 file changed, 1 insertion(+) create mode 100644 tests/k6/common/k6-utils.js diff --git a/tests/k6/common/k6-utils.js b/tests/k6/common/k6-utils.js new file mode 100644 index 000000000..1afe31054 --- /dev/null +++ b/tests/k6/common/k6-utils.js @@ -0,0 +1 @@ +export { uuidv4, randomItem } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js';