Skip to content

Commit

Permalink
refactor(core): Bring active executions into executions controller (n…
Browse files Browse the repository at this point in the history
…o-changelog) (n8n-io#8371)
  • Loading branch information
ivov authored Jan 23, 2024
1 parent 913c8c6 commit 49b52c4
Show file tree
Hide file tree
Showing 22 changed files with 544 additions and 331 deletions.
8 changes: 4 additions & 4 deletions cypress/e2e/20-workflow-executions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ describe('Current Workflow Executions', () => {
it('should render executions tab correctly', () => {
createMockExecutions();
cy.intercept('GET', '/rest/executions?filter=*').as('getExecutions');
cy.intercept('GET', '/rest/executions-current?filter=*').as('getCurrentExecutions');
cy.intercept('GET', '/rest/executions/active?filter=*').as('getActiveExecutions');

executionsTab.actions.switchToExecutionsTab();

cy.wait(['@getExecutions', '@getCurrentExecutions']);
cy.wait(['@getExecutions', '@getActiveExecutions']);

executionsTab.getters.executionListItems().should('have.length', 11);
executionsTab.getters.successfulExecutionListItems().should('have.length', 9);
Expand All @@ -34,7 +34,7 @@ describe('Current Workflow Executions', () => {

it('should not redirect back to execution tab when request is not done before leaving the page', () => {
cy.intercept('GET', '/rest/executions?filter=*');
cy.intercept('GET', '/rest/executions-current?filter=*');
cy.intercept('GET', '/rest/executions/active?filter=*');

executionsTab.actions.switchToExecutionsTab();
executionsTab.actions.switchToEditorTab();
Expand Down Expand Up @@ -63,7 +63,7 @@ describe('Current Workflow Executions', () => {
};

cy.intercept('GET', '/rest/executions?filter=*', throttleResponse);
cy.intercept('GET', '/rest/executions-current?filter=*', throttleResponse);
cy.intercept('GET', '/rest/executions/active?filter=*', throttleResponse);

executionsTab.actions.switchToExecutionsTab();
executionsTab.actions.switchToEditorTab();
Expand Down
12 changes: 6 additions & 6 deletions cypress/e2e/28-debug.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('Debug', () => {
it('should be able to debug executions', () => {
cy.intercept('GET', '/rest/executions?filter=*').as('getExecutions');
cy.intercept('GET', '/rest/executions/*').as('getExecution');
cy.intercept('GET', '/rest/executions-current?filter=*').as('getCurrentExecutions');
cy.intercept('GET', '/rest/executions/active?filter=*').as('getActiveExecutions');
cy.intercept('POST', '/rest/workflows/run').as('postWorkflowRun');

cy.signin({ email: INSTANCE_OWNER.email, password: INSTANCE_OWNER.password });
Expand All @@ -41,7 +41,7 @@ describe('Debug', () => {

executionsTab.actions.switchToExecutionsTab();

cy.wait(['@getExecutions', '@getCurrentExecutions']);
cy.wait(['@getExecutions', '@getActiveExecutions']);

executionsTab.getters.executionDebugButton().should('have.text', 'Debug in editor').click();
cy.url().should('include', '/debug');
Expand All @@ -66,7 +66,7 @@ describe('Debug', () => {

executionsTab.actions.switchToExecutionsTab();

cy.wait(['@getExecutions', '@getCurrentExecutions']);
cy.wait(['@getExecutions', '@getActiveExecutions']);

executionsTab.getters.executionListItems().should('have.length', 2).first().click();
cy.wait(['@getExecution']);
Expand All @@ -77,7 +77,7 @@ describe('Debug', () => {
confirmDialog.find('li').should('have.length', 2);
confirmDialog.get('.btn--cancel').click();

cy.wait(['@getExecutions', '@getCurrentExecutions']);
cy.wait(['@getExecutions', '@getActiveExecutions']);

executionsTab.getters.executionListItems().should('have.length', 2).first().click();
cy.wait(['@getExecution']);
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('Debug', () => {
cy.url().should('not.include', '/debug');

executionsTab.actions.switchToExecutionsTab();
cy.wait(['@getExecutions', '@getCurrentExecutions']);
cy.wait(['@getExecutions', '@getActiveExecutions']);
executionsTab.getters.executionDebugButton().should('have.text', 'Copy to editor').click();

confirmDialog = cy.get('.matching-pinned-nodes-confirmation').filter(':visible');
Expand All @@ -130,7 +130,7 @@ describe('Debug', () => {
workflowPage.actions.deleteNode(IF_NODE_NAME);

executionsTab.actions.switchToExecutionsTab();
cy.wait(['@getExecutions', '@getCurrentExecutions']);
cy.wait(['@getExecutions', '@getActiveExecutions']);
executionsTab.getters.executionListItems().should('have.length', 3).first().click();
cy.wait(['@getExecution']);
executionsTab.getters.executionDebugButton().should('have.text', 'Copy to editor').click();
Expand Down
8 changes: 4 additions & 4 deletions cypress/e2e/30-editor-after-route-changes.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ describe('Editor actions should work', () => {

it('after switching between Editor and Executions', () => {
cy.intercept('GET', '/rest/executions?filter=*').as('getExecutions');
cy.intercept('GET', '/rest/executions-current?filter=*').as('getCurrentExecutions');
cy.intercept('GET', '/rest/executions/active?filter=*').as('getActiveExecutions');

executionsTab.actions.switchToExecutionsTab();
cy.wait(['@getExecutions', '@getCurrentExecutions']);
cy.wait(['@getExecutions', '@getActiveExecutions']);
cy.wait(500);
executionsTab.actions.switchToEditorTab();
editWorkflowAndDeactivate();
Expand All @@ -149,15 +149,15 @@ describe('Editor actions should work', () => {
it('after switching between Editor and Debug', () => {
cy.intercept('GET', '/rest/executions?filter=*').as('getExecutions');
cy.intercept('GET', '/rest/executions/*').as('getExecution');
cy.intercept('GET', '/rest/executions-current?filter=*').as('getCurrentExecutions');
cy.intercept('GET', '/rest/executions/active?filter=*').as('getActiveExecutions');
cy.intercept('POST', '/rest/workflows/run').as('postWorkflowRun');

editWorkflowAndDeactivate();
workflowPage.actions.executeWorkflow();
cy.wait(['@postWorkflowRun']);

executionsTab.actions.switchToExecutionsTab();
cy.wait(['@getExecutions', '@getCurrentExecutions']);
cy.wait(['@getExecutions', '@getActiveExecutions']);

executionsTab.getters.executionListItems().should('have.length', 1).first().click();
cy.wait(['@getExecution']);
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/7-workflow-actions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ describe('Workflow Actions', () => {

it('should keep endpoint click working when switching between execution and editor tab', () => {
cy.intercept('GET', '/rest/executions?filter=*').as('getExecutions');
cy.intercept('GET', '/rest/executions-current?filter=*').as('getCurrentExecutions');
cy.intercept('GET', '/rest/executions/active?filter=*').as('getActiveExecutions');

WorkflowPage.actions.addInitialNodeToCanvas(MANUAL_TRIGGER_NODE_NAME);
WorkflowPage.actions.addNodeToCanvas(EDIT_FIELDS_SET_NODE_NAME);
Expand All @@ -270,7 +270,7 @@ describe('Workflow Actions', () => {
cy.get('body').type('{esc}');

executionsTab.actions.switchToExecutionsTab();
cy.wait(['@getExecutions', '@getCurrentExecutions']);
cy.wait(['@getExecutions', '@getActiveExecutions']);
cy.wait(500);
executionsTab.actions.switchToEditorTab();

Expand Down
11 changes: 2 additions & 9 deletions packages/cli/src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type {
Workflow,
WorkflowExecuteMode,
ExecutionStatus,
IExecutionsSummary,
ExecutionSummary,
FeatureFlags,
INodeProperties,
IUserSettings,
Expand Down Expand Up @@ -170,8 +170,7 @@ export interface IExecutionFlattedResponse extends IExecutionFlatted {

export interface IExecutionsListResponse {
count: number;
// results: IExecutionShortResponse[];
results: IExecutionsSummary[];
results: ExecutionSummary[];
estimated: boolean;
}

Expand All @@ -192,12 +191,6 @@ export interface IExecutionsCurrentSummary {
status?: ExecutionStatus;
}

export interface IExecutionDeleteFilter {
deleteBefore?: Date;
filters?: IDataObject;
ids?: string[];
}

export interface IExecutingWorkflowData {
executionData: IWorkflowExecutionDataProcess;
process?: ChildProcess;
Expand Down
Loading

0 comments on commit 49b52c4

Please sign in to comment.