tests: Use streamlined server for api/casper tests.

We now use the `--streamlined` options for `run-dev.py`
when we use `test_server_running` for `test-api` and
`test-js-with-casper` (and its experimental
replacement, `test-js-with-puppeteer`).

This means we don't slow anything down with
processes like thumbor, process_fts_updates, etc.,
which aren't meaningfully exercised by these tests.

We may eventually want some tests to meaningfully
exercise those processes, and when that day comes,
we will need to add an extra argument to
`test_server_running`, probably, but until then,
we just always set `--streamlined` in that codepath.

There is actually a tool called `./tools/test-run-dev`
that we run in CI, and it will use the full mode.
It just doesn't verify much stuff--it mostly polls
the server without testing specific features.

This seems to save about 1s of the startup time on a system I use
(~10.6s -> ~9.7s).
This commit is contained in:
Steve Howell
2020-04-30 22:11:25 +00:00
committed by Tim Abbott
parent d9f8ec1fe7
commit ce55ef6e4f

View File

@@ -67,7 +67,7 @@ def test_server_running(force: bool=False, external_host: str='testserver',
update_test_databases_if_required(rebuild_test_database=True)
# Run this not through the shell, so that we have the actual PID.
run_dev_server_command = ['tools/run-dev.py', '--test']
run_dev_server_command = ['tools/run-dev.py', '--test', '--streamlined']
if force:
run_dev_server_command.append('--force')
server = subprocess.Popen(run_dev_server_command,