Producer-Consumer Model
When you build test suites in Rumour, some requests need to generate data (like logging in to get a token), and other requests need to use that data (like fetching a profile using that token).
We call this the Producer-Consumer relationship.
1. What is a Producer?
A Producer is any request file that saves data from its response. It "produces" variables for other files to use.
- It makes an API call.
- It pulls data out of the response using the
[extract]block. - Example: A login request that saves a
tokenfrom the JSON response.
2. What is a Consumer?
A Consumer is any request file that needs data from a Producer before it can run.
- It declares a
[dependencies]block pointing to the Producer file. - It waits for the Producer to finish executing.
- It uses the extracted variables via
{{var}}. - Example: A "get user" request that needs the
tokenin its Authorization header.
What happens if a Producer fails?
If a Producer fails (for example, the API is down and returns a 500 Internal Server Error, or an assertion fails), the Consumer is suddenly missing its required data.
Instead of trying to run the Consumer and crashing with confusing "missing variable" errors, Rumour handles this gracefully: it automatically skips the Consumer entirely.
Here is an example trace of a Consumer node being skipped because its upstream Producer (bad_producer.toml) encountered a fatal HTTP 500 error:
# bad_producer.toml
[request]
method = "GET"
url = "{{base_url}}/status/500"
[assert]
status = 200
[extract]
token = "json.token"
# skipped_consumer.toml
[dependencies]
"../../producer/requests/bad_producer.toml" = "token"
[request]
method = "GET"
url = "{{base_url}}/anything"
rumour run dependency_example/consumer/requests/skipped_consumer.toml -tv
✗ FAILED: /home/bugsfounder/workspace/testing/dependency_example/producer/requests/bad_producer.toml (1043ms) - HTTP Status: Expected status 200, got 500
⏭ SKIPPED: /home/bugsfounder/workspace/testing/dependency_example/consumer/requests/skipped_consumer.toml
✗ /home/bugsfounder/workspace/testing/dependency_example/consumer/requests/skipped_consumer.toml → FAIL (0 Pass, 1 Fail, 1 Skip)
╭──────────────────────────────────────────────────────────────────────────╮
│ RUMOUR EXECUTION REPORT │
├──────────────────────────────────────────────────────────────────────────┤
│ Total Requests: 2 │
│ Successful: 0 │
│ Failed: 1 │
│ Skipped: 1 │
│ Success Rate: 0.0% │
│ Total Time: 6360ms │
╰──────────────────────────────────────────────────────────────────────────╯
✗ Failed Requests:
- /home/bugsfounder/workspace/testing/dependency_example/producer/requests/bad_producer.toml: [500]
Reason: HTTP Status: Expected status 200, got 500
Message:
Skipped Requests:
- /home/bugsfounder/workspace/testing/dependency_example/consumer/requests/skipped_consumer.toml
Actionable Recommendations:
→ Run with -H (Self-Healing) to attempt automatic recovery of failing nodes.
→ Hint: Check your variable dependencies if nodes are unexpectedly skipped.
Notice how the skipped_consumer.toml is cleanly logged as ⏭ SKIPPED in the runner, and is fully accounted for in the final RUMOUR EXECUTION REPORT table as a skipped request. This helps developers immediately isolate the true root cause (the bad_producer.toml) rather than hunting down downstream symptoms.