Bluebook Configuration Language

Create API, integration and end-to-end tests with ease.

Bluebook Configuration Language (BCL) is heavily inspired by HCL and Terraform. It is actually a ligher version of HCL. BCL is used to write API tests and any supporting configuration for your tests.

Block syntax

Configuration blocks are used to group relevant information together. A block consists of block type, driver name, block name, and block inputs.

blockType "driver" blockName {
    inputs
}

Block type identifies configuration type, e.g. resource or variable. Different block types have different behavior when evaluated. Driver identifies runtime driver for the block type. Drivers can include things such as assertions or HTTP requests. Block name is used to uniquely identify configuration block within your test configuration. Blocks can be referenced by other blocks using interpolation syntax. Block inputs are written using expression syntax.

Expressions

BCL only understand assignment expressions. Every assignment expression starts with an identifier followed by assignment operator and a value.

identifier = "value"

Values can only be strings or lists.

Types

Strings

String values are written between double quotes:

"this is a string"

Multi-line strings can be written in shell-style "here doc" syntax.

<<<EOF
this is
a multi-line
string
EOF

Lists

List values start with [ and end with ]. List can only contain string values.

[
  "item1",
  "item2",
]

Comments

Comments can start anywhere outside strings values. Comments start with # symbol and end at the new line.

# create a new test
resource "http_test" "my_test" {
    steps = [] # a list of steps
}

# resource "http_test" "commented_out" {
# }

Interpolation syntax

Any string within an expression gets interpolated. Interpolation syntax is used for variable substitution or evaluation of built-in functions.

variable = "value ${var.my_variable}"

Above is an example of string interpolation. Anything between ${ and } will be evaluated by the interpolator. Interpolation block will be replaced with the output returned by the interpolator.

Assume that var.my_variable is set to 123. When interpolator finishes processing the string, the result is going to be:

variable = "value 123"

Interpolation always happens before driver execution.