Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block UI based on pipeline state #62

Merged
merged 4 commits into from
Mar 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/api/route-services/pipeline-response.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions tests/api/route-services/pipeline-response.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down