Skip to content

BDD Tests and reporting Reporting

Warning

This code is meant for testing and not to be enabled in a production setting.

Running BDD tests

cattle_grid uses a set of Gherkin tests provided by fediverse-features. They are currently configured using

fediverse-features.toml
tag = "0.1.9"

features = [
    "w3c/ap_follow.feature",
    "w3c/ap_unfollow.feature",
    "w3c/ap_follow_messaging.feature",
    "w3c/ap_block.feature",
    "w3c/ap_unblock.feature",
    "fedi/node_info.feature"
]

First download the features via

uv sync --frozen
uv run fediverse-features

Second start the docker containers and the runner

docker compose up --wait
docker compose run --rm runner

Starting the containers will take some time. The BDD tests can then be run via

uv run behave

inside the runner container.

Configuration

Reporting can be enabled by setting

cattle_grid.toml
enable_reporting = true

Generated reports are stored in the reports directory. A somewhat current set of reports is available at cattle_grid_reports.

cattle_grid.testing.reporter

Made as a tool to create reports from test runs done using behave. Basically, a scenario is run, and a markdown file is created.

Currently recorded are the step, the scenario, messages received on the incoming.# and outgoing.# routing keys of the cattle_grid exchange.

Finally, fetch results from gateway are reported.