195fbac109
CI / lint (pull_request) Successful in 40s
CI / helm (pull_request) Successful in 38s
CI / build (pull_request) Successful in 48s
CI / quality (pull_request) Successful in 1m0s
CI / typecheck (pull_request) Successful in 1m29s
CI / security (pull_request) Successful in 1m28s
CI / push-validation (pull_request) Successful in 20s
CI / unit_tests (pull_request) Successful in 5m8s
CI / docker (pull_request) Successful in 1m27s
CI / integration_tests (pull_request) Successful in 8m39s
CI / coverage (pull_request) Successful in 11m1s
CI / status-check (pull_request) Successful in 3s
Add domain-scenario Gherkin tags to all A2A, session, and CLI feature files (30 files) so tests can be filtered individually via behave. - 8 A2A feature files: @a2a tag - 7 session feature files: @session tag - 15 CLI feature files: @cli tag ISSUES CLOSED: #9124
159 lines
6.5 KiB
Gherkin
159 lines
6.5 KiB
Gherkin
@cli
|
|
Feature: Global --format flag propagation to subcommands
|
|
As a developer using the CleverAgents CLI
|
|
I want the --format flag to be a global option on the root `agents` command
|
|
So that I can set the output format once and have it apply to all subcommands
|
|
Per the specification: "The framework supports six distinct output formats,
|
|
selectable via the global --format flag."
|
|
|
|
Background:
|
|
Given the global format flag test runner is set up
|
|
|
|
# -----------------------------------------------------------------------
|
|
# Subtask 1 & 2: main_callback accepts --format and stores in ctx.obj
|
|
# -----------------------------------------------------------------------
|
|
|
|
Scenario: Global --format json flag is accepted by the root command
|
|
When I invoke the CLI with global args "--format json version"
|
|
Then the global format command should succeed
|
|
And the global format output should be valid JSON
|
|
|
|
Scenario: Global --format yaml flag is accepted by the root command
|
|
When I invoke the CLI with global args "--format yaml version"
|
|
Then the global format command should succeed
|
|
And the global format output should be valid YAML
|
|
|
|
Scenario: Global --format plain flag is accepted by the root command
|
|
When I invoke the CLI with global args "--format plain version"
|
|
Then the global format command should succeed
|
|
And the global format output should contain plain text
|
|
|
|
Scenario: Global --format rich flag is accepted by the root command
|
|
When I invoke the CLI with global args "--format rich version"
|
|
Then the global format command should succeed
|
|
|
|
Scenario: Global --format table flag is accepted by the root command
|
|
When I invoke the CLI with global args "--format table version"
|
|
Then the global format command should succeed
|
|
|
|
Scenario: Global --format color flag is accepted by the root command
|
|
When I invoke the CLI with global args "--format color version"
|
|
Then the global format command should succeed
|
|
|
|
Scenario: Global -f shorthand flag is accepted by the root command
|
|
When I invoke the CLI with global args "-f json version"
|
|
Then the global format command should succeed
|
|
And the global format output should be valid JSON
|
|
|
|
# -----------------------------------------------------------------------
|
|
# Subtask 3: version, info, diagnostics read format from global ctx.obj
|
|
# -----------------------------------------------------------------------
|
|
|
|
@tdd_issue @tdd_issue_4363 @tdd_expected_fail
|
|
Scenario: version command reads format from global ctx.obj
|
|
When I invoke the CLI with global args "--format json version"
|
|
Then the global format command should succeed
|
|
And the global format output should be valid JSON
|
|
And the global format JSON output should contain key "version"
|
|
|
|
Scenario: info command reads format from global ctx.obj
|
|
When I invoke the CLI with global args "--format json info"
|
|
Then the global format command should succeed
|
|
And the global format output should be valid JSON
|
|
|
|
Scenario: diagnostics command reads format from global ctx.obj
|
|
When I invoke the CLI with global args "--format json diagnostics"
|
|
Then the global format command should succeed
|
|
And the global format output should be valid JSON
|
|
|
|
Scenario: version command defaults to rich format when no --format given
|
|
When I invoke the CLI with global args "version"
|
|
Then the global format command should succeed
|
|
|
|
Scenario: info command defaults to rich format when no --format given
|
|
When I invoke the CLI with global args "info"
|
|
Then the global format command should succeed
|
|
|
|
Scenario: diagnostics command defaults to rich format when no --format given
|
|
When I invoke the CLI with global args "diagnostics"
|
|
Then the global format command should succeed
|
|
|
|
# -----------------------------------------------------------------------
|
|
# Subtask 4: ctx.obj["format"] is stored and accessible
|
|
# -----------------------------------------------------------------------
|
|
|
|
Scenario: ctx.obj stores the selected format value json
|
|
When I call main_callback directly with format "json"
|
|
Then the context object should have format "json"
|
|
|
|
Scenario: ctx.obj stores yaml format value
|
|
When I call main_callback directly with format "yaml"
|
|
Then the context object should have format "yaml"
|
|
|
|
Scenario: ctx.obj stores plain format value
|
|
When I call main_callback directly with format "plain"
|
|
Then the context object should have format "plain"
|
|
|
|
Scenario: ctx.obj stores rich format value (default)
|
|
When I call main_callback directly with format "rich"
|
|
Then the context object should have format "rich"
|
|
|
|
Scenario: ctx.obj stores table format value
|
|
When I call main_callback directly with format "table"
|
|
Then the context object should have format "table"
|
|
|
|
Scenario: ctx.obj stores color format value
|
|
When I call main_callback directly with format "color"
|
|
Then the context object should have format "color"
|
|
|
|
# -----------------------------------------------------------------------
|
|
# All six formats work end-to-end with version command
|
|
# -----------------------------------------------------------------------
|
|
|
|
Scenario Outline: All six formats work with the version command via global flag
|
|
When I invoke the CLI with global args "--format <format> version"
|
|
Then the global format command should succeed
|
|
|
|
Examples:
|
|
| format |
|
|
| json |
|
|
| yaml |
|
|
| plain |
|
|
| rich |
|
|
| table |
|
|
| color |
|
|
|
|
# -----------------------------------------------------------------------
|
|
# All six formats work end-to-end with info command
|
|
# -----------------------------------------------------------------------
|
|
|
|
Scenario Outline: All six formats work with the info command via global flag
|
|
When I invoke the CLI with global args "--format <format> info"
|
|
Then the global format command should succeed
|
|
|
|
Examples:
|
|
| format |
|
|
| json |
|
|
| yaml |
|
|
| plain |
|
|
| rich |
|
|
| table |
|
|
| color |
|
|
|
|
# -----------------------------------------------------------------------
|
|
# All six formats work end-to-end with diagnostics command
|
|
# -----------------------------------------------------------------------
|
|
|
|
Scenario Outline: All six formats work with the diagnostics command via global flag
|
|
When I invoke the CLI with global args "--format <format> diagnostics"
|
|
Then the global format command should succeed
|
|
|
|
Examples:
|
|
| format |
|
|
| json |
|
|
| yaml |
|
|
| plain |
|
|
| rich |
|
|
| table |
|
|
| color |
|