Skip to content

Commit bfe7632

Browse files
docs: add reuseExisting docs
1 parent 457e4e9 commit bfe7632

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

docs/config/_partials/examples/_dev-server-example.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export default {
88
devServer: {
99
command: "npm run server:dev",
1010
env: { PORT: SERVER_PORT },
11+
reuseExisting: true,
1112
readinessProbe: {
1213
url: `http://localhost:${SERVER_PORT}/health`,
1314
timeouts: {

docs/config/dev-server.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
import Admonition from "@theme/Admonition";
12
import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-example.mdx";
23

34
# devServer
45

56
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.
67

8+
<Admonition type="warning">
9+
The `devServer` section is only responsible for launching the server.
10+
11+
Keep in mind that the `devServer` configuration does not change the `baseUrl`, which must be set correctly manually.
12+
</Admonition>
13+
714
## Example Usage {#example}
815

916
<DevServerExample />
@@ -28,6 +35,15 @@ With the `devServer` section, you can run a server that tests will interact with
2835
Command to start the dev server. If not specified, the dev server will not be started.
2936
</td>
3037
</tr>
38+
<tr>
39+
<td>[`reuseExisting`](#reuseexisting)</td>
40+
<td>`boolean`</td>
41+
<td>`false`</td>
42+
<td>
43+
Reuse an existing dev server if it's already running, instead of spawning a new one. Requires setting the "url" property in "readinessProbe" section.
44+
This readiness probe will be used to verify that the server is ready.
45+
</td>
46+
</tr>
3147
<tr>
3248
<td>[`env`](#env)</td>
3349
<td>`Record<string, string>`</td>
@@ -75,6 +91,12 @@ With the `devServer` section, you can run a server that tests will interact with
7591

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

94+
### reuseExisting {#reuseexisting}
95+
96+
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.
97+
98+
This option requires setting the `url` property in the `readinessProbe` section, which will be used to verify that the server is ready and accessible.
99+
78100
### env {#env}
79101

80102
Environment variables to be passed to the dev server process, in addition to the main process's `process.env`.

i18n/ru/docusaurus-plugin-content-docs/current/config/dev-server.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
import Admonition from "@theme/Admonition";
12
import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-example.mdx";
23

34
# devServer
45

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

8+
<Admonition type="warning">
9+
Секция devServer отвечает только за поднятие сервера.
10+
11+
Стоит учитывать, что описание devServer секции не изменяет `baseUrl`, который нужно указывать правильно вручную.
12+
</Admonition>
13+
714
## Пример использования {#example}
815

916
<DevServerExample />
@@ -28,6 +35,15 @@ import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-e
2835
Команда для запуска dev сервера. Если не указана, dev сервер не будет запущен.
2936
</td>
3037
</tr>
38+
<tr>
39+
<td>[`reuseExisting`](#reuseexisting)</td>
40+
<td>`boolean`</td>
41+
<td>`false`</td>
42+
<td>
43+
Переиспользовать уже запущенный dev сервер вместо создания нового. Требует указания свойства "url" в секции "readinessProbe".
44+
Эта проверка готовности будет использоваться для проверки того, что сервер готов к работе.
45+
</td>
46+
</tr>
3147
<tr>
3248
<td>[`env`](#env)</td>
3349
<td>`Record<string, string>`</td>
@@ -75,6 +91,12 @@ import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-e
7591

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

94+
### reuseExisting {#reuseexisting}
95+
96+
Переиспользовать уже запущенный dev сервер вместо создания нового. Когда эта опция включена, Testplane проверит, доступен ли сервер по указанному URL, прежде чем пытаться запустить новый.
97+
98+
Эта опция требует указания свойства `url` в секции `readinessProbe`, которое будет использоваться для проверки того, что сервер готов и доступен.
99+
78100
### env {#env}
79101

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

0 commit comments

Comments
 (0)