Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions docs/config/_partials/examples/_dev-server-example.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default {
devServer: {
command: "npm run server:dev",
env: { PORT: SERVER_PORT },
reuseExisting: true,
readinessProbe: {
url: `http://localhost:${SERVER_PORT}/health`,
timeouts: {
Expand Down
23 changes: 23 additions & 0 deletions docs/config/dev-server.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import Admonition from "@theme/Admonition";
import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-example.mdx";

# devServer

With the `devServer` section, you can run a server that tests will interact with. The server starts during the initialization of Testplane on the INIT event.

<Admonition type="warning">
The `devServer` section is only responsible for launching the server.

Keep in mind that the `devServer` configuration does not change the `baseUrl`, which must be set correctly manually.

</Admonition>

## Example Usage {#example}

<DevServerExample />
Expand All @@ -28,6 +36,15 @@ With the `devServer` section, you can run a server that tests will interact with
Command to start the dev server. If not specified, the dev server will not be started.
</td>
</tr>
<tr>
<td>[`reuseExisting`](#reuseexisting)</td>
<td>`boolean`</td>
<td>`false`</td>
<td>
Reuse an existing dev server if it's already running, instead of spawning a new one. Requires setting the "url" property in "readinessProbe" section.
This readiness probe will be used to verify that the server is ready.
</td>
</tr>
<tr>
<td>[`env`](#env)</td>
<td>`Record<string, string>`</td>
Expand Down Expand Up @@ -75,6 +92,12 @@ With the `devServer` section, you can run a server that tests will interact with

Command to start the dev server. If not specified, the dev server will not be started.

### reuseExisting {#reuseexisting}

Reuse an existing dev server if it's already running, instead of spawning a new one. When enabled, Testplane will check if a server is already available at the specified URL before attempting to start a new one.

This option requires setting the `url` property in the `readinessProbe` section, which will be used to verify that the server is ready and accessible.

### env {#env}

Environment variables to be passed to the dev server process, in addition to the main process's `process.env`.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import Admonition from "@theme/Admonition";
import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-example.mdx";

# devServer

С помощью секции `devServer` можно запускать сервер, на который будут ходить тесты. Запуск происходит во время инициализации Testplane на событие INIT.

<Admonition type="warning">
Секция devServer отвечает только за поднятие сервера.

Стоит учитывать, что описание devServer секции не изменяет `baseUrl`, который нужно указывать правильно вручную.

</Admonition>

## Пример использования {#example}

<DevServerExample />
Expand All @@ -28,6 +36,15 @@ import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-e
Команда для запуска dev сервера. Если не указана, dev сервер не будет запущен.
</td>
</tr>
<tr>
<td>[`reuseExisting`](#reuseexisting)</td>
<td>`boolean`</td>
<td>`false`</td>
<td>
Переиспользовать уже запущенный dev сервер вместо создания нового. Требует указания свойства "url" в секции "readinessProbe".
Эта проверка готовности будет использоваться для проверки того, что сервер готов к работе.
</td>
</tr>
<tr>
<td>[`env`](#env)</td>
<td>`Record<string, string>`</td>
Expand Down Expand Up @@ -75,6 +92,12 @@ import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-e

Команда для запуска dev сервера. Если не указана, dev сервер не будет запущен.

### reuseExisting {#reuseexisting}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

девай в доке сразу укажем, что опция devServer отвечает только за поднятие сервера. И что нужно учитывать, что baseUrl должен быть указан правильно (сейчас в доке про это ничего нет)


Переиспользовать уже запущенный dev сервер вместо создания нового. Когда эта опция включена, Testplane проверит, доступен ли сервер по указанному URL, прежде чем пытаться запустить новый.

Эта опция требует указания свойства `url` в секции `readinessProbe`, которое будет использоваться для проверки того, что сервер готов и доступен.

### env {#env}

Переменные окружения, которые должны быть переданы процессу с dev сервером, в дополнение к `process.env` основного процесса.
Expand Down