Commit graph

42 commits

Author SHA1 Message Date
Richard Hansen
8ef0860e8b
tests: Restore runnerBackend.sh (#4803)
* tests: Restore `runnerBackend.sh`

`runnerBackend.sh` was deleted in commit
7dae5e3db8 but plugins still need it
until their GitHub workflow definitions have been updated.

Co-authored-by: John McLear <john@mclear.co.uk>
2021-02-17 04:35:57 -05:00
Richard Hansen
7dae5e3db8 tests: Use the supertest agent from common.js for backend tests 2021-02-16 21:13:35 -05:00
Richard Hansen
5a91cf1b49 tests: Disable rate limiting for backend tests 2021-02-16 21:13:35 -05:00
Richard Hansen
4ae8fbc40d tests: Increase importexportGetPost.js timeouts
The tests were timing out on my machine.
2021-02-16 21:13:35 -05:00
Richard Hansen
3d2f77f75d lint: Fix ESLint errors in backend tests 2021-02-16 21:13:35 -05:00
John McLear
2e92e8e9d0 tests: frontend test button increase timeouts 2021-02-16 16:38:59 +00:00
Richard Hansen
bdd32f8915 Replace node_modules/ep_etherpad-lite with src 2021-02-16 10:35:05 +00:00
Richard Hansen
b711ff6acf import: Ajaxify pad import
This eliminates an inline script (good for Content Security Policy)
and improves the user experience.
2021-02-14 08:35:38 +00:00
John McLear
f59e0993a6
tests: test runner output HTML and CSS improvements to show duration (#4775) 2021-02-14 08:04:50 +00:00
Richard Hansen
e674d9789e
express: Change httpUptime to httpStartTime (#4777)
It's better to provide a primitive value and let the consumer of the
metric do math if desired.

Co-authored-by: John McLear <john@mclear.co.uk>
2021-02-14 07:50:10 +00:00
John McLear
e585d321f9
tests: timeouts for tests (#4773) 2021-02-13 19:00:06 +00:00
Richard Hansen
f9ec49d7ac tests: Improve /admin/settings restart test 2021-02-13 10:02:28 +00:00
Richard Hansen
09e9c36098 tests: Accept async condition functions for helper.waitFor() 2021-02-13 08:12:53 +00:00
Richard Hansen
8dca4cb16f tests: Give helper.waitFor() timeout errors a useful stack trace 2021-02-13 08:12:53 +00:00
Richard Hansen
71c1899164 tests: Asyncify tests in api.js 2021-02-13 08:12:53 +00:00
Richard Hansen
e0f499cf5a tests: Use the supertest agent from common.js for api.js 2021-02-13 08:12:53 +00:00
Richard Hansen
08124ba733 tests: Delete unnecessary describe() calls in api.js 2021-02-13 08:12:53 +00:00
Richard Hansen
fc9b22475a tests: Always call backend common.init() at startup
This provides a place to set the timeout for `common.init()` so that
individual tests don't have to.
2021-02-13 08:12:53 +00:00
Richard Hansen
6953e40c75 tests: Wait for common.init() to complete before returning 2021-02-13 08:12:53 +00:00
Richard Hansen
1c8a913411 lint: Delete unnecessary eslint-disable-line comment 2021-02-13 08:12:53 +00:00
Richard Hansen
66544be354 lint: src/tests/backend/specs/api/api.js 2021-02-13 00:46:30 -05:00
Richard Hansen
eb9d5bb470 lint: src/tests/frontend/helper.js and friends 2021-02-13 00:46:30 -05:00
Richard Hansen
8f2f6593be lint: Re-run eslint --fix 2021-02-13 00:31:36 -05:00
John McLear
fcd9adf20d
tests: admin test timeout increase, bugfix and removal of buggy test (#4762) 2021-02-12 20:04:42 +00:00
Richard Hansen
085ab452a0 chat tests: Give some time to process each of the 140 chat messages
This avoids overflowing socket.io's receive buffer.
2021-02-11 21:01:47 -05:00
Richard Hansen
020df75677 chat tests: Asyncify 2021-02-11 21:01:47 -05:00
Richard Hansen
0fae34009d chat tests: Delete unnecessary expect() 2021-02-11 21:01:47 -05:00
John McLear
cc7f11560f
Fix OL list items not increasing (#4749)
* tests: additional test coverage for OL items

* parseInt means we can do a proper check

* tests: use ol check value test for #4748
2021-02-11 13:26:37 -05:00
Richard Hansen
cb1116607e Revert "backend tests: change loglevel to WARN (#4514)"
Logging verbosity of the openapi handlers was turned down so GitHub
should be happier with INFO now. This makes it easier to troubleshoot
problems.

This reverts commit b98aaf4904.
2021-02-09 07:24:31 +00:00
Richard Hansen
714e099b2a tests: Fix accidental functions in ordered_list.js
This fixes a bug introduced in commit
e9bb2c410e.
2021-02-09 07:23:38 +00:00
Richard Hansen
e9bb2c410e tests: Fix erroneous use of waitForPromise() in ordered_list.js
`waitForPromise()` should always be used with `await` (either directly
or with a later `await` on the returned Promise). In this case,
the condition should be immediately true so `waitForPromise()` is not
the right tool here.
2021-02-08 18:24:11 +00:00
John McLear
7baa0cda02
tests: disabled checks shouldnt change behavior (#4729) 2021-02-08 11:07:07 +00:00
John McLear
2b112ac851
tests: Admin Frontend Test Coverage(#4717)
Covers all frontend admin operations, runs separated in CI.
2021-02-07 11:32:57 +00:00
Richard Hansen
294f2a251f lint: Fix bugs and style issues introduced in PR #4718
This fixes issues introduced in commit
f8a19c4527.
2021-02-07 07:51:35 +00:00
Richard Hansen
0ff8274d2e tests: Fix waitForPromise() in enter.js 2021-02-07 07:13:04 +00:00
Richard Hansen
c625c611d2 tests: delete src/tests/frontend/specs/caret.js
All of the tests in this file are commented out so this file does
nothing. We can uncomment the code and clean it up, but the approach
taken in these tests will never work: For security reasons, browsers
do not allow synthetic key events to perform the default
behavior (such as moving the carent when an arrow key is pressed).

There are two ways to test responses to navigation keys:
  * Use WebDriver to create "genuine" keyboard events.
  * Suppress the default behavior and implement caret movement
    ourselves. This is tremendously complicated, especially arrow
    up/down.
2021-02-07 07:02:23 +00:00
John McLear
1f0cb01110 tests: fix enter test 2021-02-07 07:00:12 +00:00
John McLear
f8a19c4527
lint: lint and various fixes of frontend test specs 2021-02-07 06:39:03 +00:00
John McLear
4862d6fa9c
editor: fix enter key keep line in view (#4639) 2021-02-06 19:56:59 +00:00
Richard Hansen
8b28e00784 restructure: Prefix bin/ and tests/ with src/
This is a follow-up to commit
2ea8ea1275.
2021-02-05 21:52:08 +00:00
John McLear
2ea8ea1275 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')
2021-02-04 17:15:08 -05:00
Richard Hansen
7f392e12e9 tests: Create a src/tests/ symlink that points to tests/
This makes it possible for plugin backend tests to do
`require('ep_etherpad-lite/tests/backend/common')` to access the API
key (among other things).

Eventually we probably should reverse these (move `tests/` to
`src/tests/` and make `tests/` a symlink to `src/tests/`) and move
`bin/` to `src/bin/` so that we can avoid the top-level `package.json`
mess.
2021-01-28 10:02:58 +00:00