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

@ -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