From 3ac110b4e2829b8bd5f7a3d75eb5643309fc4fa0 Mon Sep 17 00:00:00 2001 From: Roman Kuznetsov Date: Tue, 29 Jul 2025 14:14:00 +0300 Subject: [PATCH] docs: add reuseExisting docs --- .../examples/_dev-server-example.mdx | 1 + docs/config/dev-server.mdx | 23 +++++++++++++++++++ .../current/config/dev-server.mdx | 23 +++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/docs/config/_partials/examples/_dev-server-example.mdx b/docs/config/_partials/examples/_dev-server-example.mdx index 867c091..f094a9c 100644 --- a/docs/config/_partials/examples/_dev-server-example.mdx +++ b/docs/config/_partials/examples/_dev-server-example.mdx @@ -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: { diff --git a/docs/config/dev-server.mdx b/docs/config/dev-server.mdx index d4576d7..73ba8ab 100644 --- a/docs/config/dev-server.mdx +++ b/docs/config/dev-server.mdx @@ -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. + +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. + + + ## Example Usage {#example} @@ -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. + + [`reuseExisting`](#reuseexisting) + `boolean` + `false` + + 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. + + [`env`](#env) `Record` @@ -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`. diff --git a/i18n/ru/docusaurus-plugin-content-docs/current/config/dev-server.mdx b/i18n/ru/docusaurus-plugin-content-docs/current/config/dev-server.mdx index eca79ad..26c0802 100644 --- a/i18n/ru/docusaurus-plugin-content-docs/current/config/dev-server.mdx +++ b/i18n/ru/docusaurus-plugin-content-docs/current/config/dev-server.mdx @@ -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. + +Секция devServer отвечает только за поднятие сервера. + +Стоит учитывать, что описание devServer секции не изменяет `baseUrl`, который нужно указывать правильно вручную. + + + ## Пример использования {#example} @@ -28,6 +36,15 @@ import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-e Команда для запуска dev сервера. Если не указана, dev сервер не будет запущен. + + [`reuseExisting`](#reuseexisting) + `boolean` + `false` + + Переиспользовать уже запущенный dev сервер вместо создания нового. Требует указания свойства "url" в секции "readinessProbe". + Эта проверка готовности будет использоваться для проверки того, что сервер готов к работе. + + [`env`](#env) `Record` @@ -75,6 +92,12 @@ import DevServerExample from "@site/docs/config/_partials/examples/_dev-server-e Команда для запуска dev сервера. Если не указана, dev сервер не будет запущен. +### reuseExisting {#reuseexisting} + +Переиспользовать уже запущенный dev сервер вместо создания нового. Когда эта опция включена, Testplane проверит, доступен ли сервер по указанному URL, прежде чем пытаться запустить новый. + +Эта опция требует указания свойства `url` в секции `readinessProbe`, которое будет использоваться для проверки того, что сервер готов и доступен. + ### env {#env} Переменные окружения, которые должны быть переданы процессу с dev сервером, в дополнение к `process.env` основного процесса.