restructure: Prefix bin/ and tests/ with src/

This is a follow-up to commit
2ea8ea1275.
This commit is contained in:
Richard Hansen 2021-02-04 18:43:27 -05:00 committed by John McLear
parent 2ea8ea1275
commit 8b28e00784
51 changed files with 182 additions and 170 deletions

View file

@ -14,7 +14,7 @@ rm -rf ${DIST}
mkdir -p ${DIST}/
rm -rf ${SRC}
rsync -a bin/deb-src/ ${SRC}/
rsync -a src/bin/deb-src/ ${SRC}/
mkdir -p ${SYSROOT}/opt/
rsync --exclude '.git' -a . ${SYSROOT}/opt/etherpad/ --delete

View file

@ -32,7 +32,7 @@ rm -f etherpad-lite-win.zip
export NODE_ENV=production
log "do a normal unix install first..."
bin/installDeps.sh || exit 1
src/bin/installDeps.sh || exit 1
log "copy the windows settings template..."
cp settings.json.template settings.json
@ -43,8 +43,7 @@ rm -rf node_modules
mv node_modules_resolved node_modules
log "download windows node..."
cd bin
wget "https://nodejs.org/dist/latest-erbium/win-x86/node.exe" -O ../node.exe
wget "https://nodejs.org/dist/latest-erbium/win-x86/node.exe" -O node.exe
log "remove git history to reduce folder size"
rm -rf .git/objects

View file

