Skip to content

Commit 046db31

Browse files
Merge pull request #80 from gemini-testing/TESTPLANE-645.docs
docs: add reuseExisting docs
2 parents 457e4e9 + 3ac110b commit 046db31

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
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+
13+
</Admonition>
14+
715
## Example Usage {#example}
816

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

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

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

80103
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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
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+
13+
</Admonition>
14+
715
## Пример использования {#example}
816

917
<DevServerExample />
@@ -28,6 +36,15 @@ import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-e
2836
Команда для запуска dev сервера. Если не указана, dev сервер не будет запущен.
2937
</td>
3038
</tr>
39+
<tr>
40+
<td>[`reuseExisting`](#reuseexisting)</td>
41+
<td>`boolean`</td>
42+
<td>`false`</td>
43+
<td>
44+
Переиспользовать уже запущенный dev сервер вместо создания нового. Требует указания свойства "url" в секции "readinessProbe".
45+
Эта проверка готовности будет использоваться для проверки того, что сервер готов к работе.
46+
</td>
47+
</tr>
3148
<tr>
3249
<td>[`env`](#env)</td>
3350
<td>`Record<string, string>`</td>
@@ -75,6 +92,12 @@ import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-e
7592

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

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

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

0 commit comments

Comments
 (0)