Attributes
Per-section execution modifiers using #[name(value)] syntax.
When to use
- Skip a section during execution (
#[skip]) - Set per-section timeout (
#[timeout(10)]) - Retry a section on failure (
#[retry(3)]) - Override display name in reports (
#[name(Login flow)])
Syntax
Attributes are placed on a separate line immediately before a section header:
php
#[skip]
--- REQUEST ---
{
"user_id": "123"
}Multiple attributes can be applied to one section:
php
#[timeout(10)]
#[retry(2)]
--- REQUEST ---
{
"query": "slow search"
}Supported attributes
| Attribute | Value | Description |
|---|---|---|
#[skip] | flag (or #[skip(true)]) | Skip this section during execution |
#[timeout(N)] | seconds | Per-section timeout for gRPC request |
#[retry(N)] | count | Retry section on failure with 100ms × attempt delay |
#[retry_delay(N)] | seconds (non-negative) | Delay between retry attempts (overrides the default 100ms × attempt backoff) |
#[no_retry] | flag (or #[no_retry(true)]) | Disable retries for this section, even if #[retry(N)]/OPTIONS.retry would otherwise apply |
#[repeat(N)] | positive integer | Re-execute this section N times in a row (e.g. re-send a REQUEST, or re-check a RESPONSE/ASSERTS, repeatedly within the same test) |
#[compression(none|gzip)] | none or gzip | Per-section compression override, same values as OPTIONS.compression |
#[name(...)] | string | Display name for this section in reports |
#[tag(...)] | comma-separated string | Test tags for --tags/--skip-tags filtering — used only when the file has no META.tags |
#[owner(...)] | string | Test owner — used only when the file has no META.owner |
#[summary(...)] | string | Human-readable test summary — used only when the file has no META.summary |
Inheritance
Attributes inherit between sections. A child section can override a parent's attribute:
php
#[timeout(30)]
--- REQUEST ---
{
"user_id": "1"
}
--- RESPONSE ---
{
"id": "1"
}
#[timeout(5)]
--- REQUEST ---
{
"user_id": "2"
}In this example:
- First
REQUESTinheritstimeout(30) - Second
REQUESToverrides withtimeout(5)
Skip behavior
#[skip] is a boolean flag. Both forms are equivalent:
php
#[skip]
--- REQUEST ---
{}php
#[skip(true)]
--- REQUEST ---
{}A skipped section is ignored during execution. The test continues with subsequent sections.
Examples
Retry flaky assertions
php
--- ENDPOINT ---
user.UserService/GetUser
#[retry(3)]
--- REQUEST ---
{
"user_id": "123"
}
--- ASSERTS ---
.status == "active"Timeout for slow endpoints
php
--- ENDPOINT ---
search.SearchService/Search
#[timeout(60)]
--- REQUEST ---
{
"query": "complex aggregation"
}Rules
- One attribute per line
- Attribute must appear on the line immediately before
--- SECTION --- - Attributes apply to the section that follows them
- Values are strings by default; numbers are parsed from the value
- Quoted strings are supported:
#[name("My Test")] - Runtime attribute naming follows snake_case (
#[retry_delay],#[no_retry])
Related
- META — file-level metadata (tags, owner, summary)
- OPTIONS — global execution options
- Runtime precedence quick map:
run: section attributes >OPTIONS> CLI runtime baseline/defaultsbench: CLI bench flags >BENCHsection > bench defaults
- Report Formats