From 1ca09b63edd46d3bd2adbb0801b7c2b9808f3f2b Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 4 Aug 2022 14:20:36 -0400 Subject: [PATCH] fix: #10809, test runner to only run tests for plugins included in `test_plugins` --- test/plugins-installed.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/plugins-installed.js b/test/plugins-installed.js index 9b9ebc834d..ddbd454b2e 100644 --- a/test/plugins-installed.js +++ b/test/plugins-installed.js @@ -1,14 +1,16 @@ 'use strict'; +const nconf = require('nconf'); const path = require('path'); const fs = require('fs'); const db = require('./mocks/databasemock'); -const installedPlugins = fs.readdirSync(path.join(__dirname, '../node_modules')) - .filter(p => p.startsWith('nodebb-')); +const active = nconf.get('test_plugins') || []; +const toTest = fs.readdirSync(path.join(__dirname, '../node_modules')) + .filter(p => p.startsWith('nodebb-') && active.includes(p)); describe('Installed Plugins', () => { - installedPlugins.forEach((plugin) => { + toTest.forEach((plugin) => { const pathToTests = path.join(__dirname, '../node_modules', plugin, 'test'); try { require(pathToTests);