mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
feat: Migrate Test Workflows to Main Repo (#15504)
This commit is contained in:
@@ -28,6 +28,13 @@ import type {
|
||||
|
||||
const re = /\d+/;
|
||||
|
||||
interface ISkipList {
|
||||
workflowId: string;
|
||||
status: string;
|
||||
skipReason: string;
|
||||
ticketReference: string;
|
||||
}
|
||||
|
||||
export class ExecuteBatch extends BaseCommand {
|
||||
static description = '\nExecutes multiple workflows once';
|
||||
|
||||
@@ -53,7 +60,7 @@ export class ExecuteBatch extends BaseCommand {
|
||||
|
||||
static examples = [
|
||||
'$ n8n executeBatch',
|
||||
'$ n8n executeBatch --concurrency=10 --skipList=/data/skipList.txt',
|
||||
'$ n8n executeBatch --concurrency=10 --skipList=/data/skipList.json',
|
||||
'$ n8n executeBatch --debug --output=/data/output.json',
|
||||
'$ n8n executeBatch --ids=10,13,15 --shortOutput',
|
||||
'$ n8n executeBatch --snapshot=/data/snapshots --shallow',
|
||||
@@ -245,12 +252,15 @@ export class ExecuteBatch extends BaseCommand {
|
||||
if (flags.skipList !== undefined) {
|
||||
if (fs.existsSync(flags.skipList)) {
|
||||
const contents = fs.readFileSync(flags.skipList, { encoding: 'utf-8' });
|
||||
skipIds.push(
|
||||
...contents
|
||||
.trimEnd()
|
||||
.split(',')
|
||||
.filter((id) => re.exec(id)),
|
||||
);
|
||||
try {
|
||||
const parsedSkipList = JSON.parse(contents) as ISkipList[];
|
||||
parsedSkipList.forEach((item) => {
|
||||
skipIds.push(item.workflowId);
|
||||
});
|
||||
} catch (error) {
|
||||
this.logger.error('Skip list file is not a valid JSON. Exiting.');
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
this.logger.error('Skip list file not found. Exiting.');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user