developing-funboost-testing

Writes and runs standalone Python test scripts for funboost brokers and consumer mixins.

892|166|Updated Dec 25, 2021
One-click install
npx skills add https://github.com/ydf0509/funboost --skill developing-funboost-testing-ydf0509
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: developing-funboost-testing
Source: https://github.com/ydf0509/funboost/tree/main/.agents/skills/developing-funboost-testing
Command: npx skills add https://github.com/ydf0509/funboost --skill developing-funboost-testing-ydf0509

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires funboost.

What problem does it solve? Testing funboost consumers is tricky because consume() starts an infinite loop, so naive test scripts hang forever. This Skill provides conventions, templates, and termination strategies (timeouts, os._exit, log-file verification) so tests for brokers, mixins, and regressions actually run to completion and can be verified. ## Core Features & Use Cases - Test Script Templates: Ready-to-use Python templates for testing new broker implementations and custom consumer mixins, using zero-config brokers like SQLITE_QUEUE. - Termination Strategies: Two proven patterns—internal os._exit() with log-file capture, or external subprocess.run with timeout—plus formulas for estimating correct sleep/timeout durations. - Directory & Environment Conventions: Rules for where AI-written demos and regression tests live (tests/ai_codes/), and why PYTHONPATH must be set so funboost_config.py loads correctly. - Use Case: You added a new broker to funboost and need to verify publish/consume/ACK behavior. Use this Skill to generate a test script that pushes messages, consumes them, writes logs to a file, and exits cleanly for verification. ## Quick Start Write a funboost test script that pushes 10 messages to a SQLITE_QUEUE consumer, runs it with a timeout, and reads the log output to confirm all messages were consumed.

Frequently Asked Questions about developing-funboost-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test a funboost consumer without the script hanging forever?▼

Funboost's consume() runs an infinite loop, so tests need a termination mechanism. Either call os._exit(66) after a time.sleep() inside the script, or run it via subprocess.run with a timeout parameter that kills the process externally.

How to write a test for a new funboost broker implementation?▼

Create a standalone Python script that decorates a function with @boost and BoosterParams using your broker_kind, pushes several messages, starts consume(), then sleeps and exits. Verify success by reading the log output for expected print results and no exceptions.

Why does funboost testing require setting PYTHONPATH?▼

Funboost loads funboost_config.py via importlib from sys.path at startup. Setting PYTHONPATH to the project root puts that config on the path so Redis/RabbitMQ connections resolve; otherwise the framework falls back to localhost defaults.

Does funboost use pytest for its test suite?▼

No, funboost uses standalone Python scripts rather than pytest. Tests live in directories like tests/ai_codes/ai_demos/ for AI-written demos and tests/ai_codes/regression_testing/ for regression checks, each with its own termination logic.

Why does my funboost test pass with exit code 66 but nothing was consumed?▼

Exit code 66 only means the script survived the sleep period without crashing; it does not prove messages were consumed. You must read the console output or log files to confirm expected prints, no exception tracebacks, and matching push/consume counts.

How long should the timeout be when running a funboost test script?▼

Estimate framework startup at 5-10 seconds, then add message count divided by actual throughput (min of qps and concurrent_num divided by function duration), plus a 2-5 second buffer. Keep the total under 50 seconds.