Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,25 @@ v8-runner syntax designer-modules --server
v8-runner test yaxunit all
```

Для уже подготовленной файловой или серверной ИБ можно явно пропустить build:

```bash
v8-runner test --no-build yaxunit all
```

Для файловой ИБ этот режим до запуска 1С проверяет наличие `1Cv8.1CD`.
Проверка конфигурации не требует наличия project source-set: нужны только настройки ИБ,
платформы и выбранного test engine. Для server connection отдельный portable preflight без
запуска платформы пока недоступен, поэтому соединение проверяет сам test engine.

### Или тесты Vanessa Automation:

```bash
v8-runner test va
```

Команда сначала выполняет `build`, затем запускает настроенный профиль Vanessa Automation.
По умолчанию команда сначала выполняет `build`, затем запускает настроенный профиль Vanessa
Automation. Для подготовленной ИБ используйте `v8-runner test --no-build va`.

Для отладки и написания тестов Vanessa Automation запустите ее в режиме MCP и, если агенту нужно
сразу подключаться к endpoint, дождитесь готовности:
Expand Down
3 changes: 2 additions & 1 deletion SKILL/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ v8-runner init
- Only one source-set changed: use commands that accept `--source-set <NAME>` instead of rebuilding or materializing everything.
- Branch switch, rebase, large object moves, stale source-backed tool extension state, or suspicious incremental state: run `v8-runner build --full-rebuild`.
- Syntax check: inspect `format` and `builder`, then choose `syntax designer-modules`, `syntax designer-config`, or `syntax edt`.
- Behavior validation: run the relevant `v8-runner test ...` command; tests build first.
- Behavior validation: run the relevant `v8-runner test ...` command; tests build first unless the
caller explicitly requests `--no-build` for an already prepared infobase.
- Missing local YAxUnit, Vanessa Automation, or onec-client-mcp-devkit setup: run
`v8-runner tools download yaxunit --sources`, `v8-runner tools download vanessa`, and
`v8-runner tools download client-mcp --sources` for source-backed setup. Omit
Expand Down
7 changes: 6 additions & 1 deletion SKILL/references/testing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Testing

Use tests when behavior matters. Test commands build first, so do not run a separate `build` unless the user specifically asked for a build-only diagnosis.
Use tests when behavior matters. Test commands build first, so do not run a separate `build` unless the user specifically asked for a build-only diagnosis. For an immutable prepared infobase clone, use `test --no-build`; never infer this mode merely because a previous build appears successful.

## YaXUnit

Expand All @@ -9,6 +9,7 @@ All tests:
```bash
v8-runner test yaxunit all
v8-runner test yaxunit --full all
v8-runner test --no-build yaxunit all
```

Target one module:
Expand All @@ -26,12 +27,16 @@ Run the configured Vanessa Automation profile:

```bash
v8-runner test va
v8-runner test --no-build va
```

If the user points to a specific feature or profile, inspect `tests.va` in `v8project.yaml` before changing the command.

`test va` uses the configured `tests.va.profile`; do not invent ad hoc feature paths without updating config or using the repo's established wrapper.

`--no-build` requires an existing `1Cv8.1CD` for file infobases. Server infobases are validated by the test-engine connection because a local filesystem preflight is not possible.
This mode does not require project source-set directories or build tooling to be present; runner and platform inputs are still validated.

When driving tests through the MCP `run_all_tests` tool, pass `runner: "vanessa"` plus optional `profile`, `feature`, `filterTag`, `ignoreTag`, or `scenarioFilter`; do not use the default YaXUnit runner for functional `.feature` acceptance scenarios.

`tests.va.fail_fast` defaults to `false`.
Expand Down
18 changes: 12 additions & 6 deletions docs/CAPABILITIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ CLI help, доверяйте текущему коду и затем синхр
| `extensions` | `format=DESIGNER` или `format=EDT` | Обновляет свойства extension `source-set` |
| `build` | `format=DESIGNER` + `builder=DESIGNER|IBCMD` | Выполняет incremental/full загрузку в ИБ |
| `build` | `format=EDT` + `builder=DESIGNER|IBCMD` | Экспортирует изменённые EDT `source-set`, затем грузит generated Designer output |
| `test` | Та же матрица, что и у `build` | Всегда сначала запускает `build` |
| `test` | Та же матрица, что и у `build` | По умолчанию запускает `build` |
| `test --no-build` | Подготовленная file/server ИБ; source-set и build tooling не требуются | Запускает выбранный test engine без build |
| `dump` | `format=DESIGNER` + `builder=DESIGNER` | Полная, инкрементальная или object-scoped partial выгрузка |
| `dump` | `format=DESIGNER` + `builder=IBCMD` | Полная и инкрементальная выгрузка; `partial` деградирует в incremental с warning; standalone-server state изолирован в `workPath/ibcmd-data` |
| `dump` | `format=EDT` + `builder=DESIGNER|IBCMD` | Reverse sync из ИБ через internal Designer snapshot и EDT import |
Expand Down Expand Up @@ -193,13 +194,18 @@ v8-runner build [--source-set <NAME>] [--full-rebuild]
### `test`

```bash
v8-runner test yaxunit [--full] all
v8-runner test yaxunit [--full] module <NAME>
v8-runner test va
v8-runner test va --feature login --filter-tag @smoke
v8-runner test [--full] [--no-build] yaxunit all
v8-runner test [--full] [--no-build] yaxunit module <NAME>
v8-runner test [--no-build] va
v8-runner test [--no-build] va --feature login --filter-tag @smoke
```

- Всегда сначала запускает `build`.
- По умолчанию сначала запускает `build`. `--no-build` отмечает build-step как `skipped` и
запускает тесты на подготовленной ИБ; для file connection до запуска платформы требуется
`<infobase>/1Cv8.1CD`, для server connection доступность подтверждается запуском test engine.
- В `--no-build` source-set и build tooling не проходят filesystem/layout validation: исходники
configuration могут отсутствовать. Валидация ИБ, платформы и настроек test engine сохраняется.
- `--no-build` является CLI-only контрактом; MCP `run_all_tests` сохраняет build-first поведение.
- `test yaxunit module <NAME>` требует непустое имя модуля.
- `test va` использует профиль из `tests.va.profile`; `--feature`, `--filter-tag`,
`--ignore-tag` и `--scenario-filter` переопределяют соответствующие списки выбранного профиля
Expand Down
70 changes: 70 additions & 0 deletions docs/superpowers/plans/2026-07-22-test-no-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Test Without Build Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Add an opt-in CLI test mode that runs against an already prepared infobase without building it.

**Architecture:** Map the CLI flag into a typed transport-neutral build policy. Branch in the test coordinator before artifact creation: validate a file infobase and emit a skipped build step, or execute the existing build-first path.

**Tech Stack:** Rust, clap, serde, existing execution-step and test-result models.

## Global Constraints

- Default test behavior remains build-first.
- MCP remains build-first.
- Skip mode must not invoke build/load/update operations.
- File infobases require an existing `1Cv8.1CD` marker.
- Use Result-based errors and exhaustive enum matches.

---

### Task 1: CLI and typed request policy

**Files:**
- Modify: `src/cli/args.rs`
- Modify: `src/cli/execute.rs`
- Modify: `src/use_cases/request.rs`
- Test: `tests/cli_help.rs`

**Interfaces:**
- Produces: `TestBuildPolicy::{BuildFirst, Skip}` and `TestRequest.build_policy`.

- [ ] Add a failing help test for `test --no-build`.
- [ ] Run the focused help test and confirm it fails because the flag is absent.
- [ ] Add `--no-build`, the enum, and mapping with build-first defaults for non-CLI callers.
- [ ] Run the focused help test and request-mapping tests.

### Task 2: Skip behavior and file-infobase preflight

**Files:**
- Modify: `src/use_cases/run_tests/coordinator.rs`
- Modify: `src/use_cases/run_tests/helpers.rs`
- Modify: `src/domain/test.rs`
- Test: `tests/cli_test.rs`

**Interfaces:**
- Consumes: `TestRequest.build_policy`.
- Produces: skipped `build` step or typed `infobase_unavailable` failure.

- [ ] Add failing YaXUnit tests for skipped build and missing `1Cv8.1CD`.
- [ ] Run them and confirm the missing option/behavior failures.
- [ ] Implement preflight, skipped step, and exhaustive test error mapping.
- [ ] Run the focused YaXUnit tests.
- [ ] Add a failing Vanessa no-build test, then implement only any missing shared behavior.
- [ ] Run the focused Vanessa test.

### Task 3: Documentation and verification

**Files:**
- Modify: `README.md`
- Modify: `docs/CAPABILITIES.md`
- Modify: `SKILL/SKILL.md`
- Modify: `SKILL/references/testing.md`

**Interfaces:**
- Documents the CLI-only prepared-infobase workflow and file/server distinction.

- [ ] Update user and agent guidance.
- [ ] Run formatter, focused suites, check, and diff-check.
- [ ] Run independent Rust and contract reviews; fix or explicitly waive every finding.
- [ ] Commit, push, and create the upstream PR.
38 changes: 38 additions & 0 deletions docs/superpowers/specs/2026-07-22-test-no-build-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Test Without Build Design

## Goal

Allow CLI users to run YaXUnit or Vanessa Automation against a prepared infobase without invoking the build pipeline.

## Contract

`v8-runner test --no-build yaxunit all` and `v8-runner test --no-build va` select a typed `TestBuildPolicy::Skip`. The default remains `TestBuildPolicy::BuildFirst`. MCP requests keep the default and do not expose the new CLI-only option.

The result keeps a `build` execution step. In skip mode that step has status `skipped` and a stable message stating that the caller explicitly skipped the prerequisite.

## Infobase preflight

For file connections, skip mode requires the configured infobase directory to contain `1Cv8.1CD`. Failure is returned before test artifacts or a platform process are created, using typed test error code `infobase_unavailable`.

Prepared-test config loading deliberately skips source-set and build-tool filesystem validation, while retaining base/work path, connection, platform, timeout, and test configuration validation. This lets immutable CI clones run after their configuration sources have been removed.

Accepted portability waiver: the current public server connection contract does not carry cluster-administration credentials or a portable non-1C management adapter, so existence of a named server infobase cannot be proven before starting 1C without introducing a false-positive TCP check or a new external dependency. Server availability therefore remains established by the test-engine connection and its typed process errors; file infobases receive the strict preflight required by this change.

Server connections cannot be proven available without contacting the server through a platform process. Skip mode therefore validates their configuration using the existing loader and lets the selected test engine establish connectivity; it does not introduce a hidden probe command.

## Components

- CLI maps `--no-build` to the typed build policy.
- The transport-neutral request owns the policy.
- The test coordinator performs file-infobase preflight or the existing build prerequisite.
- Existing step serialization reports the explicit skip.
- CLI integration tests cover YaXUnit, Vanessa, and a missing file infobase.
- README, capabilities, and repo-local skill guidance describe the workflow.

## Error handling and compatibility

Default behavior is unchanged. Skip mode never invokes build, load, or update-database operations. Missing file state returns the existing runtime CLI error class plus the new typed test error. Credentials and launch options continue through existing code paths.

## Testing

Tests first demonstrate that the option is absent. After implementation they assert no build script invocation, a skipped build step in JSON, successful YaXUnit and Vanessa execution, and failure before platform launch when `1Cv8.1CD` is missing.
5 changes: 4 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use crate::cli::execute;
use crate::cli::output::{failure_envelope, print_command_error};
use crate::command_envelope::Envelope;
use crate::config::loader::{
load_config, load_config_for_tools_download, resolve_primary_config_path,
load_config, load_config_for_prepared_test, load_config_for_tools_download,
resolve_primary_config_path,
};
use crate::output::presenter::Presenter;
use crate::output::text::{TimelineItem, TimelineStatus};
Expand Down Expand Up @@ -148,6 +149,8 @@ fn load_cli_config(
})
) {
load_config_for_tools_download(cli.config.as_deref(), cli.workdir.as_deref())
} else if matches!(&cli.command, Command::Test(args) if args.no_build) {
load_config_for_prepared_test(cli.config.as_deref(), cli.workdir.as_deref())
} else {
load_config(cli.config.as_deref(), cli.workdir.as_deref())
}
Expand Down
6 changes: 5 additions & 1 deletion src/cli/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pub enum Command {
Build(BuildArgs),
/// Apply built release artifacts to the infobase
Load(LoadArgs),
/// Build first, then run YaXUnit or Vanessa Automation tests
/// Run YaXUnit or Vanessa Automation tests, building first by default
Test(TestArgs),
/// Dump infobase state back to project files
Dump(DumpArgs),
Expand Down Expand Up @@ -246,6 +246,10 @@ pub struct TestArgs {
#[arg(long, global = true)]
pub full: bool,

/// Run tests against the configured prepared infobase without building sources first
#[arg(long, global = true)]
pub no_build: bool,

/// Client mode used for enterprise launch during test execution
#[arg(long = "client-mode", value_parser = ["designer", "thin", "thick", "ordinary"])]
pub client_mode: Option<String>,
Expand Down
51 changes: 50 additions & 1 deletion src/cli/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,18 +869,25 @@ fn map_tools_download_force(args: &ToolsDownloadArgs) -> bool {

fn map_test_request(config: &AppConfig, args: &TestArgs) -> Result<TestRequest, UseCaseError> {
let client_mode = map_test_client_mode(args.client_mode.as_deref())?;
let build_policy = if args.no_build {
crate::use_cases::request::TestBuildPolicy::Skip
} else {
crate::use_cases::request::TestBuildPolicy::BuildFirst
};
match &args.runner {
TestRunner::Yaxunit(TestYaxunitArgs { scope }) => {
let scope = map_yaxunit_scope(scope)?;
Ok(TestRequest {
execution: build_yaxunit_execution(config, &args.launch, client_mode)?,
full: args.full,
build_policy,
scope,
})
}
TestRunner::Va(_) => Ok(TestRequest {
execution: build_vanessa_execution(config, &args.launch, client_mode)?,
full: args.full,
build_policy,
scope: TestScopeRequest::All,
}),
}
Expand Down Expand Up @@ -2484,7 +2491,7 @@ mod tests {
use crate::use_cases::request::{
ArtifactsModeRequest, ClientMcpAddonRequest, ClientMcpMode, ClientMcpOptionsRequest,
DesignerClientScope, DesignerConfigCheck, DumpModeRequest, LaunchRequest,
LaunchTargetRequest, SyntaxTargetRequest, TestScopeRequest,
LaunchTargetRequest, SyntaxTargetRequest, TestBuildPolicy, TestScopeRequest,
};
use crate::use_cases::result::{UseCaseError, UseCaseErrorKind};
use crate::use_cases::workspace_lock::workspace_lock_path;
Expand All @@ -2500,6 +2507,7 @@ mod tests {
&config,
&TestArgs {
full: true,
no_build: false,
client_mode: None,
launch: TestLaunchOptionsArgs::default(),
runner: TestRunner::Yaxunit(TestYaxunitArgs {
Expand All @@ -2512,6 +2520,7 @@ mod tests {
.expect("request");

assert!(request.full);
assert_eq!(request.build_policy, TestBuildPolicy::BuildFirst);
assert_eq!(
request.scope,
TestScopeRequest::Module {
Expand All @@ -2520,6 +2529,27 @@ mod tests {
);
}

#[test]
fn maps_no_build_yaxunit_request() {
let work = tempdir().expect("tempdir");
let config = sample_config(work.path());
let request = map_test_request(
&config,
&TestArgs {
full: false,
no_build: true,
client_mode: None,
launch: TestLaunchOptionsArgs::default(),
runner: TestRunner::Yaxunit(TestYaxunitArgs {
scope: TestScope::All,
}),
},
)
.expect("request");

assert_eq!(request.build_policy, TestBuildPolicy::Skip);
}

#[test]
fn rejects_blank_test_module_request() {
let work = tempdir().expect("tempdir");
Expand All @@ -2528,6 +2558,7 @@ mod tests {
&config,
&TestArgs {
full: false,
no_build: false,
client_mode: None,
launch: TestLaunchOptionsArgs::default(),
runner: TestRunner::Yaxunit(TestYaxunitArgs {
Expand Down Expand Up @@ -2575,6 +2606,7 @@ mod tests {
&config,
&TestArgs {
full: false,
no_build: false,
client_mode: None,
launch: TestLaunchOptionsArgs::default(),
runner: TestRunner::Va(TestVaArgs::default()),
Expand All @@ -2584,8 +2616,23 @@ mod tests {

assert_eq!(request.execution.profile.kind, RunnerKind::Vanessa);
assert_eq!(request.execution.profile.id, "smoke");
assert_eq!(request.build_policy, TestBuildPolicy::BuildFirst);
assert_eq!(request.scope, TestScopeRequest::All);
assert_eq!(request.execution.timeouts.total_ms, Some(300_000));

let no_build_request = map_test_request(
&config,
&TestArgs {
full: false,
no_build: true,
client_mode: None,
launch: TestLaunchOptionsArgs::default(),
runner: TestRunner::Va(TestVaArgs::default()),
},
)
.expect("no-build request");

assert_eq!(no_build_request.build_policy, TestBuildPolicy::Skip);
}

#[test]
Expand Down Expand Up @@ -3011,6 +3058,7 @@ mod tests {
&config,
&Command::Test(TestArgs {
full: false,
no_build: false,
client_mode: None,
launch: TestLaunchOptionsArgs::default(),
runner: TestRunner::Yaxunit(TestYaxunitArgs {
Expand Down Expand Up @@ -3075,6 +3123,7 @@ mod tests {
&config,
&Command::Test(TestArgs {
full: false,
no_build: false,
client_mode: None,
launch: TestLaunchOptionsArgs::default(),
runner: TestRunner::Yaxunit(TestYaxunitArgs {
Expand Down
Loading