From f7dae6dfe623764c40447115c8da06f60f63e5b9 Mon Sep 17 00:00:00 2001 From: Dagfinn Olsen Date: Mon, 17 Feb 2025 13:19:08 +0100 Subject: [PATCH] Different activityActorId for yt01 --- tests/k6/common/config.js | 2 ++ .../performancetest_data/01-create-dialog.js | 26 +------------------ .../serviceowner/testdata/01-create-dialog.js | 5 ++-- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/tests/k6/common/config.js b/tests/k6/common/config.js index 102ec02c6..b2534a7ef 100644 --- a/tests/k6/common/config.js +++ b/tests/k6/common/config.js @@ -66,3 +66,5 @@ export const baseUrlGraphql = baseUrls[__ENV.API_VERSION]["graphql"][__ENV.API_E export const sentinelValue = "dialogporten-e2e-sentinel"; export const sentinelPerformanceValue = "dialogporten-e2e-sentinel-performance"; +export const activityActorId = __ENV.API_ENVIRONMENT == "yt01" ? "713431400" : "991825827"; + diff --git a/tests/k6/tests/performancetest_data/01-create-dialog.js b/tests/k6/tests/performancetest_data/01-create-dialog.js index cd467a456..a93759c3d 100644 --- a/tests/k6/tests/performancetest_data/01-create-dialog.js +++ b/tests/k6/tests/performancetest_data/01-create-dialog.js @@ -1,8 +1,6 @@ import {default as createDialogPayload} from "../serviceowner/testdata/01-create-dialog.js" import { sentinelPerformanceValue } from "../../common/config.js"; -const ACTIVITY_TYPE_INFORMATION = 'Information'; - function cleanUp(originalPayload) { if (!originalPayload || typeof originalPayload !== 'object') { throw new Error('Invalid payload'); @@ -12,29 +10,7 @@ function cleanUp(originalPayload) { ...originalPayload, searchTags: [...(originalPayload.searchTags || []), { "value": sentinelPerformanceValue }] }; - const { visibleFrom, ...payloadWithoutVisibleFrom } = payload; - - const activities = payload.activities?.map(activity => { - if (activity.type !== ACTIVITY_TYPE_INFORMATION) { - return activity; - } - - const { performedBy, ...rest } = activity; - const { actorId, ...performedByRest } = performedBy; - - return { - ...rest, - performedBy: { - ...performedByRest, - actorName: "some name" - } - }; - }) ?? []; - - return { - ...payloadWithoutVisibleFrom, - activities - }; + return payload } /** diff --git a/tests/k6/tests/serviceowner/testdata/01-create-dialog.js b/tests/k6/tests/serviceowner/testdata/01-create-dialog.js index 940ecfba6..538b0ec5a 100644 --- a/tests/k6/tests/serviceowner/testdata/01-create-dialog.js +++ b/tests/k6/tests/serviceowner/testdata/01-create-dialog.js @@ -1,6 +1,5 @@ -import { uuidv4 } from '../../../common/testimports.js' import { getDefaultEnduserSsn } from "../../../common/token.js"; -import { sentinelValue } from "../../../common/config.js"; +import { sentinelValue, activityActorId } from "../../../common/config.js"; export default function (endUser = getDefaultEnduserSsn()) { return { @@ -302,7 +301,7 @@ export default function (endUser = getDefaultEnduserSsn()) { "type": "Information", "performedBy": { "actorType": "partyRepresentative", - "actorId": "urn:altinn:organization:identifier-no:991825827" + "actorId": "urn:altinn:organization:identifier-no:" + activityActorId }, "description": [ {