fix: e2e ci (#3349)

* fix: e2e ci

* fix: ci

* fix: error

* test: e2e

* fix: error

* fix: remove load

* fix: test error
This commit is contained in:
chenos 2024-01-09 17:43:14 +08:00 committed by GitHub
parent 6d68515275
commit f5d88c9057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -33,7 +33,7 @@ const checkServer = async (duration = 1000, max = 60 * 10) => {
} }
}) })
.catch((error) => { .catch((error) => {
console.error('Request error:', error.message); console.error('Request error:', error?.response?.data?.error);
}); });
}, duration); }, duration);
}); });
@ -128,6 +128,12 @@ const filterArgv = () => {
if (element === '--skip-reporter') { if (element === '--skip-reporter') {
continue; continue;
} }
if (element === '--build') {
continue;
}
if (element === '--production') {
continue;
}
argv.push(element); argv.push(element);
} }
return argv; return argv;
@ -150,8 +156,12 @@ module.exports = (cli) => {
.option('--url [url]') .option('--url [url]')
.option('--skip-reporter') .option('--skip-reporter')
.option('--build') .option('--build')
.option('--production')
.action(async (options) => { .action(async (options) => {
process.env.__E2E__ = true; process.env.__E2E__ = true;
if (options.production) {
process.env.APP_ENV = 'production';
}
if (options.build) { if (options.build) {
process.env.APP_ENV = 'production'; process.env.APP_ENV = 'production';
await run('yarn', ['build']); await run('yarn', ['build']);
@ -225,6 +235,6 @@ module.exports = (cli) => {
process.env.APP_ENV = 'production'; process.env.APP_ENV = 'production';
await run('yarn', ['build']); await run('yarn', ['build']);
} }
await pTest(options); await pTest({ ...options, concurrency: 1 * options.concurrency });
}); });
}; };

View File

@ -325,8 +325,6 @@ export class Gateway extends EventEmitter {
const mainApp = AppSupervisor.getInstance().bootMainApp(options.mainAppOptions); const mainApp = AppSupervisor.getInstance().bootMainApp(options.mainAppOptions);
await mainApp.load();
mainApp mainApp
.runAsCLI(process.argv, { .runAsCLI(process.argv, {
throwError: true, throwError: true,