Skip to content

Commit

Permalink
chore(k6): Consolidate k6-utils import URLs (#1869)
Browse files Browse the repository at this point in the history
  • Loading branch information
oskogstad authored Feb 13, 2025
1 parent 5de894f commit 09b3722
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions tests/k6/common/k6-utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { uuidv4, randomItem } from 'https://jslib.k6.io/k6-utils/1.4.0/index.js';
2 changes: 1 addition & 1 deletion tests/k6/common/uuid.js
Original file line number Diff line number Diff line change
@@ -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() {

Expand Down
2 changes: 1 addition & 1 deletion tests/k6/tests/enduser/performance/enduser-search.js
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion tests/k6/tests/graphql/performance/graphql-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion tests/k6/tests/performancetest_common/createDialog.js
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 1 addition & 1 deletion tests/k6/tests/performancetest_common/simpleSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
2 changes: 1 addition & 1 deletion tests/k6/tests/serviceowner/performance/purge-dialogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 09b3722

Please sign in to comment.