From b87816a340a60b91a41114793998a32f5540a28a Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Thu, 24 Aug 2023 16:54:53 +0800 Subject: [PATCH] test: add performance test in bugserver --- packages/vchart/scripts/trigger-test.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/vchart/scripts/trigger-test.ts b/packages/vchart/scripts/trigger-test.ts index 0a220687c..ceaf49551 100644 --- a/packages/vchart/scripts/trigger-test.ts +++ b/packages/vchart/scripts/trigger-test.ts @@ -209,6 +209,28 @@ async function triggerPhotoTest({ scmVersion, scmVersionStatus }: { scmVersion: return res; } +async function triggerPerformanceTest({ + scmVersion, + scmVersionStatus +}: { + scmVersion: string; + scmVersionStatus: string; +}) { + const params = { + triggerType: 'performance-test', + scmVersion: scmVersion, + scmVersionStatus: scmVersionStatus, + commitId: process.env.GITHUB_SHA ?? '', + commitUrl: process.env.GITHUB_REF ?? '', + commitBranchName: process.env.GITHUB_HEAD_REF ?? '', + commitCreateUser: process.env.GITHUB_ACTOR ?? '', + commitDescription: '' + }; + + const res = await fetch(API_URL, 'POST', () => getFormData(params)); + return res; +} + async function getPhotoResult({ scmVersion, bundleId }: { scmVersion: string; bundleId: string }) { const params = { triggerType: 'photo-result', @@ -289,6 +311,9 @@ async function trigger() { `[trigger], test result status: ${photoTestStatus}, totalCount: ${totalCount}, successCount: ${successCount}` ); + // trigger performance test + await triggerPerformanceTest({ scmVersion, scmVersionStatus }); + if (photoTestStatus !== 'ok') { throw new Error(`photo test status: ${photoTestStatus}`); }