Skip to content

Commit

Permalink
test: add performance test in bugserver
Browse files Browse the repository at this point in the history
  • Loading branch information
Rui-Sun authored and kkxxkk2019 committed Aug 25, 2023
1 parent f77d9b4 commit b87816a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/vchart/scripts/trigger-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TriggerPhotoTestData>(API_URL, 'POST', () => getFormData(params));
return res;
}

async function getPhotoResult({ scmVersion, bundleId }: { scmVersion: string; bundleId: string }) {
const params = {
triggerType: 'photo-result',
Expand Down Expand Up @@ -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}`);
}
Expand Down

0 comments on commit b87816a

Please sign in to comment.