Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document "processes" #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions config.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,58 @@ If the `serverUrl` is set, Testium will not try to launch its own instance of se

How long to wait for selenium to listen for requests in milliseconds.
Defaults to 90 seconds.

### processes

Testium manages a number of processes on your app's behalf (your app itself,
a proxy, chromedriver, etc). If you have any additional processes you need
started/stopped during a test run, you may add them to the `processes` section.

Example:

```json
{
"processes": {
"memcached": {
"command": "memcached",
"commandArgs": ["-u", "memcached"], // note lack of -d flag
"port": 11211,
"reuseExisting": true
}
}
}
```

The format is roughly the same as the
[configuration for `subprocess`][subp-config], but with the addition of a
`reuseExisting` property. Here are the important properties you'll certainly
need:

[subp-config]: https://github.com/testiumjs/testium-core/tree/main/lib/subprocess#usage

#### `processes.{processName}.command`

The command to run if this process needs to be started. Whatever command it
is should **not** daemonize, but should produce its output on stdout/stderr,
and not exit until killed.

#### `processes.{processName}.commandArgs`

Arguments to the `command` in an array. No globbing or expansion is done,
apart from any appeareance of `%port%` will be replaced with the manually
or automatically assigned port.

#### `processes.{processName}.port`

If no `port` is specified, a free port will be found, and will be made available
in `commandArgs` as noted above. If a `port` **is** specified, that one will
be used. If you set `reuseExisting` to `true`, you **must** specify a `port`.

#### `processes.{processName}.reuseExisting`

By default, if a process is already listening on a given port and you specify
a command which tries to listen on the same port as part of your `processes`,
it will fail. If you supply an explicit `port` and set `reuseExisting` to
`true`, then a check will be done first, and if something is already running
on that port, testium will not try to start up that process (or shut it down
when done).