Commit 34bd58f8 authored by Ivan Mazhukin's avatar Ivan Mazhukin

add vscode extension for epm docker tests

parent f88ade56
...@@ -25,6 +25,21 @@ ...@@ -25,6 +25,21 @@
./epm-docker-test.sh ayugram fedora ./epm-docker-test.sh ayugram fedora
``` ```
## VS Code
В каталоге `vscode-extension/` есть локальное расширение для запуска тестов кнопками из VS Code.
Быстрый запуск для разработки:
```text
1. Открыть vscode-extension/ в VS Code.
2. Нажать F5.
3. В открывшемся Extension Development Host открыть рабочий каталог с eepm.
4. Использовать панель EPM Test или кнопку EPM Test в статус-баре.
```
Расширение запускает `epm-docker-test.sh` в обычном терминале VS Code. Путь к скрипту, рабочий каталог, режим запуска, `--latest`, `-j`, remote/builder-настройки и избранные команды настраиваются через параметры `epmDockerTest.*`.
Запуск одного приложения сразу на нескольких системах: Запуск одного приложения сразу на нескольких системах:
```bash ```bash
......
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
]
}
]
}
# EPM Docker Test Runner
VS Code extension with buttons for `epm-docker-test.sh`.
## Use
1. Open this folder in VS Code: `vscode-extension`.
2. Press `F5` to start an Extension Development Host.
3. Open the repository with `epm-docker-test.sh` in that host.
4. Use the `EPM Test` activity bar view or the `$(beaker) EPM Test` status bar button.
The extension runs commands in a normal VS Code terminal, so the same output and prompts remain visible.
## Actions
- `Run app on systems`: asks for an app and target systems.
- `Run app preset`: asks for an app and `main`, `russian`, or `all`.
- `Run exec command`: asks for a shell command and target systems or preset.
- `Rerun last command`: repeats the last generated command.
- `Open log folder`: opens `${XDG_STATE_HOME:-$HOME/.local/state}/epm-docker-test` or the configured log root.
## Favorites
Pinned commands can be added to workspace settings:
```json
{
"epmDockerTest.favorites": [
{
"label": "ayugram main",
"app": "ayugram",
"preset": "main"
},
{
"label": "os-release fedora",
"exec": "cat /etc/os-release | head -3",
"systems": ["fedora"]
}
]
}
```
## Settings
Important settings:
- `epmDockerTest.scriptPath`: path to `epm-docker-test.sh`; empty means auto-detect.
- `epmDockerTest.workingDirectory`: command working directory.
- `epmDockerTest.defaultSystems`: default systems for app/exec runs.
- `epmDockerTest.defaultPreset`: default preset for preset runs.
- `epmDockerTest.defaultMode`: `auto`, `local`, or `remote`.
- `epmDockerTest.latest`: pass `--latest`.
- `epmDockerTest.parallelJobs`: pass `-j N` when greater than `1`.
- `epmDockerTest.eepmDir`, `epmDockerTest.eepmSource`, `epmDockerTest.remoteHost`, `epmDockerTest.remoteUser`, `epmDockerTest.builderUser`, `epmDockerTest.builderPath`, `epmDockerTest.logRoot`: map to the same script options.
{
"name": "epm-docker-test-runner",
"displayName": "EPM Docker Test Runner",
"description": "VS Code buttons for running epm-docker-test.sh test commands.",
"version": "0.1.0",
"publisher": "eter",
"engines": {
"vscode": "^1.85.0"
},
"categories": [
"Other"
],
"activationEvents": [
"onStartupFinished",
"onView:epmDockerTest.actions",
"onCommand:epmDockerTest.runQuick",
"onCommand:epmDockerTest.runApp",
"onCommand:epmDockerTest.runPreset",
"onCommand:epmDockerTest.runExec",
"onCommand:epmDockerTest.rerunLast"
],
"main": "./extension.js",
"contributes": {
"commands": [
{
"command": "epmDockerTest.runQuick",
"title": "EPM Docker Test: Run..."
},
{
"command": "epmDockerTest.runApp",
"title": "EPM Docker Test: Run App on Systems"
},
{
"command": "epmDockerTest.runPreset",
"title": "EPM Docker Test: Run App Preset"
},
{
"command": "epmDockerTest.runExec",
"title": "EPM Docker Test: Run Exec Command"
},
{
"command": "epmDockerTest.rerunLast",
"title": "EPM Docker Test: Rerun Last Command"
},
{
"command": "epmDockerTest.openLogs",
"title": "EPM Docker Test: Open Log Folder"
},
{
"command": "epmDockerTest.refresh",
"title": "EPM Docker Test: Refresh"
},
{
"command": "epmDockerTest.configure",
"title": "EPM Docker Test: Configure"
}
],
"configuration": {
"title": "EPM Docker Test",
"properties": {
"epmDockerTest.scriptPath": {
"type": "string",
"default": "",
"description": "Path to epm-docker-test.sh. Empty means auto-detect in the workspace."
},
"epmDockerTest.workingDirectory": {
"type": "string",
"default": "",
"description": "Working directory for test commands. Empty means the workspace folder or script directory."
},
"epmDockerTest.defaultSystems": {
"type": "string",
"default": "fedora",
"description": "Default systems used by Run App on Systems."
},
"epmDockerTest.defaultPreset": {
"type": "string",
"enum": [
"main",
"russian",
"all"
],
"default": "main",
"description": "Default preset used by Run App Preset."
},
"epmDockerTest.defaultMode": {
"type": "string",
"enum": [
"auto",
"local",
"remote"
],
"default": "auto",
"description": "Default runner mode."
},
"epmDockerTest.latest": {
"type": "boolean",
"default": false,
"description": "Pass --latest to epm play."
},
"epmDockerTest.parallelJobs": {
"type": "number",
"default": 0,
"minimum": 0,
"description": "Parallel jobs. 0 disables -j/--parallel, 1 runs serially, values greater than 1 pass -j N."
},
"epmDockerTest.eepmDir": {
"type": "string",
"default": "",
"description": "Optional --eepm-dir value."
},
"epmDockerTest.eepmSource": {
"type": "string",
"enum": [
"local",
"builder64"
],
"default": "local",
"description": "Value for --eepm-source."
},
"epmDockerTest.remoteHost": {
"type": "string",
"default": "",
"description": "Optional --remote-host value."
},
"epmDockerTest.remoteUser": {
"type": "string",
"default": "",
"description": "Optional --remote-user value."
},
"epmDockerTest.builderUser": {
"type": "string",
"default": "",
"description": "Optional --builder-user value."
},
"epmDockerTest.builderPath": {
"type": "string",
"default": "",
"description": "Optional --builder-path value."
},
"epmDockerTest.logRoot": {
"type": "string",
"default": "",
"description": "Optional --log-root value."
},
"epmDockerTest.additionalArgs": {
"type": "array",
"default": [],
"items": {
"type": "string"
},
"description": "Extra arguments passed before the app/exec target."
},
"epmDockerTest.favorites": {
"type": "array",
"default": [],
"description": "Pinned commands shown as buttons in the EPM Test activity view.",
"items": {
"type": "object",
"properties": {
"label": {
"type": "string"
},
"app": {
"type": "string"
},
"systems": {
"type": "array",
"items": {
"type": "string"
}
},
"preset": {
"type": "string",
"enum": [
"main",
"russian",
"all"
]
},
"exec": {
"type": "string"
},
"args": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"viewsContainers": {
"activitybar": [
{
"id": "epmDockerTest",
"title": "EPM Test",
"icon": "resources/epm-test.svg"
}
]
},
"views": {
"epmDockerTest": [
{
"id": "epmDockerTest.actions",
"name": "Actions"
}
]
},
"menus": {
"view/title": [
{
"command": "epmDockerTest.refresh",
"when": "view == epmDockerTest.actions",
"group": "navigation"
}
]
}
}
}
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#c5c5c5" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 3h6"/>
<path d="M10 3v5l-5.2 8.4A3 3 0 0 0 7.4 21h9.2a3 3 0 0 0 2.6-4.6L14 8V3"/>
<path d="M7.5 15h9"/>
<path d="M9 18h6"/>
</svg>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment