restructure: move bin/ and tests/ to src/

Also add symlinks from the old `bin/` and `tests/` locations to avoid
breaking scripts and other tools.

Motivations:

  * Scripts and tests no longer have to do dubious things like:

        require('ep_etherpad-lite/node_modules/foo')

    to access packages installed as dependencies in
    `src/package.json`.

  * Plugins can access the backend test helper library in a non-hacky
    way:

        require('ep_etherpad-lite/tests/backend/common')

  * We can delete the top-level `package.json` without breaking our
    ability to lint the files in `bin/` and `tests/`.

    Deleting the top-level `package.json` has downsides: It will cause
    `npm` to print warnings whenever plugins are installed, npm will
    no longer be able to enforce a plugin's peer dependency on
    ep_etherpad-lite, and npm will keep deleting the
    `node_modules/ep_etherpad-lite` symlink that points to `../src`.

    But there are significant upsides to deleting the top-level
    `package.json`: It will drastically speed up plugin installation
    because `npm` doesn't have to recursively walk the dependencies in
    `src/package.json`. Also, deleting the top-level `package.json`
    avoids npm's horrible dependency hoisting behavior (where it moves
    stuff from `src/node_modules/` to the top-level `node_modules/`
    directory). Dependency hoisting causes numerous mysterious
    problems such as silent failures in `npm outdated` and `npm
    update`. Dependency hoisting also breaks plugins that do:

        require('ep_etherpad-lite/node_modules/foo')
pull/4707/head
John McLear 2021-02-03 12:08:43 +00:00 committed by Richard Hansen
parent efde0b787a
commit 2ea8ea1275
146 changed files with 191 additions and 1161 deletions

View File

@ -2,6 +2,9 @@
### Compatibility changes
* Node.js 10.17.0 or newer is now required.
* The `bin/` and `tests/` directories were moved under `src/`. Symlinks were
added at the old locations to hopefully avoid breaking user scripts and other
stuff.
### Notable new features
* Database performance is significantly improved.

1
bin Symbolic link
View File

@ -0,0 +1 @@
src/bin

942
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,112 +2,6 @@
"dependencies": {
"ep_etherpad-lite": "file:src"
},
"devDependencies": {
"eslint": "^7.18.0",
"eslint-config-etherpad": "^1.0.24",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-mocha": "^8.0.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0"
},
"eslintConfig": {
"ignorePatterns": [
"/src/",
"/tests/frontend/lib/"
],
"overrides": [
{
"files": [
"**/.eslintrc.js"
],
"extends": "etherpad/node"
},
{
"files": [
"**/*"
],
"excludedFiles": [
"**/.eslintrc.js",
"tests/frontend/**/*"
],
"extends": "etherpad/node"
},
{
"files": [
"tests/**/*"
],
"excludedFiles": [
"**/.eslintrc.js",
"tests/frontend/travis/**/*",
"tests/ratelimit/**/*"
],
"extends": "etherpad/tests",
"rules": {
"mocha/no-exports": "off",
"mocha/no-top-level-hooks": "off"
}
},
{
"files": [
"tests/backend/**/*"
],
"excludedFiles": [
"**/.eslintrc.js"
],
"extends": "etherpad/tests/backend",
"overrides": [
{
"files": [
"tests/backend/**/*"
],
"excludedFiles": [
"tests/backend/specs/**/*"
],
"rules": {
"mocha/no-exports": "off",
"mocha/no-top-level-hooks": "off"
}
}
]
},
{
"files": [
"tests/frontend/**/*"
],
"excludedFiles": [
"**/.eslintrc.js",
"tests/frontend/travis/**/*"
],
"extends": "etherpad/tests/frontend",
"overrides": [
{
"files": [
"tests/frontend/**/*"
],
"excludedFiles": [
"tests/frontend/specs/**/*"
],
"rules": {
"mocha/no-exports": "off",
"mocha/no-top-level-hooks": "off"
}
}
]
},
{
"files": [
"tests/frontend/travis/**/*"
],
"extends": "etherpad/node"
}
],
"root": true
},
"scripts": {
"lint": "eslint ."
},
"engines": {
"node": "^10.17.0 || >=11.14.0"
}

View File

