Test File Format
Specification of .gctf files for the Rust CLI.
Think of a .gctf file as: target + input + expected outcome.
Minimal Example
php
--- ADDRESS ---
localhost:4770
--- ENDPOINT ---
package.Service/Method
--- REQUEST ---
{
"id": 1
}
--- ASSERTS ---
.id == 1Supported Sections
- Core:
META,ADDRESS,ENDPOINT,REQUEST,RESPONSE,ERROR,ASSERTS - Supporting:
EXTRACT,REQUEST_HEADERS,TLS,PROTO,OPTIONS
For section details, use Section Reference.
Execution order
- Preamble sections are read first:
ADDRESS,TLS,PROTO,OPTIONS,REQUEST_HEADERS - Request/validation flow is processed in-order for each RPC interaction
- Multiple
REQUEST/RESPONSE/ASSERTSblocks are allowed depending on RPC pattern
Validation Rules
ENDPOINTis required- At least one of
RESPONSE,ERROR, orASSERTSis required RESPONSEandERRORcannot be used together in one fileADDRESSmay be omitted ifGRPCTESTIFY_ADDRESSis setMETAis optional, but only one is allowed and it must be the first section
RESPONSE Inline Options
Inline options use section-header flags and key=value pairs:
php
--- RESPONSE with_asserts partial tolerance=0.1 unordered_arrays ---
{
"status": "ok"
}Supported options for RESPONSE:
with_assertsorwith_asserts=true|falsepartialorpartial=true|falsetolerance=<number>redact=["field1","field2"]unordered_arraysorunordered_arrays=true|false
ERROR supports:
with_assertsorwith_asserts=true|falsepartialorpartial=true|false
Default ERROR matching is strict for top-level fields (code, message, details). If details is not returned by the server, it can be omitted from expected ERROR.
Quick links by section
Related: Assertions, Plugin System.