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) => {
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 });
});
};

View File

@ -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,