Skip to content

Commit 96c2e23

Browse files
committed
docs(contributing): drop plugin-specific callout from Rules of Thumb
Replace the apache-httpd-status name-drop with a generic description of when fixture-based tests are the right choice and when container- based tests really add coverage. Plugin-specific pointers rot as the repository evolves and do not belong in a contributor-facing guide.
1 parent 2afdf01 commit 96c2e23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Checklist:
142142
* Return UNKNOWN on missing dependencies or wrong parameters.
143143
* Mainly return WARN. Only return CRIT if the operators want to or have to wake up at night. CRIT means "react immediately".
144144
* EAFP: Easier to ask for forgiveness than permission. This common Python coding style assumes the existence of valid keys or attributes and catches exceptions if the assumption proves false. This clean and fast style is characterized by the presence of many try and except statements.
145-
* **Pick the right unit-test flavor.** If the plugin parses the output of a shell command or an on-disk file, write fixture-based tests driven by `lib.lftest.run()` and a `TESTS` list. They run in a fraction of a second and cover the full `tox` / Python matrix. Only reach for container-based tests (via `lib.lftest.run_container()` and testcontainers-python) when the check has to talk to a live service that cannot realistically be captured as a fixture - a Keycloak API, a Redis instance, a web server. A plugin like [apache-httpd-status](https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/apache-httpd-status) is a good candidate for migration, because it currently fakes HTTP responses through fixtures while it could just as well be exercised against an `httpd:alpine` container with the status module enabled.
145+
* **Pick the right unit-test flavor.** If the plugin parses the output of a shell command, the body of a file, or an HTTP endpoint that returns a stable text format, write fixture-based tests driven by `lib.lftest.run()` and a `TESTS` list. They run in a fraction of a second, are fully reproducible, and cover the full `tox` / Python matrix. Only reach for container-based tests (via `lib.lftest.run_container()` and testcontainers-python) when the check's behaviour really depends on live runtime state of the service (log markers, cluster topology, write-then-read flows, version-dependent API responses that cannot be captured statically).
146146

147147

148148
### Return Codes

0 commit comments

Comments
 (0)