diff --git a/src/api/route-services/pipeline-response.js b/src/api/route-services/pipeline-response.js index 19a77f8db..169f4ee09 100644 --- a/src/api/route-services/pipeline-response.js +++ b/src/api/route-services/pipeline-response.js @@ -4,6 +4,7 @@ const logger = require('../../utils/logging'); const ExperimentService = require('./experiment'); const PlotsTablesService = require('./plots-tables'); +const pipelineStatus = require('../general-services/pipeline-status'); const experimentService = new ExperimentService(); const plotsTableService = new PlotsTablesService(); @@ -85,10 +86,13 @@ const pipelineResponse = async (io, message) => { experimentService.updateProcessingConfig(experimentId, [{ name: taskName, body: output.config }]); + const statusRes = await pipelineStatus(experimentId); + // Concatenate into a proper response. const response = { ...message, output, + status: statusRes, }; logger.log('Sending to all clients subscribed to experiment', experimentId); diff --git a/tests/api/route-services/pipeline-response.test.js b/tests/api/route-services/pipeline-response.test.js index 4a9c4657f..584c2c28f 100644 --- a/tests/api/route-services/pipeline-response.test.js +++ b/tests/api/route-services/pipeline-response.test.js @@ -6,6 +6,10 @@ const ioServer = require('socket.io')({ const AWS = require('../../../src/utils/requireAWS'); const pipelineResponse = require('../../../src/api/route-services/pipeline-response'); +jest.mock('../../../src/api/general-services/pipeline-status', () => jest.fn().mockImplementation(() => ({ + pipelineStatus: () => ({}), +}))); + describe('Test Pipeline Response Service', () => { let io; let client;