@ -11,13 +11,13 @@ if (process.argv.length !== 2) throw new Error('Use: node bin/checkAllPads.js');
(async () => {
// initialize the database
require('ep_etherpad-lite/node/utils/Settings');
const db = require('ep_etherpad-lite/node/db/DB');
require('../node/utils/Settings');
const db = require('../node/db/DB');
await db.init();
// load modules
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
const padManager = require('ep_etherpad-lite/node/db/PadManager');
const Changeset = require('../static/js/Changeset');
const padManager = require('../node/db/PadManager');
let revTestedCount = 0;

View File

@ -15,13 +15,13 @@ let checkRevisionCount = 0;
(async () => {
// initialize database
require('ep_etherpad-lite/node/utils/Settings');
const db = require('ep_etherpad-lite/node/db/DB');
require('../node/utils/Settings');
const db = require('../node/db/DB');
await db.init();
// load modules
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
const padManager = require('ep_etherpad-lite/node/db/PadManager');
const Changeset = require('../static/js/Changeset');
const padManager = require('../node/db/PadManager');
const exists = await padManager.doesPadExists(padId);
if (!exists) throw new Error('Pad does not exist');

View File

@ -13,17 +13,17 @@ if (process.argv.length !== 3) throw new Error('Use: node bin/checkPadDeltas.js
const padId = process.argv[2];
const expect = require('../tests/frontend/lib/expect');
const diff = require('ep_etherpad-lite/node_modules/diff');
const diff = require('diff');
(async () => {
// initialize database
require('ep_etherpad-lite/node/utils/Settings');
const db = require('ep_etherpad-lite/node/db/DB');
require('../node/utils/Settings');
const db = require('../node/db/DB');
await db.init();
// load modules
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
const padManager = require('ep_etherpad-lite/node/db/PadManager');
const Changeset = require('../static/js/Changeset');
const padManager = require('../node/db/PadManager');
const exists = await padManager.doesPadExists(padId);
if (!exists) throw new Error('Pad does not exist');

View File

@ -12,13 +12,13 @@ process.on('unhandledRejection', (err) => { throw err; });
const fs = require('fs');
const path = require('path');
const querystring = require('querystring');
const settings = require('ep_etherpad-lite/node/utils/Settings');
const supertest = require('ep_etherpad-lite/node_modules/supertest');
const settings = require('../node/utils/Settings');
const supertest = require('supertest');
(async () => {
const api = supertest(`http://${settings.ip}:${settings.port}`);
const filePath = path.join(__dirname, '../APIKEY.txt');
const filePath = path.join(__dirname, '../../APIKEY.txt');
const apikey = fs.readFileSync(filePath, {encoding: 'utf-8'});
let res;

View File

@ -9,16 +9,16 @@
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
process.on('unhandledRejection', (err) => { throw err; });
const supertest = require('ep_etherpad-lite/node_modules/supertest');
const path = require('path');
const fs = require('fs');
const supertest = require('supertest');
// Set a delete counter which will increment on each delete attempt
// TODO: Check delete is successful before incrementing
let deleteCount = 0;
// get the API Key
const filePath = path.join(__dirname, '../APIKEY.txt');
const filePath = path.join(__dirname, '../../APIKEY.txt');
console.log('Deleting all group sessions, please be patient.');
(async () => {

View File

@ -10,10 +10,11 @@
process.on('unhandledRejection', (err) => { throw err; });
const settings = require('../tests/container/loadSettings').loadSettings();
const supertest = require('ep_etherpad-lite/node_modules/supertest');
const api = supertest(`http://${settings.ip}:${settings.port}`);
const path = require('path');
const fs = require('fs');
const supertest = require('supertest');
const api = supertest(`http://${settings.ip}:${settings.port}`);
if (process.argv.length !== 3) throw new Error('Use: node deletePad.js $PADID');
@ -21,7 +22,7 @@ if (process.argv.length !== 3) throw new Error('Use: node deletePad.js $PADID');
const padId = process.argv[2];
// get the API Key
const filePath = path.join(__dirname, '../APIKEY.txt');
const filePath = path.join(__dirname, '../../APIKEY.txt');
const apikey = fs.readFileSync(filePath, {encoding: 'utf-8'});
(async () => {

View File

@ -17,13 +17,13 @@ const padId = process.argv[2];
(async () => {
// initialize database
require('ep_etherpad-lite/node/utils/Settings');
const db = require('ep_etherpad-lite/node/db/DB');
require('../node/utils/Settings');
const db = require('../node/db/DB');
await db.init();
// load extra modules
const dirtyDB = require('ep_etherpad-lite/node_modules/dirty');
const padManager = require('ep_etherpad-lite/node/db/PadManager');
const dirtyDB = require('dirty');
const padManager = require('../node/db/PadManager');
// initialize output database
const dirty = dirtyDB(`${padId}.db`);

View File

@ -45,9 +45,9 @@ const unescape = (val) => {
(async () => {
const fs = require('fs');
const ueberDB = require('ep_etherpad-lite/node_modules/ueberdb2');
const settings = require('ep_etherpad-lite/node/utils/Settings');
const log4js = require('ep_etherpad-lite/node_modules/log4js');
const log4js = require('log4js');
const settings = require('../node/utils/Settings');
const ueberDB = require('ueberdb2');
const dbWrapperSettings = {
cache: 0,

View File

@ -12,12 +12,12 @@ process.on('unhandledRejection', (err) => { throw err; });
// It might be necessary to run the script using more memory:
// `node --max-old-space-size=4096 bin/migrateDirtyDBtoRealDB.js`
const dirtyDb = require('dirty');
const log4js = require('log4js');
const settings = require('../node/utils/Settings');
const ueberDB = require('ueberdb2');
const util = require('util');
const settings = require('ep_etherpad-lite/node/utils/Settings');
const dirtyDb = require('ep_etherpad-lite/node_modules/dirty');
const ueberDB = require('ep_etherpad-lite/node_modules/ueberdb2');
const log4js = require('ep_etherpad-lite/node_modules/log4js');
const dbWrapperSettings = {
cache: '0', // The cache slows things down when you're mostly writing.
writeInterval: 0, // Write directly to the database, don't buffer
@ -30,7 +30,7 @@ process.on('unhandledRejection', (err) => { throw err; });
await db.init();
console.log('Waiting for dirtyDB to parse its file.');
const dirty = dirtyDb(`${__dirname}/../var/dirty.db`);
const dirty = dirtyDb(`${__dirname}/../../var/dirty.db`);
const length = await new Promise((resolve) => { dirty.once('load', resolve); });
console.log(`Found ${length} records, processing now.`);

View File

@ -429,7 +429,7 @@ fs.readdir(pluginPath, (err, rootFiles) => {
// The ep_etherpad-lite peer dep must be installed last otherwise `npm install` will nuke it. An
// absolute path to etherpad-lite/src is used here so that pluginPath can be a symlink.
execSync(
`${npmInstall} --no-save ep_etherpad-lite@file:${__dirname}/../../src`, {stdio: 'inherit'});
`${npmInstall} --no-save ep_etherpad-lite@file:${__dirname}/../../`, {stdio: 'inherit'});
// linting begins
try {

View File

@ -18,11 +18,11 @@ const newRevHead = process.argv[3];
const newPadId = process.argv[4] || `${padId}-rebuilt`;
(async () => {
const db = require('ep_etherpad-lite/node/db/DB');
const db = require('../node/db/DB');
await db.init();
const PadManager = require('ep_etherpad-lite/node/db/PadManager');
const Pad = require('ep_etherpad-lite/node/db/Pad').Pad;
const PadManager = require('../node/db/PadManager');
const Pad = require('../node/db/Pad').Pad;
// Validate the newPadId if specified and that a pad with that ID does
// not already exist to avoid overwriting it.
if (!PadManager.isValidPadId(newPadId)) {
@ -43,8 +43,8 @@ const newPadId = process.argv[4] || `${padId}-rebuilt`;
}));
// Rebuild Pad from revisions up to and including the new revision head
const AuthorManager = require('ep_etherpad-lite/node/db/AuthorManager');
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
const AuthorManager = require('../node/db/AuthorManager');
const Changeset = require('../static/js/Changeset');
// Author attributes are derived from changesets, but there can also be
// non-author attributes with specific mappings that changesets depend on
// and, AFAICT, cannot be recreated any other way

View File

@ -6,7 +6,7 @@ process.on('unhandledRejection', (err) => { throw err; });
const fs = require('fs');
const childProcess = require('child_process');
const semver = require('ep_etherpad-lite/node_modules/semver');
const semver = require('semver');
/*

View File

@ -19,12 +19,12 @@ let valueCount = 0;
(async () => {
// initialize database
require('ep_etherpad-lite/node/utils/Settings');
const db = require('ep_etherpad-lite/node/db/DB');
require('../node/utils/Settings');
const db = require('../node/db/DB');
await db.init();
// get the pad
const padManager = require('ep_etherpad-lite/node/db/PadManager');
const padManager = require('../node/db/PadManager');
const pad = await padManager.getPad(padId);
// accumulate the required keys

View File

@ -104,7 +104,8 @@
"/static/js/gritter.js",
"/static/js/html10n.js",
"/static/js/jquery.js",
"/static/js/vendors/nice-select.js"
"/static/js/vendors/nice-select.js",
"/tests/frontend/lib/"
],
"overrides": [
{
@ -118,7 +119,8 @@
"**/*"
],
"excludedFiles": [
"**/.eslintrc.js"
"**/.eslintrc.js",
"tests/frontend/**/*"
],
"extends": "etherpad/node"
},
@ -133,6 +135,74 @@
"env": {
"shared-node-browser": true
}
},
{
"files": [
"tests/**/*"
],
"excludedFiles": [
"**/.eslintrc.js",
"tests/frontend/travis/**/*",
"tests/ratelimit/**/*"
],
"extends": "etherpad/tests",
"rules": {
"mocha/no-exports": "off",
"mocha/no-top-level-hooks": "off"
}
},
{
"files": [
"tests/backend/**/*"
],
"excludedFiles": [
"**/.eslintrc.js"
],
"extends": "etherpad/tests/backend",
"overrides": [
{
"files": [
"tests/backend/**/*"
],
"excludedFiles": [
"tests/backend/specs/**/*"
],
"rules": {
"mocha/no-exports": "off",
"mocha/no-top-level-hooks": "off"
}
}
]
},
{
"files": [
"tests/frontend/**/*"
],
"excludedFiles": [
"**/.eslintrc.js",
"tests/frontend/travis/**/*"
],
"extends": "etherpad/tests/frontend",
"overrides": [
{
"files": [
"tests/frontend/**/*"
],
"excludedFiles": [
"tests/frontend/specs/**/*"
],
"rules": {
"mocha/no-exports": "off",
"mocha/no-top-level-hooks": "off"
}
}
]
},
{
"files": [
"tests/frontend/travis/**/*"
],
"extends": "etherpad/node"
}
],
"root": true

View File

@ -1 +0,0 @@
../tests

View File

@ -1,12 +1,12 @@
'use strict';
const apiHandler = require('ep_etherpad-lite/node/handler/APIHandler');
const log4js = require('ep_etherpad-lite/node_modules/log4js');
const apiHandler = require('../../node/handler/APIHandler');
const log4js = require('log4js');
const process = require('process');
const server = require('ep_etherpad-lite/node/server');
const settings = require('ep_etherpad-lite/node/utils/Settings');
const supertest = require('ep_etherpad-lite/node_modules/supertest');
const webaccess = require('ep_etherpad-lite/node/hooks/express/webaccess');
const server = require('../../node/server');
const settings = require('../../node/utils/Settings');
const supertest = require('supertest');
const webaccess = require('../../node/hooks/express/webaccess');
const backups = {};
let inited = false;

View File

@ -3,10 +3,10 @@
* Usage: node fuzzImportTest.js
*/
const common = require('./common');
const settings = require(`${__dirname}/loadSettings`).loadSettings();
const host = `http://${settings.ip}:${settings.port}`;
const request = require('request');
const froth = require('mocha-froth');
const settings = require('../container/loadSettings').loadSettings();
const apiKey = common.apiKey;
const apiVersion = 1;

View File

@ -7,12 +7,11 @@
*/
const common = require('../../common');
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
const settings = require(`${__dirname}/../../../../src/node/utils/Settings`);
const settings = require('../../../../node/utils/Settings');
const supertest = require('supertest');
const validateOpenAPI = require('openapi-schema-validation').validate;
const api = supertest(`http://${settings.ip}:${settings.port}`);
const validateOpenAPI = require(`${__dirname}/../../../../src/node_modules/openapi-schema-validation`).validate;
const apiKey = common.apiKey;
let apiVersion = 1;

View File

@ -7,11 +7,11 @@
*/
const common = require('../../common');
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
const fs = require('fs');
const settings = require(`${__dirname}/../../../../src/node/utils/Settings`);
const api = supertest(`http://${settings.ip}:${settings.port}`);
const settings = require('../../../../node/utils/Settings');
const supertest = require('supertest');
const api = supertest(`http://${settings.ip}:${settings.port}`);
const apiKey = common.apiKey;
let apiVersion = 1;
const testPadId = makeid();

View File

@ -1,8 +1,6 @@
function m(mod) { return `${__dirname}/../../../../src/${mod}`; }
const common = require('../../common');
const settings = require(m('node/utils/Settings'));
const supertest = require(m('node_modules/supertest'));
const settings = require('../../../../node/utils/Settings');
const supertest = require('supertest');
const api = supertest(`http://${settings.ip}:${settings.port}`);
const apiKey = common.apiKey;

View File

@ -3,10 +3,11 @@
*/
/*
const common = require('../../common');
const settings = require(__dirname+'/../../../../tests/container/loadSettings.js').loadSettings();
const froth = require('mocha-froth');
const request = require('request');
const settings = require('../../../container/loadSettings.js').loadSettings();
const host = "http://" + settings.ip + ":" + settings.port;
const request = require(__dirname+'/../../../../src/node_modules/request');
const froth = require(__dirname+'/../../../../src/node_modules/mocha-froth');
const apiKey = common.apiKey;
var apiVersion = 1;

View File

Before

Width:  |  Height:  |  Size: 355 KiB

After

Width:  |  Height:  |  Size: 355 KiB

View File

@ -8,7 +8,7 @@
const common = require('../../common');
const settings = require('../../../container/loadSettings.js').loadSettings();
const supertest = require('ep_etherpad-lite/node_modules/supertest');
const supertest = require('supertest');
const api = supertest(`http://${settings.ip}:${settings.port}`);
const apiKey = common.apiKey;

View File

@ -6,11 +6,11 @@
const assert = require('assert').strict;
const common = require('../../common');
const superagent = require('ep_etherpad-lite/node_modules/superagent');
const fs = require('fs');
const settings = require('ep_etherpad-lite/node/utils/Settings');
const padManager = require('ep_etherpad-lite/node/db/PadManager');
const plugins = require('ep_etherpad-lite/static/js/pluginfw/plugin_defs');
const settings = require('../../../../node/utils/Settings');
const superagent = require('superagent');
const padManager = require('../../../../node/db/PadManager');
const plugins = require('../../../../static/js/pluginfw/plugin_defs');
const padText = fs.readFileSync('../tests/backend/specs/api/test.txt');
const etherpadDoc = fs.readFileSync('../tests/backend/specs/api/test.etherpad');

View File

@ -4,8 +4,9 @@
* Section "GLOBAL FUNCTIONS" in src/node/db/API.js
*/
const common = require('../../common');
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
const settings = require(`${__dirname}/../../../../src/node/utils/Settings`);
const settings = require('../../../../node/utils/Settings');
const supertest = require('supertest');
const api = supertest(`http://${settings.ip}:${settings.port}`);
const apiKey = common.apiKey;

View File

@ -5,11 +5,12 @@
* TODO: unify those two files, and merge in a single one.
*/
const async = require('async');
const common = require('../../common');
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
const settings = require(`${__dirname}/../../../../src/node/utils/Settings`);
const settings = require('../../../../node/utils/Settings');
const supertest = require('supertest');
const api = supertest(`http://${settings.ip}:${settings.port}`);
const async = require(`${__dirname}/../../../../src/node_modules/async`);
const apiKey = common.apiKey;
let apiVersion = 1;

View File

@ -1,7 +1,8 @@
const assert = require('assert').strict;
const common = require('../../common');
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
const settings = require(`${__dirname}/../../../../src/node/utils/Settings`);
const settings = require('../../../../node/utils/Settings');
const supertest = require('supertest');
const api = supertest(`http://${settings.ip}:${settings.port}`);
const apiKey = common.apiKey;

View File

@ -6,16 +6,16 @@ const fs = require('fs');
const path = require('path');
let TidyHtml;
let Settings;
const npm = require('ep_etherpad-lite/node_modules/npm/lib/npm.js');
const nodeify = require('ep_etherpad-lite/node_modules/nodeify');
const npm = require('npm/lib/npm.js');
const nodeify = require('nodeify');
describe(__filename, function () {
describe('tidyHtml', function () {
before(function (done) {
npm.load({}, (err) => {
assert.ok(!err);
TidyHtml = require('ep_etherpad-lite/node/utils/TidyHtml');
Settings = require('ep_etherpad-lite/node/utils/Settings');
TidyHtml = require('../../../../node/utils/TidyHtml');
Settings = require('../../../../node/utils/Settings');
return done();
});
});

View File

@ -5,10 +5,10 @@
*/
const common = require('../common');
const settings = require('../../../src/node/utils/Settings');
const assert = require('assert').strict;
const url = require('url');
const queryString = require('querystring');
const settings = require('../../../node/utils/Settings');
let agent;

View File

@ -9,10 +9,10 @@
* If you add tests here, please also add them to importexport.js
*/
const AttributePool = require('ep_etherpad-lite/static/js/AttributePool');
const AttributePool = require('../../../static/js/AttributePool');
const assert = require('assert').strict;
const cheerio = require('ep_etherpad-lite/node_modules/cheerio');
const contentcollector = require('ep_etherpad-lite/static/js/contentcollector');
const cheerio = require('cheerio');
const contentcollector = require('../../../static/js/contentcollector');
const tests = {
nestedLi: {

View File

@ -1,9 +1,9 @@
'use strict';
const assert = require('assert').strict;
const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
const plugins = require('ep_etherpad-lite/static/js/pluginfw/plugin_defs');
const sinon = require('ep_etherpad-lite/node_modules/sinon');
const hooks = require('../../../static/js/pluginfw/hooks');
const plugins = require('../../../static/js/pluginfw/plugin_defs');
const sinon = require('sinon');
describe(__filename, function () {
const hookName = 'testHook';

View File

@ -1,7 +1,5 @@
function m(mod) { return `${__dirname}/../../../src/${mod}`; }
const assert = require('assert').strict;
const promises = require(m('node/utils/promises'));
const promises = require('../../../node/utils/promises');
describe(__filename, function () {
describe('promises.timesLimit', function () {

View File

@ -2,11 +2,11 @@
const assert = require('assert').strict;
const common = require('../common');
const io = require('ep_etherpad-lite/node_modules/socket.io-client');
const padManager = require('ep_etherpad-lite/node/db/PadManager');
const plugins = require('ep_etherpad-lite/static/js/pluginfw/plugin_defs');
const setCookieParser = require('ep_etherpad-lite/node_modules/set-cookie-parser');
const settings = require('ep_etherpad-lite/node/utils/Settings');
const io = require('socket.io-client');
const padManager = require('../../../node/db/PadManager');
const plugins = require('../../../static/js/pluginfw/plugin_defs');
const setCookieParser = require('set-cookie-parser');
const settings = require('../../../node/utils/Settings');
const logger = common.logger;

View File

@ -1,5 +1,5 @@
const common = require('../common');
const settings = require('ep_etherpad-lite/node/utils/Settings');
const settings = require('../../../node/utils/Settings');
describe(__filename, function () {
let agent;

View File

@ -2,8 +2,8 @@
const assert = require('assert').strict;
const common = require('../common');
const plugins = require('ep_etherpad-lite/static/js/pluginfw/plugin_defs');
const settings = require('ep_etherpad-lite/node/utils/Settings');
const plugins = require('../../../static/js/pluginfw/plugin_defs');
const settings = require('../../../node/utils/Settings');
describe(__filename, function () {
let agent;

View File

@ -12,11 +12,11 @@
* back to a default)
*/
const jsonminify = require(`${__dirname}/../../src/node_modules/jsonminify`);
const fs = require('fs');
const jsonminify = require('jsonminify');
function loadSettings() {
let settingsStr = fs.readFileSync(`${__dirname}/../../settings.json.docker`).toString();
let settingsStr = fs.readFileSync(`${__dirname}/../../../settings.json.docker`).toString();
// try to parse the settings
try {
if (settingsStr) {

View File

@ -5,10 +5,10 @@
* TODO: unify those two files, and merge in a single one.
*/
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
const settings = require(`${__dirname}/../../loadSettings`).loadSettings();
const api = supertest(`http://${settings.ip}:${settings.port}`);
const settings = require('../../loadSettings').loadSettings();
const supertest = require('supertest');
const api = supertest(`http://${settings.ip}:${settings.port}`);
const apiVersion = 1;
describe('Connectivity', function () {

Some files were not shown because too many files have changed in this diff Show More