skills/fluent-bit/testing.md
Use this guide to choose and report verification for Fluent Bit changes.
ctest --test-dir build -R <name> --output-on-failure
tests/internal for core lifecycle, accounting, parser, encoder, and
helper logic.tests/runtime for plugin-level behavior and end-to-end C test binaries.tests/integration for network protocols, downstream request generation,
fake-server behavior, and plugin behavior that is awkward to cover in CTest.The latest master revision supports building and running runtime tests on Windows. Initialize the appropriate MSVC environment, enable runtime tests, and run the focused target or CTest match for the affected component:
VsDevCmd.bat -arch=x64 for x64;VsDevCmd.bat -arch=x86 for x86;-DCMAKE_SYSTEM_NAME=Windows,
-DCMAKE_SYSTEM_VERSION=10.0, and -DCMAKE_SYSTEM_PROCESSOR=ARM64.cmake -S . -B build -DFLB_TESTS_RUNTIME=On -DFLB_TESTS_INTERNAL=On
cmake --build build --target <flb-rt-target>
ctest --test-dir build -R '^<flb-rt-target>$' --output-on-failure
The Windows unit-test CI workflow in
.github/workflows/call-windows-unit-tests.yaml enables runtime tests only for
x64. Its x86 and ARM64 jobs deliberately use FLB_TESTS_RUNTIME=Off to control
GitHub Actions running time. This restriction applies only to that CI workflow.
Do not use it to skip runtime-test builds or execution by local agents or AI
cloud builders.
When a cross-built target cannot execute on the current host, report that concrete host/toolchain limitation. Do not substitute the GitHub Actions running-time policy as the reason for skipping it.
Use ctest --test-dir build -N only to inspect registration. It does not prove
that a runtime executable was built or passed; confirm the target build and run
the focused test before claiming runtime verification.
If a touched component has a focused tests/integration scenario, run it before
closing the task. Run it once normally and once with valgrind when possible.
Default verification shape for supported platforms, including Windows:
./tests/integration/setup-venv.sh
cmake -S . -B build -DFLB_TESTS_RUNTIME=On -DFLB_TESTS_INTERNAL=On
cmake --build build -j8
tests/integration/.venv/bin/python -m pytest <focused-scenario> -q
VALGRIND=1 VALGRIND_STRICT=1 \
tests/integration/.venv/bin/python -m pytest <focused-scenario> -q
On Windows, keep FLB_TESTS_RUNTIME=On and run relevant focused runtime cases.
Valgrind is normally unavailable on Windows, so report that blocker
explicitly when the required memory-safety run cannot be performed.
Equivalent run-test wrapper shape:
cd tests/integration
./run_tests.py <focused-scenario>
./run_tests.py --valgrind --valgrind-strict <focused-scenario>
Do not silently skip required integration or valgrind coverage. Report the exact blocker, such as:
build/bin/fluent-bit;pytest or another Python dependency;valgrind;git diff --check after edits to catch whitespace problems..venv/, .pytest_cache/, results/, and __pycache__/.Include exact commands and outcomes:
Verification:
- PASS: cmake --build build -j8 --target <target>
- PASS: ctest --test-dir build -R '<regex>' --output-on-failure
- BLOCKED: VALGRIND=1 ... failed because valgrind is not installed