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}`); }