mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 06:03:34 +01:00
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')
This commit is contained in:
parent
efde0b787a
commit
2ea8ea1275
146 changed files with 191 additions and 1161 deletions
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
### Compatibility changes
|
### Compatibility changes
|
||||||
* Node.js 10.17.0 or newer is now required.
|
* 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
|
### Notable new features
|
||||||
* Database performance is significantly improved.
|
* Database performance is significantly improved.
|
||||||
|
|
1
bin
Symbolic link
1
bin
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
src/bin
|
942
package-lock.json
generated
942
package-lock.json
generated
File diff suppressed because it is too large
Load diff
106
package.json
106
package.json
|
@ -2,112 +2,6 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ep_etherpad-lite": "file:src"
|
"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": {
|
"engines": {
|
||||||
"node": "^10.17.0 || >=11.14.0"
|
"node": "^10.17.0 || >=11.14.0"
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,13 +11,13 @@ if (process.argv.length !== 2) throw new Error('Use: node bin/checkAllPads.js');
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
// initialize the database
|
// initialize the database
|
||||||
require('ep_etherpad-lite/node/utils/Settings');
|
require('../node/utils/Settings');
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('../node/db/DB');
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|
||||||
// load modules
|
// load modules
|
||||||
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
|
const Changeset = require('../static/js/Changeset');
|
||||||
const padManager = require('ep_etherpad-lite/node/db/PadManager');
|
const padManager = require('../node/db/PadManager');
|
||||||
|
|
||||||
let revTestedCount = 0;
|
let revTestedCount = 0;
|
||||||
|
|
|
@ -15,13 +15,13 @@ let checkRevisionCount = 0;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
// initialize database
|
// initialize database
|
||||||
require('ep_etherpad-lite/node/utils/Settings');
|
require('../node/utils/Settings');
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('../node/db/DB');
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|
||||||
// load modules
|
// load modules
|
||||||
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
|
const Changeset = require('../static/js/Changeset');
|
||||||
const padManager = require('ep_etherpad-lite/node/db/PadManager');
|
const padManager = require('../node/db/PadManager');
|
||||||
|
|
||||||
const exists = await padManager.doesPadExists(padId);
|
const exists = await padManager.doesPadExists(padId);
|
||||||
if (!exists) throw new Error('Pad does not exist');
|
if (!exists) throw new Error('Pad does not exist');
|
|
@ -13,17 +13,17 @@ if (process.argv.length !== 3) throw new Error('Use: node bin/checkPadDeltas.js
|
||||||
const padId = process.argv[2];
|
const padId = process.argv[2];
|
||||||
|
|
||||||
const expect = require('../tests/frontend/lib/expect');
|
const expect = require('../tests/frontend/lib/expect');
|
||||||
const diff = require('ep_etherpad-lite/node_modules/diff');
|
const diff = require('diff');
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
// initialize database
|
// initialize database
|
||||||
require('ep_etherpad-lite/node/utils/Settings');
|
require('../node/utils/Settings');
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('../node/db/DB');
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|
||||||
// load modules
|
// load modules
|
||||||
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
|
const Changeset = require('../static/js/Changeset');
|
||||||
const padManager = require('ep_etherpad-lite/node/db/PadManager');
|
const padManager = require('../node/db/PadManager');
|
||||||
|
|
||||||
const exists = await padManager.doesPadExists(padId);
|
const exists = await padManager.doesPadExists(padId);
|
||||||
if (!exists) throw new Error('Pad does not exist');
|
if (!exists) throw new Error('Pad does not exist');
|
|
@ -12,13 +12,13 @@ process.on('unhandledRejection', (err) => { throw err; });
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const querystring = require('querystring');
|
const querystring = require('querystring');
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('../node/utils/Settings');
|
||||||
const supertest = require('ep_etherpad-lite/node_modules/supertest');
|
const supertest = require('supertest');
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
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'});
|
const apikey = fs.readFileSync(filePath, {encoding: 'utf-8'});
|
||||||
|
|
||||||
let res;
|
let res;
|
|
@ -9,16 +9,16 @@
|
||||||
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
|
||||||
process.on('unhandledRejection', (err) => { throw err; });
|
process.on('unhandledRejection', (err) => { throw err; });
|
||||||
|
|
||||||
const supertest = require('ep_etherpad-lite/node_modules/supertest');
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const supertest = require('supertest');
|
||||||
|
|
||||||
// Set a delete counter which will increment on each delete attempt
|
// Set a delete counter which will increment on each delete attempt
|
||||||
// TODO: Check delete is successful before incrementing
|
// TODO: Check delete is successful before incrementing
|
||||||
let deleteCount = 0;
|
let deleteCount = 0;
|
||||||
|
|
||||||
// get the API Key
|
// 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.');
|
console.log('Deleting all group sessions, please be patient.');
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
|
@ -10,10 +10,11 @@
|
||||||
process.on('unhandledRejection', (err) => { throw err; });
|
process.on('unhandledRejection', (err) => { throw err; });
|
||||||
|
|
||||||
const settings = require('../tests/container/loadSettings').loadSettings();
|
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 path = require('path');
|
||||||
const fs = require('fs');
|
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');
|
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];
|
const padId = process.argv[2];
|
||||||
|
|
||||||
// get the API Key
|
// 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'});
|
const apikey = fs.readFileSync(filePath, {encoding: 'utf-8'});
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
|
@ -17,13 +17,13 @@ const padId = process.argv[2];
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
// initialize database
|
// initialize database
|
||||||
require('ep_etherpad-lite/node/utils/Settings');
|
require('../node/utils/Settings');
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('../node/db/DB');
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|
||||||
// load extra modules
|
// load extra modules
|
||||||
const dirtyDB = require('ep_etherpad-lite/node_modules/dirty');
|
const dirtyDB = require('dirty');
|
||||||
const padManager = require('ep_etherpad-lite/node/db/PadManager');
|
const padManager = require('../node/db/PadManager');
|
||||||
|
|
||||||
// initialize output database
|
// initialize output database
|
||||||
const dirty = dirtyDB(`${padId}.db`);
|
const dirty = dirtyDB(`${padId}.db`);
|
|
@ -45,9 +45,9 @@ const unescape = (val) => {
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const ueberDB = require('ep_etherpad-lite/node_modules/ueberdb2');
|
const log4js = require('log4js');
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('../node/utils/Settings');
|
||||||
const log4js = require('ep_etherpad-lite/node_modules/log4js');
|
const ueberDB = require('ueberdb2');
|
||||||
|
|
||||||
const dbWrapperSettings = {
|
const dbWrapperSettings = {
|
||||||
cache: 0,
|
cache: 0,
|
|
@ -12,12 +12,12 @@ process.on('unhandledRejection', (err) => { throw err; });
|
||||||
// It might be necessary to run the script using more memory:
|
// It might be necessary to run the script using more memory:
|
||||||
// `node --max-old-space-size=4096 bin/migrateDirtyDBtoRealDB.js`
|
// `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 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 = {
|
const dbWrapperSettings = {
|
||||||
cache: '0', // The cache slows things down when you're mostly writing.
|
cache: '0', // The cache slows things down when you're mostly writing.
|
||||||
writeInterval: 0, // Write directly to the database, don't buffer
|
writeInterval: 0, // Write directly to the database, don't buffer
|
||||||
|
@ -30,7 +30,7 @@ process.on('unhandledRejection', (err) => { throw err; });
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|
||||||
console.log('Waiting for dirtyDB to parse its file.');
|
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); });
|
const length = await new Promise((resolve) => { dirty.once('load', resolve); });
|
||||||
|
|
||||||
console.log(`Found ${length} records, processing now.`);
|
console.log(`Found ${length} records, processing now.`);
|
|
@ -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
|
// 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.
|
// absolute path to etherpad-lite/src is used here so that pluginPath can be a symlink.
|
||||||
execSync(
|
execSync(
|
||||||
`${npmInstall} --no-save ep_etherpad-lite@file:${__dirname}/../../src`, {stdio: 'inherit'});
|
`${npmInstall} --no-save ep_etherpad-lite@file:${__dirname}/../../`, {stdio: 'inherit'});
|
||||||
|
|
||||||
// linting begins
|
// linting begins
|
||||||
try {
|
try {
|
|
@ -18,11 +18,11 @@ const newRevHead = process.argv[3];
|
||||||
const newPadId = process.argv[4] || `${padId}-rebuilt`;
|
const newPadId = process.argv[4] || `${padId}-rebuilt`;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('../node/db/DB');
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|
||||||
const PadManager = require('ep_etherpad-lite/node/db/PadManager');
|
const PadManager = require('../node/db/PadManager');
|
||||||
const Pad = require('ep_etherpad-lite/node/db/Pad').Pad;
|
const Pad = require('../node/db/Pad').Pad;
|
||||||
// Validate the newPadId if specified and that a pad with that ID does
|
// Validate the newPadId if specified and that a pad with that ID does
|
||||||
// not already exist to avoid overwriting it.
|
// not already exist to avoid overwriting it.
|
||||||
if (!PadManager.isValidPadId(newPadId)) {
|
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
|
// Rebuild Pad from revisions up to and including the new revision head
|
||||||
const AuthorManager = require('ep_etherpad-lite/node/db/AuthorManager');
|
const AuthorManager = require('../node/db/AuthorManager');
|
||||||
const Changeset = require('ep_etherpad-lite/static/js/Changeset');
|
const Changeset = require('../static/js/Changeset');
|
||||||
// Author attributes are derived from changesets, but there can also be
|
// Author attributes are derived from changesets, but there can also be
|
||||||
// non-author attributes with specific mappings that changesets depend on
|
// non-author attributes with specific mappings that changesets depend on
|
||||||
// and, AFAICT, cannot be recreated any other way
|
// and, AFAICT, cannot be recreated any other way
|
|
@ -6,7 +6,7 @@ process.on('unhandledRejection', (err) => { throw err; });
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const childProcess = require('child_process');
|
const childProcess = require('child_process');
|
||||||
const semver = require('ep_etherpad-lite/node_modules/semver');
|
const semver = require('semver');
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -19,12 +19,12 @@ let valueCount = 0;
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
// initialize database
|
// initialize database
|
||||||
require('ep_etherpad-lite/node/utils/Settings');
|
require('../node/utils/Settings');
|
||||||
const db = require('ep_etherpad-lite/node/db/DB');
|
const db = require('../node/db/DB');
|
||||||
await db.init();
|
await db.init();
|
||||||
|
|
||||||
// get the pad
|
// get the pad
|
||||||
const padManager = require('ep_etherpad-lite/node/db/PadManager');
|
const padManager = require('../node/db/PadManager');
|
||||||
const pad = await padManager.getPad(padId);
|
const pad = await padManager.getPad(padId);
|
||||||
|
|
||||||
// accumulate the required keys
|
// accumulate the required keys
|
|
@ -104,7 +104,8 @@
|
||||||
"/static/js/gritter.js",
|
"/static/js/gritter.js",
|
||||||
"/static/js/html10n.js",
|
"/static/js/html10n.js",
|
||||||
"/static/js/jquery.js",
|
"/static/js/jquery.js",
|
||||||
"/static/js/vendors/nice-select.js"
|
"/static/js/vendors/nice-select.js",
|
||||||
|
"/tests/frontend/lib/"
|
||||||
],
|
],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
|
@ -118,7 +119,8 @@
|
||||||
"**/*"
|
"**/*"
|
||||||
],
|
],
|
||||||
"excludedFiles": [
|
"excludedFiles": [
|
||||||
"**/.eslintrc.js"
|
"**/.eslintrc.js",
|
||||||
|
"tests/frontend/**/*"
|
||||||
],
|
],
|
||||||
"extends": "etherpad/node"
|
"extends": "etherpad/node"
|
||||||
},
|
},
|
||||||
|
@ -133,6 +135,74 @@
|
||||||
"env": {
|
"env": {
|
||||||
"shared-node-browser": true
|
"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
|
"root": true
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
../tests
|
|
|
@ -1,12 +1,12 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const apiHandler = require('ep_etherpad-lite/node/handler/APIHandler');
|
const apiHandler = require('../../node/handler/APIHandler');
|
||||||
const log4js = require('ep_etherpad-lite/node_modules/log4js');
|
const log4js = require('log4js');
|
||||||
const process = require('process');
|
const process = require('process');
|
||||||
const server = require('ep_etherpad-lite/node/server');
|
const server = require('../../node/server');
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('../../node/utils/Settings');
|
||||||
const supertest = require('ep_etherpad-lite/node_modules/supertest');
|
const supertest = require('supertest');
|
||||||
const webaccess = require('ep_etherpad-lite/node/hooks/express/webaccess');
|
const webaccess = require('../../node/hooks/express/webaccess');
|
||||||
|
|
||||||
const backups = {};
|
const backups = {};
|
||||||
let inited = false;
|
let inited = false;
|
|
@ -3,10 +3,10 @@
|
||||||
* Usage: node fuzzImportTest.js
|
* Usage: node fuzzImportTest.js
|
||||||
*/
|
*/
|
||||||
const common = require('./common');
|
const common = require('./common');
|
||||||
const settings = require(`${__dirname}/loadSettings`).loadSettings();
|
|
||||||
const host = `http://${settings.ip}:${settings.port}`;
|
const host = `http://${settings.ip}:${settings.port}`;
|
||||||
const request = require('request');
|
const request = require('request');
|
||||||
const froth = require('mocha-froth');
|
const froth = require('mocha-froth');
|
||||||
|
const settings = require('../container/loadSettings').loadSettings();
|
||||||
|
|
||||||
const apiKey = common.apiKey;
|
const apiKey = common.apiKey;
|
||||||
const apiVersion = 1;
|
const apiVersion = 1;
|
|
@ -7,12 +7,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
|
const settings = require('../../../../node/utils/Settings');
|
||||||
const settings = require(`${__dirname}/../../../../src/node/utils/Settings`);
|
const supertest = require('supertest');
|
||||||
|
const validateOpenAPI = require('openapi-schema-validation').validate;
|
||||||
|
|
||||||
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
||||||
|
|
||||||
const validateOpenAPI = require(`${__dirname}/../../../../src/node_modules/openapi-schema-validation`).validate;
|
|
||||||
|
|
||||||
const apiKey = common.apiKey;
|
const apiKey = common.apiKey;
|
||||||
let apiVersion = 1;
|
let apiVersion = 1;
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const settings = require(`${__dirname}/../../../../src/node/utils/Settings`);
|
const settings = require('../../../../node/utils/Settings');
|
||||||
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
const supertest = require('supertest');
|
||||||
|
|
||||||
|
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
||||||
const apiKey = common.apiKey;
|
const apiKey = common.apiKey;
|
||||||
let apiVersion = 1;
|
let apiVersion = 1;
|
||||||
const testPadId = makeid();
|
const testPadId = makeid();
|
|
@ -1,8 +1,6 @@
|
||||||
function m(mod) { return `${__dirname}/../../../../src/${mod}`; }
|
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
const settings = require(m('node/utils/Settings'));
|
const settings = require('../../../../node/utils/Settings');
|
||||||
const supertest = require(m('node_modules/supertest'));
|
const supertest = require('supertest');
|
||||||
|
|
||||||
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
||||||
const apiKey = common.apiKey;
|
const apiKey = common.apiKey;
|
|
@ -3,10 +3,11 @@
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
const common = require('../../common');
|
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 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;
|
const apiKey = common.apiKey;
|
||||||
var apiVersion = 1;
|
var apiVersion = 1;
|
Before Width: | Height: | Size: 355 KiB After Width: | Height: | Size: 355 KiB |
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
const settings = require('../../../container/loadSettings.js').loadSettings();
|
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 api = supertest(`http://${settings.ip}:${settings.port}`);
|
||||||
const apiKey = common.apiKey;
|
const apiKey = common.apiKey;
|
|
@ -6,11 +6,11 @@
|
||||||
|
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
const superagent = require('ep_etherpad-lite/node_modules/superagent');
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('../../../../node/utils/Settings');
|
||||||
const padManager = require('ep_etherpad-lite/node/db/PadManager');
|
const superagent = require('superagent');
|
||||||
const plugins = require('ep_etherpad-lite/static/js/pluginfw/plugin_defs');
|
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 padText = fs.readFileSync('../tests/backend/specs/api/test.txt');
|
||||||
const etherpadDoc = fs.readFileSync('../tests/backend/specs/api/test.etherpad');
|
const etherpadDoc = fs.readFileSync('../tests/backend/specs/api/test.etherpad');
|
|
@ -4,8 +4,9 @@
|
||||||
* Section "GLOBAL FUNCTIONS" in src/node/db/API.js
|
* Section "GLOBAL FUNCTIONS" in src/node/db/API.js
|
||||||
*/
|
*/
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
|
const settings = require('../../../../node/utils/Settings');
|
||||||
const settings = require(`${__dirname}/../../../../src/node/utils/Settings`);
|
const supertest = require('supertest');
|
||||||
|
|
||||||
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
||||||
|
|
||||||
const apiKey = common.apiKey;
|
const apiKey = common.apiKey;
|
|
@ -5,11 +5,12 @@
|
||||||
* TODO: unify those two files, and merge in a single one.
|
* TODO: unify those two files, and merge in a single one.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
const async = require('async');
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
|
const settings = require('../../../../node/utils/Settings');
|
||||||
const settings = require(`${__dirname}/../../../../src/node/utils/Settings`);
|
const supertest = require('supertest');
|
||||||
|
|
||||||
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
||||||
const async = require(`${__dirname}/../../../../src/node_modules/async`);
|
|
||||||
|
|
||||||
const apiKey = common.apiKey;
|
const apiKey = common.apiKey;
|
||||||
let apiVersion = 1;
|
let apiVersion = 1;
|
|
@ -1,7 +1,8 @@
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
const common = require('../../common');
|
const common = require('../../common');
|
||||||
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
|
const settings = require('../../../../node/utils/Settings');
|
||||||
const settings = require(`${__dirname}/../../../../src/node/utils/Settings`);
|
const supertest = require('supertest');
|
||||||
|
|
||||||
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
||||||
|
|
||||||
const apiKey = common.apiKey;
|
const apiKey = common.apiKey;
|
|
@ -6,16 +6,16 @@ const fs = require('fs');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
let TidyHtml;
|
let TidyHtml;
|
||||||
let Settings;
|
let Settings;
|
||||||
const npm = require('ep_etherpad-lite/node_modules/npm/lib/npm.js');
|
const npm = require('npm/lib/npm.js');
|
||||||
const nodeify = require('ep_etherpad-lite/node_modules/nodeify');
|
const nodeify = require('nodeify');
|
||||||
|
|
||||||
describe(__filename, function () {
|
describe(__filename, function () {
|
||||||
describe('tidyHtml', function () {
|
describe('tidyHtml', function () {
|
||||||
before(function (done) {
|
before(function (done) {
|
||||||
npm.load({}, (err) => {
|
npm.load({}, (err) => {
|
||||||
assert.ok(!err);
|
assert.ok(!err);
|
||||||
TidyHtml = require('ep_etherpad-lite/node/utils/TidyHtml');
|
TidyHtml = require('../../../../node/utils/TidyHtml');
|
||||||
Settings = require('ep_etherpad-lite/node/utils/Settings');
|
Settings = require('../../../../node/utils/Settings');
|
||||||
return done();
|
return done();
|
||||||
});
|
});
|
||||||
});
|
});
|
|
@ -5,10 +5,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const settings = require('../../../src/node/utils/Settings');
|
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
const url = require('url');
|
const url = require('url');
|
||||||
const queryString = require('querystring');
|
const queryString = require('querystring');
|
||||||
|
const settings = require('../../../node/utils/Settings');
|
||||||
|
|
||||||
let agent;
|
let agent;
|
||||||
|
|
|
@ -9,10 +9,10 @@
|
||||||
* If you add tests here, please also add them to importexport.js
|
* 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 assert = require('assert').strict;
|
||||||
const cheerio = require('ep_etherpad-lite/node_modules/cheerio');
|
const cheerio = require('cheerio');
|
||||||
const contentcollector = require('ep_etherpad-lite/static/js/contentcollector');
|
const contentcollector = require('../../../static/js/contentcollector');
|
||||||
|
|
||||||
const tests = {
|
const tests = {
|
||||||
nestedLi: {
|
nestedLi: {
|
|
@ -1,9 +1,9 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
|
const hooks = require('../../../static/js/pluginfw/hooks');
|
||||||
const plugins = require('ep_etherpad-lite/static/js/pluginfw/plugin_defs');
|
const plugins = require('../../../static/js/pluginfw/plugin_defs');
|
||||||
const sinon = require('ep_etherpad-lite/node_modules/sinon');
|
const sinon = require('sinon');
|
||||||
|
|
||||||
describe(__filename, function () {
|
describe(__filename, function () {
|
||||||
const hookName = 'testHook';
|
const hookName = 'testHook';
|
|
@ -1,7 +1,5 @@
|
||||||
function m(mod) { return `${__dirname}/../../../src/${mod}`; }
|
|
||||||
|
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
const promises = require(m('node/utils/promises'));
|
const promises = require('../../../node/utils/promises');
|
||||||
|
|
||||||
describe(__filename, function () {
|
describe(__filename, function () {
|
||||||
describe('promises.timesLimit', function () {
|
describe('promises.timesLimit', function () {
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const io = require('ep_etherpad-lite/node_modules/socket.io-client');
|
const io = require('socket.io-client');
|
||||||
const padManager = require('ep_etherpad-lite/node/db/PadManager');
|
const padManager = require('../../../node/db/PadManager');
|
||||||
const plugins = require('ep_etherpad-lite/static/js/pluginfw/plugin_defs');
|
const plugins = require('../../../static/js/pluginfw/plugin_defs');
|
||||||
const setCookieParser = require('ep_etherpad-lite/node_modules/set-cookie-parser');
|
const setCookieParser = require('set-cookie-parser');
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('../../../node/utils/Settings');
|
||||||
|
|
||||||
const logger = common.logger;
|
const logger = common.logger;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('../../../node/utils/Settings');
|
||||||
|
|
||||||
describe(__filename, function () {
|
describe(__filename, function () {
|
||||||
let agent;
|
let agent;
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
const assert = require('assert').strict;
|
const assert = require('assert').strict;
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
const plugins = require('ep_etherpad-lite/static/js/pluginfw/plugin_defs');
|
const plugins = require('../../../static/js/pluginfw/plugin_defs');
|
||||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
const settings = require('../../../node/utils/Settings');
|
||||||
|
|
||||||
describe(__filename, function () {
|
describe(__filename, function () {
|
||||||
let agent;
|
let agent;
|
|
@ -12,11 +12,11 @@
|
||||||
* back to a default)
|
* back to a default)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const jsonminify = require(`${__dirname}/../../src/node_modules/jsonminify`);
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
|
const jsonminify = require('jsonminify');
|
||||||
|
|
||||||
function loadSettings() {
|
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 to parse the settings
|
||||||
try {
|
try {
|
||||||
if (settingsStr) {
|
if (settingsStr) {
|
|
@ -5,10 +5,10 @@
|
||||||
* TODO: unify those two files, and merge in a single one.
|
* TODO: unify those two files, and merge in a single one.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const supertest = require(`${__dirname}/../../../../src/node_modules/supertest`);
|
const settings = require('../../loadSettings').loadSettings();
|
||||||
const settings = require(`${__dirname}/../../loadSettings`).loadSettings();
|
const supertest = require('supertest');
|
||||||
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
|
||||||
|
|
||||||
|
const api = supertest(`http://${settings.ip}:${settings.port}`);
|
||||||
const apiVersion = 1;
|
const apiVersion = 1;
|
||||||
|
|
||||||
describe('Connectivity', function () {
|
describe('Connectivity', function () {
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue