Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed Nov 8, 2024
1 parent 82fa16d commit 0f6d7f6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"oplog_populator": "node extensions/oplogPopulator/OplogPopulatorTask.js",
"mongo_queue_processor": "node extensions/mongoProcessor/mongoProcessorTask.js",
"garbage_collector": "node extensions/gc/service.js",
"test": "mocha --recursive tests/unit/ingestion/mongoProcessor.spec.js --timeout 30000",
"test": "mocha --recursive tests/unit/ingestion/mongoQueueProcessor.spec.js --timeout 30000",
"cover:test": "nyc --clean --silent yarn run test && nyc report --report-dir ./coverage/test --reporter=lcov",
"ft_test": "mocha --recursive $(find tests/functional -name '*.js') --timeout 30000",
"ft_test:notification": "mocha --recursive $(find tests/functional/notification -name '*.js') --timeout 30000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ const sinon = require('sinon');
const { EventEmitter } = require('events');
const MongoQueueProcessor = require('../../../extensions/mongoProcessor/MongoQueueProcessor');
const { BackbeatConsumer } = require('../../../lib/BackbeatConsumer');
const Config = require('../../../lib/Config');

describe('MongoQueueProcessor', function() {
describe('MongoQueueProcessor', () => {
let mqp;

beforeEach(() => {
Expand All @@ -22,12 +21,12 @@ describe('MongoQueueProcessor', function() {
});

describe('::start', () => {
it('should log an error and exit if MongoDB connection fails', done => {
it('should log an error and exit if MongoDB connection fails', (done) => {

Check warning on line 24 in tests/unit/ingestion/mongoQueueProcessor.spec.js

View workflow job for this annotation

GitHub Actions / tests

Unexpected parentheses around single function argument
const loggerErrorStub = sinon.stub(mqp.logger, 'error');
const loggerFatalStub = sinon.stub(mqp.logger, 'fatal');
const processExitStub = sinon.stub(process, 'exit');

sinon.stub(mqp._mongoClient, 'setup').callsFake(callback => {
sinon.stub(mqp._mongoClient, 'setup').callsFake((callback) => {

Check warning on line 29 in tests/unit/ingestion/mongoQueueProcessor.spec.js

View workflow job for this annotation

GitHub Actions / tests

Unexpected parentheses around single function argument
callback(new Error('Simulated connection failure'));
});

Expand All @@ -44,11 +43,11 @@ describe('MongoQueueProcessor', function() {
}, 100);
});

it('should initialize and start the Kafka consumer', done => {
it('should initialize and start the Kafka consumer', (done) => {

Check warning on line 46 in tests/unit/ingestion/mongoQueueProcessor.spec.js

View workflow job for this annotation

GitHub Actions / tests

Unexpected parentheses around single function argument
const consumerStub = sinon.stub(BackbeatConsumer.prototype, 'on');
const subscribeStub = sinon.stub(BackbeatConsumer.prototype, 'subscribe');

sinon.stub(mqp._mongoClient, 'setup').callsFake(callback => {
sinon.stub(mqp._mongoClient, 'setup').callsFake((callback) => {

Check warning on line 50 in tests/unit/ingestion/mongoQueueProcessor.spec.js

View workflow job for this annotation

GitHub Actions / tests

Unexpected parentheses around single function argument
callback(null);
});

Expand All @@ -63,9 +62,9 @@ describe('MongoQueueProcessor', function() {
});

describe('::stop', () => {
it('should close the Kafka consumer if it exists', done => {
it('should close the Kafka consumer if it exists', (done) => {

Check warning on line 65 in tests/unit/ingestion/mongoQueueProcessor.spec.js

View workflow job for this annotation

GitHub Actions / tests

Unexpected parentheses around single function argument
mqp._consumer = new EventEmitter();
mqp._consumer.close = sinon.stub().callsFake(callback => {
mqp._consumer.close = sinon.stub().callsFake((callback) => {

Check warning on line 67 in tests/unit/ingestion/mongoQueueProcessor.spec.js

View workflow job for this annotation

GitHub Actions / tests

Unexpected parentheses around single function argument
callback();
});

Expand All @@ -79,7 +78,7 @@ describe('MongoQueueProcessor', function() {
});
});

it('should log a message if there is no Kafka consumer to close', done => {
it('should log a message if there is no Kafka consumer to close', (done) => {

Check warning on line 81 in tests/unit/ingestion/mongoQueueProcessor.spec.js

View workflow job for this annotation

GitHub Actions / tests

Unexpected parentheses around single function argument
const loggerDebugStub = sinon.stub(mqp.logger, 'debug');

mqp.stop(() => {
Expand All @@ -89,4 +88,4 @@ describe('MongoQueueProcessor', function() {
});
});
});
});
});

0 comments on commit 0f6d7f6

Please sign in to comment.