@ -7,7 +7,7 @@
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
process.on('unhandledRejection', (err) => { throw err; });
if (process.argv.length !== 2) throw new Error('Use: node bin/checkAllPads.js');
if (process.argv.length !== 2) throw new Error('Use: node src/bin/checkAllPads.js');
(async () => {
// initialize the database

View file

@ -7,7 +7,7 @@
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
process.on('unhandledRejection', (err) => { throw err; });
if (process.argv.length !== 3) throw new Error('Use: node bin/checkPad.js $PADID');
if (process.argv.length !== 3) throw new Error('Use: node src/bin/checkPad.js $PADID');
// get the padID
const padId = process.argv[2];

View file

@ -7,7 +7,7 @@
// unhandled rejection into an uncaught exception, which does cause Node.js to exit.
process.on('unhandledRejection', (err) => { throw err; });
if (process.argv.length !== 3) throw new Error('Use: node bin/checkPadDeltas.js $PADID');
if (process.argv.length !== 3) throw new Error('Use: node src/bin/checkPadDeltas.js $PADID');
// get the padID
const padId = process.argv[2];

View file

@ -1,15 +1,11 @@
#!/bin/sh
# Move to the folder where ep-lite is installed
cd "$(dirname "$0")"/..
# Move to the Etherpad base directory.
MY_DIR=$(cd "${0%/*}" && pwd -P) || exit 1
cd "${MY_DIR}/../.." || exit 1
# Source constants and useful functions
. bin/functions.sh
#Was this script started in the bin folder? if yes move out
if [ -d "../bin" ]; then
cd "../"
fi
. src/bin/functions.sh
ignoreRoot=0
for ARG in "$@"
@ -35,7 +31,7 @@ fi
rm -rf src/node_modules
#Prepare the environment
bin/installDeps.sh "$@" || exit 1
src/bin/installDeps.sh "$@" || exit 1
#Move to the node folder and start
echo "Started Etherpad..."

View file

@ -134,7 +134,7 @@ function create_builds {
git clone $ETHER_WEB_REPO
echo "Creating windows build..."
cd etherpad-lite
bin/buildForWindows.sh
src/bin/buildForWindows.sh
[[ $? != 0 ]] && echo "Aborting: Error creating build for windows" && exit 1
echo "Creating docs..."
make docs

View file

@ -15,7 +15,7 @@ pre-start script
chown $EPUSER $EPLOGS ||true
chmod 0755 $EPLOGS ||true
chown -R $EPUSER $EPHOME/var ||true
$EPHOME/bin/installDeps.sh >> $EPLOGS/error.log || { stop; exit 1; }
$EPHOME/src/bin/installDeps.sh >> $EPLOGS/error.log || { stop; exit 1; }
end script
script

View file

@ -1,13 +1,14 @@
#!/bin/sh
# Move to the folder where ep-lite is installed
cd "$(dirname "$0")"/..
# Move to the Etherpad base directory.
MY_DIR=$(cd "${0%/*}" && pwd -P) || exit 1
cd "${MY_DIR}/../.." || exit 1
# Source constants and useful functions
. bin/functions.sh
. src/bin/functions.sh
# Prepare the environment
bin/installDeps.sh || exit 1
src/bin/installDeps.sh || exit 1
echo "If you are new to debugging Node.js with Chrome DevTools, take a look at this page:"
echo "https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27"

View file

@ -72,5 +72,5 @@ Each type of heading has a description block.
Run the following from the etherpad-lite root directory:
```sh
$ node bin/doc/generate doc/index.md --format=html --template=doc/template.html > out.html
```
$ node src/bin/doc/generate doc/index.md --format=html --template=doc/template.html > out.html
```

View file

@ -9,17 +9,14 @@
set -eu
# source: https://stackoverflow.com/questions/59895/how-to-get-the-source-directory-of-a-bash-script-from-within-the-script-itself#246128
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
# Move to the Etherpad base directory.
MY_DIR=$(cd "${0%/*}" && pwd -P) || exit 1
cd "${MY_DIR}/../.." || exit 1
# Source constants and useful functions
. ${DIR}/../bin/functions.sh
. src/bin/functions.sh
echo "Running directly, without checking/installing dependencies"
# move to the base Etherpad directory. This will be necessary until Etherpad
# learns to run from arbitrary CWDs.
cd "${DIR}/.."
# run Etherpad main class
node $(compute_node_args) "${DIR}/../node_modules/ep_etherpad-lite/node/server.js" "$@"
node $(compute_node_args) "node_modules/ep_etherpad-lite/node/server.js" "$@"

View file

@ -1,10 +1,11 @@
#!/bin/sh
# Move to the folder where ep-lite is installed
cd "$(dirname "$0")"/..
# Move to the Etherpad base directory.
MY_DIR=$(cd "${0%/*}" && pwd -P) || exit 1
cd "${MY_DIR}/../.." || exit 1
# Source constants and useful functions
. bin/functions.sh
. src/bin/functions.sh
# Is node installed?
# Not checking io.js, default installation creates a symbolic link to node

View file

@ -10,7 +10,7 @@ process.on('unhandledRejection', (err) => { throw err; });
// file before using this script, just to be safe.
// 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 src/bin/migrateDirtyDBtoRealDB.js`
const dirtyDb = require('dirty');
const log4js = require('log4js');

View file

@ -6,25 +6,25 @@ This code will check your plugin for known usual issues and some suggestions for
improvements. No changes will be made to your project.
```
node bin/plugins/checkPlugin.js $PLUGIN_NAME$
node src/bin/plugins/checkPlugin.js $PLUGIN_NAME$
```
# Basic Example:
```
node bin/plugins/checkPlugin.js ep_webrtc
node src/bin/plugins/checkPlugin.js ep_webrtc
```
## Autofixing - will autofix any issues it can
```
node bin/plugins/checkPlugin.js ep_whatever autofix
node src/bin/plugins/checkPlugin.js ep_whatever autofix
```
## Autocommitting, push, npm minor patch and npm publish (highly dangerous)
```
node bin/plugins/checkPlugin.js ep_whatever autocommit
node src/bin/plugins/checkPlugin.js ep_whatever autocommit
```
# All the plugins
@ -41,7 +41,7 @@ cd ..
for dir in node_modules/ep_*; do
dir=${dir#node_modules/}
[ "$dir" != ep_etherpad-lite ] || continue
node bin/plugins/checkPlugin.js "$dir" autocommit
node src/bin/plugins/checkPlugin.js "$dir" autocommit
done
```

View file

@ -3,10 +3,10 @@
/*
* Usage -- see README.md
*
* Normal usage: node bin/plugins/checkPlugin.js ep_whatever
* Auto fix the things it can: node bin/plugins/checkPlugin.js ep_whatever autofix
* Normal usage: node src/bin/plugins/checkPlugin.js ep_whatever
* Auto fix the things it can: node src/bin/plugins/checkPlugin.js ep_whatever autofix
* Auto commit, push and publish to npm (highly dangerous):
* node bin/plugins/checkPlugin.js ep_whatever autocommit
* node src/bin/plugins/checkPlugin.js ep_whatever autocommit
*/
// As of v14, Node.js does not exit when there is an unhandled Promise rejection. Convert an
@ -118,7 +118,7 @@ fs.readdir(pluginPath, (err, rootFiles) => {
console.log('create one and set npm secret to auto publish to npm on commit');
if (autoFix) {
const npmpublish =
fs.readFileSync('bin/plugins/lib/npmpublish.yml', {encoding: 'utf8', flag: 'r'});
fs.readFileSync('src/bin/plugins/lib/npmpublish.yml', {encoding: 'utf8', flag: 'r'});
fs.mkdirSync(`${pluginPath}/.github/workflows`, {recursive: true});
fs.writeFileSync(path, npmpublish);
console.log("If you haven't already, setup autopublish for this plugin https://github.com/ether/etherpad-lite/wiki/Plugins:-Automatically-publishing-to-npm-on-commit-to-Github-Repo");
@ -134,14 +134,14 @@ fs.readdir(pluginPath, (err, rootFiles) => {
currVersionFile.substr(existingConfigLocation + 17, existingConfigLocation.length));
const reqVersionFile =
fs.readFileSync('bin/plugins/lib/npmpublish.yml', {encoding: 'utf8', flag: 'r'});
fs.readFileSync('src/bin/plugins/lib/npmpublish.yml', {encoding: 'utf8', flag: 'r'});
const reqConfigLocation = reqVersionFile.indexOf('##ETHERPAD_NPM_V=');
const reqValue =
parseInt(reqVersionFile.substr(reqConfigLocation + 17, reqConfigLocation.length));
if (!existingValue || (reqValue > existingValue)) {
const npmpublish =
fs.readFileSync('bin/plugins/lib/npmpublish.yml', {encoding: 'utf8', flag: 'r'});
fs.readFileSync('src/bin/plugins/lib/npmpublish.yml', {encoding: 'utf8', flag: 'r'});
fs.mkdirSync(`${pluginPath}/.github/workflows`, {recursive: true});
fs.writeFileSync(path, npmpublish);
}
@ -158,7 +158,7 @@ fs.readdir(pluginPath, (err, rootFiles) => {
console.log('create one and set npm secret to auto publish to npm on commit');
if (autoFix) {
const backendTests =
fs.readFileSync('bin/plugins/lib/backend-tests.yml', {encoding: 'utf8', flag: 'r'});
fs.readFileSync('src/bin/plugins/lib/backend-tests.yml', {encoding: 'utf8', flag: 'r'});
fs.mkdirSync(`${pluginPath}/.github/workflows`, {recursive: true});
fs.writeFileSync(path, backendTests);
}
@ -171,14 +171,14 @@ fs.readdir(pluginPath, (err, rootFiles) => {
currVersionFile.substr(existingConfigLocation + 17, existingConfigLocation.length));
const reqVersionFile =
fs.readFileSync('bin/plugins/lib/backend-tests.yml', {encoding: 'utf8', flag: 'r'});
fs.readFileSync('src/bin/plugins/lib/backend-tests.yml', {encoding: 'utf8', flag: 'r'});
const reqConfigLocation = reqVersionFile.indexOf('##ETHERPAD_NPM_V=');
const reqValue =
parseInt(reqVersionFile.substr(reqConfigLocation + 17, reqConfigLocation.length));
if (!existingValue || (reqValue > existingValue)) {
const backendTests =
fs.readFileSync('bin/plugins/lib/backend-tests.yml', {encoding: 'utf8', flag: 'r'});
fs.readFileSync('src/bin/plugins/lib/backend-tests.yml', {encoding: 'utf8', flag: 'r'});
fs.mkdirSync(`${pluginPath}/.github/workflows`, {recursive: true});
fs.writeFileSync(path, backendTests);
}
@ -283,7 +283,7 @@ fs.readdir(pluginPath, (err, rootFiles) => {
if (autoFix) {
console.log('Autofixing missing README.md file');
console.log('please edit the README.md file further to include plugin specific details.');
let readme = fs.readFileSync('bin/plugins/lib/README.md', {encoding: 'utf8', flag: 'r'});
let readme = fs.readFileSync('src/bin/plugins/lib/README.md', {encoding: 'utf8', flag: 'r'});
readme = readme.replace(/\[plugin_name\]/g, pluginName);
if (repository) {
const org = repository.split('/')[3];
@ -303,7 +303,7 @@ fs.readdir(pluginPath, (err, rootFiles) => {
console.log('Autofixing missing CONTRIBUTING.md file, please edit the CONTRIBUTING.md ' +
'file further to include plugin specific details.');
let contributing =
fs.readFileSync('bin/plugins/lib/CONTRIBUTING.md', {encoding: 'utf8', flag: 'r'});
fs.readFileSync('src/bin/plugins/lib/CONTRIBUTING.md', {encoding: 'utf8', flag: 'r'});
contributing = contributing.replace(/\[plugin_name\]/g, pluginName);
fs.writeFileSync(`${pluginPath}/CONTRIBUTING.md`, contributing);
}
@ -325,14 +325,16 @@ fs.readdir(pluginPath, (err, rootFiles) => {
console.warn('LICENSE.md file not found, please create');
if (autoFix) {
console.log('Autofixing missing LICENSE.md file, including Apache 2 license.');
let license = fs.readFileSync('bin/plugins/lib/LICENSE.md', {encoding: 'utf8', flag: 'r'});
let license =
fs.readFileSync('src/bin/plugins/lib/LICENSE.md', {encoding: 'utf8', flag: 'r'});
license = license.replace('[yyyy]', new Date().getFullYear());
license = license.replace('[name of copyright owner]', execSync('git config user.name'));
fs.writeFileSync(`${pluginPath}/LICENSE.md`, license);
}
}
let travisConfig = fs.readFileSync('bin/plugins/lib/travis.yml', {encoding: 'utf8', flag: 'r'});
let travisConfig =
fs.readFileSync('src/bin/plugins/lib/travis.yml', {encoding: 'utf8', flag: 'r'});
travisConfig = travisConfig.replace(/\[plugin_name\]/g, pluginName);
if (files.indexOf('.travis.yml') === -1) {
@ -371,7 +373,8 @@ fs.readdir(pluginPath, (err, rootFiles) => {
"ensure files aren't incorrectly commited to a repository.");
if (autoFix) {
console.log('Autofixing missing .gitignore file');
const gitignore = fs.readFileSync('bin/plugins/lib/gitignore', {encoding: 'utf8', flag: 'r'});
const gitignore =
fs.readFileSync('src/bin/plugins/lib/gitignore', {encoding: 'utf8', flag: 'r'});
fs.writeFileSync(`${pluginPath}/.gitignore`, gitignore);
}
} else {

View file

@ -113,7 +113,9 @@ Documentation should be kept up-to-date. This means, whenever you add a new API
You can build the docs e.g. produce html, using `make docs`. At some point in the future we will provide an online documentation. The current documentation in the github wiki should always reflect the state of `master` (!), since there are no docs in master, yet.
## Testing
Front-end tests are found in the `tests/frontend/` folder in the repository. Run them by pointing your browser to `<yourdomainhere>/tests/frontend`.
Front-end tests are found in the `src/tests/frontend/` folder in the repository.
Run them by pointing your browser to `<yourdomainhere>/tests/frontend`.
Back-end tests can be run from the `src` directory, via `npm test`.

View file

@ -30,7 +30,7 @@ jobs:
repository: ether/etherpad-lite
- name: Install all dependencies and symlink for ep_etherpad-lite
run: bin/installDeps.sh
run: src/bin/installDeps.sh
# clone this repository into node_modules/ep_plugin-name
- name: Checkout plugin repository
@ -45,7 +45,7 @@ jobs:
# configures some settings and runs npm run test
- name: Run the backend tests
run: tests/frontend/travis/runnerBackend.sh
run: src/tests/frontend/travis/runnerBackend.sh
##ETHERPAD_NPM_V=1
## NPM configuration automatically created using bin/plugins/updateAllPluginsScript.sh
## NPM configuration automatically created using src/bin/plugins/updateAllPluginsScript.sh

View file

@ -80,4 +80,4 @@ jobs:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
##ETHERPAD_NPM_V=2
## NPM configuration automatically created using bin/plugins/updateAllPluginsScript.sh
## NPM configuration automatically created using src/bin/plugins/updateAllPluginsScript.sh

View file

@ -12,7 +12,7 @@ install:
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
#script:
# - "tests/frontend/travis/runner.sh"
# - "src/tests/frontend/travis/runner.sh"
env:
global:
@ -40,14 +40,14 @@ jobs:
- "cd etherpad"
- "mkdir -p node_modules"
- "mv ../[plugin_name] node_modules"
- "bin/installDeps.sh"
- "src/bin/installDeps.sh"
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
- "cd src && npm install && cd -"
script:
- "tests/frontend/travis/runnerBackend.sh"
- "src/tests/frontend/travis/runnerBackend.sh"
- name: "Test the Frontend"
before_script:
- "tests/frontend/travis/sauce_tunnel.sh"
- "src/tests/frontend/travis/sauce_tunnel.sh"
install:
- "npm install"
- "mkdir [plugin_name]"
@ -56,10 +56,10 @@ jobs:
- "cd etherpad"
- "mkdir -p node_modules"
- "mv ../[plugin_name] node_modules"
- "bin/installDeps.sh"
- "src/bin/installDeps.sh"
- "export GIT_HASH=$(git rev-parse --verify --short HEAD)"
script:
- "tests/frontend/travis/runner.sh"
- "src/tests/frontend/travis/runner.sh"
notifications:
irc:
@ -67,4 +67,4 @@ notifications:
- "irc.freenode.org#etherpad-lite-dev"
##ETHERPAD_TRAVIS_V=9
## Travis configuration automatically created using bin/plugins/updateAllPluginsScript.sh
## Travis configuration automatically created using src/bin/plugins/updateAllPluginsScript.sh

View file

@ -4,7 +4,7 @@ do
echo $dir
if [[ $dir == *"ep_"* ]]; then
if [[ $dir != "ep_etherpad-lite" ]]; then
# node bin/plugins/checkPlugin.js $dir autofix autocommit autoupdate
# node src/bin/plugins/checkPlugin.js $dir autofix autocommit autoupdate
cd node_modules/$dir
git commit -m "Automatic update: bump update to re-run latest Etherpad tests" --allow-empty
git push origin master

View file

@ -10,7 +10,7 @@ do
# echo $0
if [[ $dir == *"ep_"* ]]; then
if [[ $dir != "ep_etherpad-lite" ]]; then
node bin/plugins/checkPlugin.js $dir autofix autocommit autoupdate
node src/bin/plugins/checkPlugin.js $dir autofix autocommit autoupdate
fi
fi
# echo $dir

View file

@ -5,5 +5,5 @@ set -e
for dir in node_modules/ep_*; do
dir=${dir#node_modules/}
[ "$dir" != ep_etherpad-lite ] || continue
node bin/plugins/checkPlugin.js "$dir" autofix autocommit autoupdate
node src/bin/plugins/checkPlugin.js "$dir" autofix autocommit autoupdate
done

View file

@ -10,7 +10,7 @@
process.on('unhandledRejection', (err) => { throw err; });
if (process.argv.length !== 4 && process.argv.length !== 5) {
throw new Error('Use: node bin/repairPad.js $PADID $REV [$NEWPADID]');
throw new Error('Use: node src/bin/repairPad.js $PADID $REV [$NEWPADID]');
}
const padId = process.argv[2];

View file

@ -12,10 +12,11 @@ const semver = require('semver');
Usage
node bin/release.js patch
node src/bin/release.js patch
*/
const usage = 'node bin/release.js [patch/minor/major] -- example: "node bin/release.js patch"';
const usage =
'node src/bin/release.js [patch/minor/major] -- example: "node src/bin/release.js patch"';
const release = process.argv[2];

View file

@ -10,7 +10,7 @@ process.on('unhandledRejection', (err) => { throw err; });
console.warn('WARNING: This script must not be used while etherpad is running!');
if (process.argv.length !== 3) throw new Error('Use: node bin/repairPad.js $PADID');
if (process.argv.length !== 3) throw new Error('Use: node src/bin/repairPad.js $PADID');
// get the padID
const padId = process.argv[2];

View file

@ -1,10 +1,11 @@
#!/bin/sh
# Move to the folder where ep-lite is installed
cd "$(dirname "$0")"/..
# Move to the Etherpad base directory.
MY_DIR=$(cd "${0%/*}" && pwd -P) || exit 1
cd "${MY_DIR}/../.." || exit 1
# Source constants and useful functions
. bin/functions.sh
. src/bin/functions.sh
ignoreRoot=0
for ARG in "$@"; do
@ -26,7 +27,7 @@ EOF
fi
# Prepare the environment
bin/installDeps.sh "$@" || exit 1
src/bin/installDeps.sh "$@" || exit 1
# Move to the node folder and start
log "Starting Etherpad..."

View file

@ -23,8 +23,9 @@ fatal() { error "$@"; exit 1; }
LAST_EMAIL_SEND=0
# Move to the folder where ep-lite is installed
cd "$(dirname "$0")"/..
# Move to the Etherpad base directory.
MY_DIR=$(try cd "${0%/*}" && try pwd -P) || exit 1
try cd "${MY_DIR}/../.."
# Check if a logfile parameter is set
LOG="$1"
@ -39,7 +40,7 @@ while true; do
[ -w "${LOG}" ] || fatal "Logfile '${LOG}' is not writeable"
# Start the application
bin/run.sh "$@" >>${LOG} 2>>${LOG}
src/bin/run.sh "$@" >>${LOG} 2>>${LOG}
TIME_FMT=$(date +%Y-%m-%dT%H:%M:%S%z)

View file

@ -91,4 +91,4 @@ exports.getPluginTests = async (callback) => {
return Promise.all(promises).then(() => pluginSpecs);
};
exports.getCoreTests = () => readdir('tests/frontend/specs');
exports.getCoreTests = () => readdir('src/tests/frontend/specs');

View file

@ -3,7 +3,7 @@
'use strict';
/**
* This module is started with bin/run.sh. It sets up a Express HTTP and a Socket.IO Server.
* This module is started with src/bin/run.sh. It sets up a Express HTTP and a Socket.IO Server.
* Static file Requests are answered directly from this module, Socket.IO messages are passed
* to MessageHandler and minfied requests are passed to minified.
*/

View file

@ -217,8 +217,8 @@
},
"scripts": {
"lint": "eslint .",
"test": "mocha --timeout 120000 --recursive ../tests/backend/specs ../node_modules/ep_*/static/tests/backend/specs",
"test-container": "mocha --timeout 5000 ../tests/container/specs/api"
"test": "mocha --timeout 120000 --recursive tests/backend/specs ../node_modules/ep_*/static/tests/backend/specs",
"test-container": "mocha --timeout 5000 tests/container/specs/api"
},
"version": "1.8.7",
"license": "Apache-2.0"

View file

@ -72,7 +72,8 @@ const flatten1 = (array) => array.reduce((a, b) => a.concat(b), []);
// there will be an unhandled promise rejection depending on whether the the subsequent attempt is a
// duplicate (same value or error) or different, respectively.
//
// See the tests in tests/backend/specs/hooks.js for examples of supported and prohibited behaviors.
// See the tests in src/tests/backend/specs/hooks.js for examples of supported and prohibited
// behaviors.
//
const callHookFnSync = (hook, context) => {
checkDeprecation(hook);
@ -226,7 +227,8 @@ exports.callAll = (hookName, context) => {
// effect except either an error message is logged or an Error object is thrown depending on whether
// the the subsequent attempt is a duplicate (same value or error) or different, respectively.
//
// See the tests in tests/backend/specs/hooks.js for examples of supported and prohibited behaviors.
// See the tests in src/tests/backend/specs/hooks.js for examples of supported and prohibited
// behaviors.
//
const callHookFnAsync = async (hook, context) => {
checkDeprecation(hook);

View file

@ -1,7 +1,7 @@
'use strict';
/*
* This file is copied & modified from <basedir>/tests/backend/specs/api/pad.js
* This file is copied & modified from <basedir>/src/tests/backend/specs/api/pad.js
*
* TODO: maybe unify those two files and merge in a single one.
*/
@ -60,7 +60,7 @@ describe(__filename, function () {
describe('setHTML', function () {
it('Sets the HTML of a Pad attempting to weird utf8 encoded content', function (done) {
fs.readFile('../tests/backend/specs/api/emojis.html', 'utf8', (err, html) => {
fs.readFile('tests/backend/specs/api/emojis.html', 'utf8', (err, html) => {
api.post(endPoint('setHTML'))
.send({
padID: testPadId,

View file

@ -1,7 +1,7 @@
'use strict';
/*
* ACHTUNG: there is a copied & modified version of this file in
* <basedir>/tests/container/spacs/api/pad.js
* <basedir>/src/tests/container/spacs/api/pad.js
*
* TODO: unify those two files, and merge in a single one.
*/

View file

@ -12,12 +12,12 @@ 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');
const wordDoc = fs.readFileSync('../tests/backend/specs/api/test.doc');
const wordXDoc = fs.readFileSync('../tests/backend/specs/api/test.docx');
const odtDoc = fs.readFileSync('../tests/backend/specs/api/test.odt');
const pdfDoc = fs.readFileSync('../tests/backend/specs/api/test.pdf');
const padText = fs.readFileSync(`${__dirname}/test.txt`);
const etherpadDoc = fs.readFileSync(`${__dirname}/test.etherpad`);
const wordDoc = fs.readFileSync(`${__dirname}/test.doc`);
const wordXDoc = fs.readFileSync(`${__dirname}/test.docx`);
const odtDoc = fs.readFileSync(`${__dirname}/test.odt`);
const pdfDoc = fs.readFileSync(`${__dirname}/test.pdf`);
let agent;
const apiKey = common.apiKey;

View file

@ -1,6 +1,6 @@
/*
* ACHTUNG: there is a copied & modified version of this file in
* <basedir>/tests/container/specs/api/pad.js
* <basedir>/src/tests/container/specs/api/pad.js
*
* TODO: unify those two files, and merge in a single one.
*/

View file

@ -9,12 +9,11 @@ try() { "$@" || fatal "'$@' failed"; }
[ -n "${SAUCE_USERNAME}" ] || fatal "SAUCE_USERNAME is unset - exiting"
[ -n "${SAUCE_ACCESS_KEY}" ] || fatal "SAUCE_ACCESS_KEY is unset - exiting"
MY_DIR=$(try cd "${0%/*}" && try pwd) || exit 1
# Move to the Etherpad base directory.
MY_DIR=$(try cd "${0%/*}" && try pwd -P) || exit 1
try cd "${MY_DIR}/../../../.."
# reliably move to the etherpad base folder before running it
try cd "${MY_DIR}/../../../"
log "Assuming bin/installDeps.sh has already been run"
log "Assuming src/bin/installDeps.sh has already been run"
node node_modules/ep_etherpad-lite/node/server.js --experimental-worker "${@}" &
ep_pid=$!

View file

@ -6,10 +6,9 @@ error() { log "ERROR: $@" >&2; }
fatal() { error "$@"; exit 1; }
try() { "$@" || fatal "'$@' failed"; }
MY_DIR=$(try cd "${0%/*}" && try pwd) || fatal "failed to find script directory"
# reliably move to the etherpad base folder before running it
try cd "${MY_DIR}/../../../"
# Move to the Etherpad base directory.
MY_DIR=$(try cd "${0%/*}" && try pwd -P) || exit 1
try cd "${MY_DIR}/../../../.."
try sed -e '
s!"soffice":[^,]*!"soffice": "/usr/bin/soffice"!
@ -20,7 +19,7 @@ s!"points":[^,]*!"points": 1000!
s!"loglevel":[^,]*!"loglevel": "WARN"!
' settings.json.template >settings.json
log "Assuming bin/installDeps.sh has already been run"
log "Assuming src/bin/installDeps.sh has already been run"
node node_modules/ep_etherpad-lite/node/server.js "${@}" &
ep_pid=$!

View file

@ -6,10 +6,9 @@ error() { log "ERROR: $@" >&2; }
fatal() { error "$@"; exit 1; }
try() { "$@" || fatal "'$@' failed"; }
MY_DIR=$(try cd "${0%/*}" && try pwd) || exit 1
# reliably move to the etherpad base folder before running it
try cd "${MY_DIR}/../../../"
# Move to the Etherpad base directory.
MY_DIR=$(try cd "${0%/*}" && try pwd -P) || exit 1
try cd "${MY_DIR}/../../../.."
try sed -e '
s!"loadTest":[^,]*!"loadTest": true!
@ -17,7 +16,7 @@ s!"loadTest":[^,]*!"loadTest": true!
s!"points":[^,]*!"points": 1000!
' settings.json.template >settings.json
log "Assuming bin/installDeps.sh has already been run"
log "Assuming src/bin/installDeps.sh has already been run"
node node_modules/ep_etherpad-lite/node/server.js "${@}" >/dev/null &
ep_pid=$!

View file

@ -1,4 +1,4 @@
FROM node:alpine3.12
WORKDIR /tmp
RUN npm i etherpad-cli-client
COPY ./tests/ratelimit/send_changesets.js /tmp/send_changesets.js
COPY ./src/tests/ratelimit/send_changesets.js /tmp/send_changesets.js

View file

@ -1,2 +1,2 @@
FROM nginx
COPY ./tests/ratelimit/nginx.conf /etc/nginx/nginx.conf
COPY ./src/tests/ratelimit/nginx.conf /etc/nginx/nginx.conf