Skip to content

Commit e7adbac

Browse files
feat(selectivity): update docs (modes, reportPath, merge-dumps)
1 parent e9bf4d2 commit e7adbac

File tree

6 files changed

+74
-9
lines changed

6 files changed

+74
-9
lines changed

docs/guides/selectivity.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ Let’s enable selectivity in a project with `chrome` and `firefox` browsers. Fo
4040

4141
```ts
4242
// testplane.config.ts
43+
import { SelectivityMode } from "testplane";
44+
4345
const DEV_SERVER_PORT = 3050;
4446

4547
export default {
@@ -53,7 +55,7 @@ export default {
5355
},
5456
},
5557
selectivity: {
56-
enabled: true,
58+
enabled: SelectivityMode.Enabled,
5759
},
5860
} satisfies import("testplane").ConfigInput;
5961
```

docs/reference/cli.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,27 @@ It also works for nested properties. Example of overriding `browsers.firefox.ses
714714
testplane path/to/mytest.js --browsers-firefox-sessions-per-browser 7
715715
```
716716
717+
## `selectivity-merge-dumps` command {#selectivity-merge-dumps}
718+
719+
This command is useful when its needed to merge selectivity dumps from multiple chunks into a single one.
720+
721+
### Usage {#usage}
722+
723+
```bash
724+
npx testplane selectivity-merge-dumps -d ./selectivity-full ./selectivity-chunk-1 ./selectivity-chunk-2 ./selectivity-chunk-3 ./selectivity-chunk-4
725+
npx testplane selectivity-merge-dumps ./selectivity-chunk-1 ./selectivity-chunk-2 ./selectivity-chunk-3 ./selectivity-chunk-4
726+
```
727+
728+
### Command options {#options}
729+
730+
You can specify destination directory with "-d" ("--destination") argument.
731+
732+
It can be omitted. In this case "testDependenciesPath" from "selectivity" config section will be used.
733+
734+
### Command arguments {#arguments}
735+
736+
List of paths to selectivity report chunks
737+
717738
### Overriding with environment variable {#overriding-env-settings}
718739
719740
To override a setting with an environment variable, convert its full path to `snake_case` and add the `testplane_` prefix.

docs/reference/config/browsers.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,9 +1038,13 @@ The section has the following parameters:
10381038
<tbody>
10391039
<tr>
10401040
<td>`enabled`</td>
1041-
<td>`boolean`</td>
1042-
<td>`false`</td>
1043-
<td>Enables selective test execution.</td>
1041+
<td>`SelectivityMode`</td>
1042+
<td>`SelectivityMode.Disabled`</td>
1043+
<td>
1044+
Available modes: `SelectivityMode.Disabled`, `SelectivityMode.Enabled`, `SelectivityMode.ReadOnly`, `SelectivityMode.WriteOnly`.
1045+
In `ReadOnly` mode unchanged tests are skipped, but selectivity dump is not updated after successful run.
1046+
In `WriteOnly` mode all tests are run, but selectivity dump is updated after successful run.
1047+
</td>
10441048
</tr>
10451049
<tr>
10461050
<td>`sourceRoot`</td>
@@ -1078,6 +1082,12 @@ The section has the following parameters:
10781082
or filters it completely if `falsy` value is returned
10791083
</td>
10801084
</tr>
1085+
<tr>
1086+
<td>`reportPath`</td>
1087+
<td>`string`</td>
1088+
<td>`""`</td>
1089+
<td>If set, selectivity JSON-report will be saved to specified file path.</td>
1090+
</tr>
10811091
</tbody>
10821092
</table>
10831093

