From ca4610628b4fdb36794b3519a2e1d4b133436725 Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Thu, 29 Dec 2022 23:36:16 +0300 Subject: [PATCH 1/3] Update validate.test.js --- tests/commands/channels/validate.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/commands/channels/validate.test.js b/tests/commands/channels/validate.test.js index b705d3cf..9ee8053f 100644 --- a/tests/commands/channels/validate.test.js +++ b/tests/commands/channels/validate.test.js @@ -3,7 +3,7 @@ const { execSync } = require('child_process') it('will show a message if the file contains a duplicate', () => { try { const stdout = execSync( - 'npm run channels:validate -- tests/__data__/input/sites/duplicate.channels.xml', + 'DATA_DIR=tests/__data__/input/data npm run channels:validate -- tests/__data__/input/sites/duplicate.channels.xml', { encoding: 'utf8' } @@ -27,7 +27,7 @@ it('will show a message if the file contains a duplicate', () => { it('will show a message if the file contains a channel with wrong xmltv_id', () => { try { const stdout = execSync( - 'npm run channels:validate -- tests/__data__/input/sites/wrong_xmltv_id.channels.xml', + 'DATA_DIR=tests/__data__/input/data npm run channels:validate -- tests/__data__/input/sites/wrong_xmltv_id.channels.xml', { encoding: 'utf8' } From 133809e9164f33291678dcf5143ad98d40d59c4d Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Thu, 29 Dec 2022 23:36:21 +0300 Subject: [PATCH 2/3] Update queue.db --- tests/__data__/expected/database/create-queue/queue.db | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/__data__/expected/database/create-queue/queue.db b/tests/__data__/expected/database/create-queue/queue.db index 74a96e62..f5d5fcc4 100644 --- a/tests/__data__/expected/database/create-queue/queue.db +++ b/tests/__data__/expected/database/create-queue/queue.db @@ -1,4 +1,4 @@ -{"channel":{"lang":"en","id":"CNNInternationalEurope.us","name":"CNN International","logo":"https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/CNN_International_logo.svg/512px-CNN_International_logo.svg.png","url":"https://example.com","site_id":"140","site":"example.com"},"date":"2022-02-03T00:00:00.000Z","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ca-en/example.com"],"error":null,"cluster_id":1,"_id":"vOpwztzvJ5pFSVws"} -{"channel":{"lang":"en","id":"CNNInternationalEurope.us","name":"CNN International","logo":"https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/CNN_International_logo.svg/512px-CNN_International_logo.svg.png","url":"https://example.com","site_id":"140","site":"example.com"},"date":"2022-02-04T00:00:00.000Z","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ca-en/example.com"],"error":null,"cluster_id":1,"_id":"sP2A0zQSOoVg0BS1"} -{"channel":{"lang":"ru","id":"CNNInternationalEurope.us","name":"CNN International","logo":"https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/CNN_International_logo.svg/512px-CNN_International_logo.svg.png","url":"https://example.com","site_id":"140","site":"example.com"},"date":"2022-02-03T00:00:00.000Z","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ca-ru/example.com"],"error":null,"cluster_id":1,"_id":"vOpwztzvJ5pFSVwB"} -{"channel":{"lang":"ru","id":"CNNInternationalEurope.us","name":"CNN International","logo":"https://upload.wikimedia.org/wikipedia/commons/thumb/6/66/CNN_International_logo.svg/512px-CNN_International_logo.svg.png","url":"https://example.com","site_id":"140","site":"example.com"},"date":"2022-02-04T00:00:00.000Z","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ca-ru/example.com"],"error":null,"cluster_id":1,"_id":"sP2A0zQSOoVg0BSB"} \ No newline at end of file +{"channel":{"id":"CNNInternationalEurope.us","name":"CNN International","site":"example.com","site_id":"140","lang":"en","logo":"https://i.imgur.com/2BXCg0x.jpg","url":"https://example.com"},"date":"2022-12-29T00:00:00.000Z","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ca-en/example.com"],"error":null,"cluster_id":1,"_id":"z8NuUrwLzFmvwVaN"} +{"channel":{"id":"CNNInternationalEurope.us","name":"CNN International","site":"example.com","site_id":"140","lang":"en","logo":"https://i.imgur.com/2BXCg0x.jpg","url":"https://example.com"},"date":"2022-12-30T00:00:00.000Z","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ca-en/example.com"],"error":null,"cluster_id":1,"_id":"VbOAfybHJmi9fVhI"} +{"channel":{"id":"CNNInternationalEurope.us","name":"CNN International","site":"example.com","site_id":"140","lang":"ru","logo":"https://i.imgur.com/2BXCg0x.jpg","url":"https://example.com"},"date":"2022-12-29T00:00:00.000Z","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ca-ru/example.com"],"error":null,"cluster_id":1,"_id":"Gv8kvgVzGQH345DI"} +{"channel":{"id":"CNNInternationalEurope.us","name":"CNN International","site":"example.com","site_id":"140","lang":"ru","logo":"https://i.imgur.com/2BXCg0x.jpg","url":"https://example.com"},"date":"2022-12-30T00:00:00.000Z","configPath":"tests/__data__/input/sites/example.com.config.js","groups":["ca-ru/example.com"],"error":null,"cluster_id":1,"_id":"qk1kIFkVtbBXLsIp"} From 6108aa7cf43716482dc6426163123978dad03c4c Mon Sep 17 00:00:00 2001 From: Aleksandr Statciuk Date: Thu, 29 Dec 2022 23:36:24 +0300 Subject: [PATCH 3/3] Update create.test.js --- tests/commands/queue/create.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/commands/queue/create.test.js b/tests/commands/queue/create.test.js index 8275ad24..3f0516cb 100644 --- a/tests/commands/queue/create.test.js +++ b/tests/commands/queue/create.test.js @@ -6,7 +6,7 @@ beforeEach(() => { fs.emptyDirSync('tests/__data__/output') const stdout = execSync( - 'DB_DIR=tests/__data__/output/database CHANNELS_PATH=tests/__data__/input/sites/example.com_ca-*.channels.xml npm run queue:create -- --max-clusters=1 --days=2', + 'DB_DIR=tests/__data__/output/database CHANNELS_PATH=tests/__data__/input/sites/example.com_ca-*.channels.xml DATA_DIR=tests/__data__/input/data npm run queue:create -- --max-clusters=1 --days=2', { encoding: 'utf8' } ) })