From f5d88c9057f95c8b389ba348300e6f8738e2f685 Mon Sep 17 00:00:00 2001 From: chenos Date: Tue, 9 Jan 2024 17:43:14 +0800 Subject: [PATCH] fix: e2e ci (#3349) * fix: e2e ci * fix: ci * fix: error * test: e2e * fix: error * fix: remove load * fix: test error --- packages/core/cli/src/commands/e2e.js | 14 ++++++++++++-- packages/core/server/src/gateway/index.ts | 2 -- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/packages/core/cli/src/commands/e2e.js b/packages/core/cli/src/commands/e2e.js index 4e54f613e..ee702a446 100644 --- a/packages/core/cli/src/commands/e2e.js +++ b/packages/core/cli/src/commands/e2e.js @@ -33,7 +33,7 @@ const checkServer = async (duration = 1000, max = 60 * 10) => { } }) .catch((error) => { - console.error('Request error:', error.message); + console.error('Request error:', error?.response?.data?.error); }); }, duration); }); @@ -128,6 +128,12 @@ const filterArgv = () => { if (element === '--skip-reporter') { continue; } + if (element === '--build') { + continue; + } + if (element === '--production') { + continue; + } argv.push(element); } return argv; @@ -150,8 +156,12 @@ module.exports = (cli) => { .option('--url [url]') .option('--skip-reporter') .option('--build') + .option('--production') .action(async (options) => { process.env.__E2E__ = true; + if (options.production) { + process.env.APP_ENV = 'production'; + } if (options.build) { process.env.APP_ENV = 'production'; await run('yarn', ['build']); @@ -225,6 +235,6 @@ module.exports = (cli) => { process.env.APP_ENV = 'production'; await run('yarn', ['build']); } - await pTest(options); + await pTest({ ...options, concurrency: 1 * options.concurrency }); }); }; diff --git a/packages/core/server/src/gateway/index.ts b/packages/core/server/src/gateway/index.ts index 2d6a5ab3f..6cd1b5540 100644 --- a/packages/core/server/src/gateway/index.ts +++ b/packages/core/server/src/gateway/index.ts @@ -325,8 +325,6 @@ export class Gateway extends EventEmitter { const mainApp = AppSupervisor.getInstance().bootMainApp(options.mainAppOptions); - await mainApp.load(); - mainApp .runAsCLI(process.argv, { throwError: true,