Commit Graph

70 Commits

Author SHA1 Message Date
Richard Hansen 6198e92706 tests: Pass `--legacy-peer-deps` flag to work around npm v7 bug
This flag is unknown to npm v6, but npm v6 silently ignores unknown
flags.
2021-02-22 03:36:12 -05:00
Richard Hansen 6163339c0d plugins: Always install plugins with `--no-save`
The npm CLI can get confused if `package.json` or `package-lock.json`
exist.
2021-02-18 19:18:59 +00:00
Richard Hansen 7dae5e3db8 tests: Use the supertest agent from `common.js` for backend tests 2021-02-16 21:13:35 -05: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 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 53ac25e9eb tests: include set title on pad in plugins 2020-11-26 14:10:10 +00:00
Richard Hansen 9abb77e899 tests: Set loglevel to WARN instead of suppressing stdout 2020-11-22 09:22:14 +00:00
Richard Hansen aa3b5d2090 tests: Fix setting loglevel to WARN
`tests/frontend/travis/runner.sh` transforms `settings.json.template`
and overwrites `settings.json`, so creating `settings.json` doesn't
have any effect. Change the Travis setup to mutate
`settings.json.template` instead of `settings.json`.
2020-11-22 09:22:14 +00:00
Richard Hansen a2cac1d849 tests: Factor out LibreOffice installation 2020-11-22 09:22:14 +00:00
webzwo0i f6aed0c9cb
Fix truncation in travis (#4479)
* log to travis every five seconds
* travis: kill etherpad process after tests
2020-11-10 06:59:50 +01:00
Richard Hansen 35f4c00dfb .travis.yml: Install ep_readonly_guest 2020-11-02 16:10:07 +00:00
webzwo0i b67c9cc136
tests: Speed up and fix travis (#4453)
Various test runner fixes.
2020-10-30 10:40:11 +00:00
Richard Hansen 6961e0e05b .travis.yml: Factor out common plugin install command 2020-10-29 15:32:32 -04:00
Richard Hansen f6516d62ef .travis.yml: Don't install ep_comments_page
The tests need work.
2020-10-29 15:32:32 -04:00
Richard Hansen 8969b6ba7f .travis.yml: Sort plugins 2020-10-29 15:32:32 -04:00
Richard Hansen ef60a4234d .travis.yml: Wrap long plugin install lines 2020-10-29 15:32:32 -04:00
John McLear d21afba45a
security: lockfile lint check (#4446) 2020-10-29 14:07:36 -04:00
John McLear b5c759cbac
tests: remove ep_webrtc for now until it's stable 2020-10-24 15:14:30 +01:00
John McLear 92d4b8b649
tests: re-enable docker tests in travis (#4395)
Thanks to node10 having better support we can re-enable these tests.
2020-10-06 14:21:09 +01:00
webzwo0i ceb09ce99a
security: Support proxy with rate limiting and include CI test coverage for nginx rev proxy (#4373)
Previously Etherpad would not pass the correct client IP address through and this caused the rate limiter to limit users behind reverse proxies.  This change allows Etherpad to use a client IP passed from a reverse proxy.

Note to devs: This header can be spoofed and spoofing the header could be used in an attack.  To mitigate additional *steps should be taken by Etherpad site admins IE doing rate limiting at proxy.*  This only really applies to large scale deployments but it's worth noting.
2020-10-01 10:39:01 +01:00
John McLear 90adc50289
tests: Include some plugins in tests (#4339)
This PR introduces testing of plugins from the ether/ organization on Github.  Each plugin is added into ``.travis``.  Frontend plugins tests are run exclusive to core tests.  Backend runs both core and plugins with core.

Including frontend core tests with plugin tests caused the session to overrun causing errors.
2020-09-26 19:41:33 +01:00
John McLear 13252c955c include hash auth in tests 2020-09-22 11:12:24 +01:00
webzwo0i 1b6a9d8be0
tests: Fix frontend tests (#4188), ugly work around for "Pad never loaded" (#4200)
* remote_runner.js: fix drain call (cf.
https://github.com/caolan/async/blob/master/CHANGELOG.md#breaking-changes)

* dont wait 30 seconds after remote_runner.js returned

* timeout frontend tests after 9.5 minutes to prevent travis from silently stop them

* log when not all tests finished

* prevent killTimeout to happen after last test

* log server messages to console

* remote_runner will take some time to setup sl, so this second is not necessary

* dont write to global mocha variable

* mochas `test end` event is not called when a before/beforeEach-hooks
failed, so we should only use pass/fail/pending-hooks for logging.
also some cruft removed

* pass test in `pending`-event handler

* remove some more cruft in tests/frontend/runner.js

* frontend tests: clarify why stats.tests and total differ

* move killTimeout to pass/fail/pending instead of `test end` to guarantee that it is run

* delete killTimeout on test end to prevent misleading log message

* unused variable

* fix regex

* unlikely edge case

* ensure `allowed test duration exceeded` message is printed for the last runner

* get rid of jquery.iframe.js, currently no support for IE<9

* retry up to 3 times when pad could not be loaded

* Call the logging code in stopSauce in a callback for `browser.quit()`.
This should fix cases like
https://app.saucelabs.com/tests/cb8225375d274cbcbb091309f5466cfd
Travis received all the logs and remote_runner.js exits, but there never
is a DELETE command for webdriver.
2020-07-28 19:57:33 +01:00
John McLear 40014d8230
Rate limit Socket IO communication - WIP (#4036)
Includes settings
    Includes i18n
    Includes a nice notification
    Disconnects on rate limit
    Includes feeding into metrics/stats
    Include console warn to server console.
2020-07-19 22:44:24 +01:00
John McLear 7b0fd4fb29
Bugfix / tests: Travis use LibreOffice PPA and fix import /export tests for good. (#4166)
Just final bits of test coverage for import/export of LibreOffice.  It turns out Travis by default installs an old LO that doesn't support PDF import.  To remedy that I use the LO PPA and also strict install the PDF import support.

Still to do in a future date is check LO exported contents includes expected strings, for now it just checks output length looks sane.
2020-07-16 10:46:45 +01:00
John McLear 8ae823032d
Bugfix: Travis parse (#4164) 2020-07-14 18:47:38 +01:00
John McLear ab8320d15b
WIP - Test Coverage: Import & Export include LibreOffice Test Coverage (#4163)
Runs on Travis
Will only run locally is ``allowAnyoneToImport`` and ``soffice`` or ``abiword`` is set.
2020-07-14 18:44:53 +01:00
John McLear 3bd81e6d01
Libreoffice travis (#4159)
* remove cruft..  ugh

* housekeeping: close stale issues

* testing installing LO first
2020-07-10 16:13:06 +01:00
John McLear 3e78b79d9d
tests: no sauce tunnel on ALL test run
Speeds up tests and removes overhead
2020-06-08 17:18:22 +01:00
John McLear 5e887c02a8
tests: Travis conditional only run frontend tests if it's not a fork. (#4097) 2020-06-08 13:51:57 +01:00
John McLear 8f8a949155 tests: travis config 2020-06-08 11:45:03 +00:00
John McLear 9b875d934f
tests: using travis conditions to decide if front end tests should be run or not. (#4094) 2020-06-08 12:39:20 +01:00
John McLear f7e73515cd tests: use sed to modify settings for loadTest 2020-05-30 20:02:40 +00:00
John McLear 2844224acb tests: backend tests tweak 2020-05-30 18:22:24 +00:00
John McLear add3b23f66 tests: load testing into core 2020-05-30 18:17:33 +00:00
John McLear 82ee1da8e7
tests: Disable all Travis Caching (#4063) 2020-05-29 21:42:44 +01:00
John McLear c6b5846172
tests: Fix backend testing which were always partially broken due to cache (#4053) 2020-05-29 13:26:34 +01:00
John McLear d8e067a5f9
tests: Resolve Gateway timeout during automated tests by adding delay after minify request
* Remove npm cache from Travis, this was causing a world of pain.
* Remove the broken line attribute tests.
* Do a HTTP get against Etherpad to begin minification.
* Wait 10 seconds after minification before running tests.
2020-05-29 12:28:31 +01:00
John McLear b1b181927d Revert "Removing ep_test_line_attrib include"
This reverts commit 9bca865b4f.
2020-05-28 12:33:57 +00:00
John McLear f775096696 Revert "Warning about Travis Cache"
This reverts commit 5208ae5ee6.
2020-05-28 12:33:44 +00:00
John McLear 5208ae5ee6
Warning about Travis Cache
Intentionally committing to develop.  We can probably revert these two commits.
2020-05-28 11:54:34 +01:00
John McLear 9bca865b4f
Removing ep_test_line_attrib include
Intentionally committing directly to develop.  Removing ep_test_line_attrib because it's breaking other tests from running.

The weird thing is even when this is removed from other branches it appears to be included.  Hopefully committing directly to develop will make things work.
2020-05-28 11:37:10 +01:00
John McLear 93180c287b
tests: in Travis, also run the backend tests
This change introduces automatic execution of the backend tests in Travis.

Implements #2351.
2020-04-03 03:27:05 +02:00
John McLear 61f0b5db0b tests: enable sauce labs tests again 2020-03-23 23:51:51 +01:00
Pierre Prinetti 92f07a544b ci: test basic application response of the docker build
Note by muxator:
This commit introduced a copied & modified version of the testing files
loadSettings.js and pad.js.

It's Christmas night, and we want to shipt this feature, so I merged it anyway,
adding a note in both the original and copied files so that hopefully someone
in the distant future is going to merge them back again.
2019-12-25 00:28:38 +01:00
Pierre Prinetti 69fd393708 ci: test the Dockerfile
Add a `Test Dockerfile` job to Travis that checks the `docker build` exit
code.
More useful tests can be added later.
2019-12-25 00:28:38 +01:00
muxator 5b4bca2c6e ci: move the existing test under a jobs section, so we can add others later
In the next commit Pierre will start adding tests for the docker build, and this
lays out the structure for doing that.
No functional changes.

The relevant TravisCI docs that motivates moving under a jobs section is
https://docs.travis-ci.com/user/build-matrix/

> There are two ways to specify multiple parallel jobs (what we call the build
> matrix) with a single .travis.yml configuration file:
>
> * combine a language-and-environment dependent set of configuration options to
>   automatically create a matrix of all possible combinations. This is called
>   matrix expansion. For example, the following configuration produces a build
>   matrix that expands to 8 individual (2 * 2 * 2) jobs
>   [...]
>
> * specify the exact combination of configurations you want in jobs.include.
>   For example, if not all of those combinations are interesting, you can
>   specify just the combinations you want
2019-12-25 00:28:38 +01:00
muxator bf0bb58c70 ci: no need to include java
The dependency on java was introduced in 2012 (c021cf52d8) to start
Sauce-Connect from sauce labs.

Probably at the time it was a runtime dependency, but it is no longer the case
today. It is possible that java was already not needed when db003a1460 changed
from downloading Sauce-Connect-latest.zip to sc-latest-linux.tar.gz.

Moreover, I am quite sure tests/frontend/travis/sauce_tunnel.sh no longer works
today, because tests/frontend/travis/sauce_tunnel.sh downloads from an url that
gives HTTP/404 now: sc-latest-linux.tar.gz if no longer a valid file name, we
would need to explicitly download a specific version.
2019-12-25 00:28:38 +01:00
muxator cffa3e0a5d ci: trivial reformatting in preparation for next commits.
This is just needed to slim up the diffs for the next commits.
Non functional changes.
2019-12-25 00:28:38 +01:00
anoy c0e257835c updated nodejs version for travisci 2018-08-27 10:52:22 +02:00