i18n/ru/docusaurus-plugin-content-docs/current/guides/selectivity.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ export default {
4040

4141
```ts
4242
// testplane.config.ts
43+
import { SelectivityMode } from "testplane";
44+
4345
const DEV_SERVER_PORT = 3050;
4446

4547
export default {
@@ -53,7 +55,7 @@ export default {
5355
},
5456
},
5557
selectivity: {
56-
enabled: true,
58+
enabled: SelectivityMode.Enabled,
5759
},
5860
} satisfies import("testplane").ConfigInput;
5961
```

i18n/ru/docusaurus-plugin-content-docs/current/reference/cli.mdx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,26 @@ testplane path/to/mytest.js --base-url http://example.com
716716
testplane path/to/mytest.js --browsers-firefox-sessions-per-browser 7
717717
```
718718
719+
## Команда `selectivity-merge-dumps` {#selectivity-merge-dumps}
720+
721+
Эта команда полезна, когда необходимо объединить дампы селективности из нескольких частей (чанков) в один.
722+
723+
### Использование {#usage}
724+
725+
````bash
726+
npx testplane selectivity-merge-dumps -d ./selectivity-full ./selectivity-chunk-1 ./selectivity-chunk-2 ./selectivity-chunk-3 ./selectivity-chunk-4
727+
npx testplane selectivity-merge-dumps ./selectivity-chunk-1 ./selectivity-chunk-2 ./selectivity-chunk-3 ./selectivity-chunk-4
728+
729+
### Опции команды {#options}
730+
731+
Вы можете указать директорию, в которую будет записан результат, с помощью аргумента "-d" ("--destination").
732+
733+
Его можно не указывать. В этом случае будет использован "testDependenciesPath" из секции конфигурации "selectivity".
734+
735+
### Аргументы команды {#arguments}
736+
737+
Список путей к частям (чанкам) отчета селективности
738+
719739
### Переопределение с помощью переменной окружения {#overriding-env-settings}
720740
721741
Чтобы переопределить настройку с помощью переменной окружения, преобразуйте её полный путь в `snake_case` и добавьте префикс `testplane_`.
@@ -725,7 +745,7 @@ testplane path/to/mytest.js --browsers-firefox-sessions-per-browser 7
725745
```bash
726746
testplane_base_url=http://example.com testplane path/to/mytest.js
727747
testplane_browsers_firefox_sessions_per_browser=7 testplane path/to/mytest.js
728-
```
748+
````
729749
730750
Кроме переопределения значений конфигурации, существуют также две дополнительные переменные окружения: "TESTPLANE_SKIP_BROWSERS" и "TESTPLANE_SETS":
731751

i18n/ru/docusaurus-plugin-content-docs/current/reference/config/browsers.mdx

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,9 +1042,13 @@ export = {
10421042
<tbody>
10431043
<tr>
10441044
<td>`enabled`</td>
1045-
<td>`boolean`</td>
1046-
<td>`false`</td>
1047-
<td>Включает селективность запуска тестов.</td>
1045+
<td>`SelectivityMode`</td>
1046+
<td>`SelectivityMode.Disabled`</td>
1047+
<td>
1048+
Доступные режимы: `SelectivityMode.Disabled`, `SelectivityMode.Enabled`, `SelectivityMode.ReadOnly`, `SelectivityMode.WriteOnly`.
1049+
В режиме `ReadOnly`, нетронутые тесты не запускаются, но дамп селективности не обновляется после успешного запуска.
1050+
В режиме `WriteOnly` запускаются все тесты, но дамп селективности обновляетя после успешного запуска
1051+
</td>
10481052
</tr>
10491053
<tr>
10501054
<td>`sourceRoot`</td>
@@ -1081,6 +1085,12 @@ export = {
10811085
или полностью игнорирует зависимость, если возвращено `falsy` значение
10821086
</td>
10831087
</tr>
1088+
<tr>
1089+
<td>`reportPath`</td>
1090+
<td>`string`</td>
1091+
<td>`""`</td>
1092+
<td>Если указано, JSON-отчет о селективности будет сохранен в соответствующий файл.</td>
1093+
</tr>
10841094
</tbody>
10851095
</table>
10861096

0 commit comments

Comments
 (0)