Add focused txn_box comparison test - #13581
Conversation
Txn_box's documented tuple example was reported as failing to load, but its existing coverage is embedded in a broad static-file test and does not isolate either reported comparison form. This adds a replay-based regression test that loads the default txn_box root as a global plugin and verifies heterogeneous tuple selection and scalar status selection through response mutations. Fixes: apache#12335
bryancall
left a comment
There was a problem hiding this comment.
Approving. I built this locally with experimental plugins on and ran the test, and
confirmed it's doing real work rather than passing vacuously: it runs (Skipped: 0,
so the PluginExists gate isn't quietly skipping it), and it fails as expected both
when the tuple is made unmatchable (match: "example" -> "NOMATCH") and when the
config is given a parse error.
One thing that might let us close #12335 on firmer ground. The tuple form here was
already covered and passing at the 10.2.0 tag itself --
tests/gold_tests/pluginTest/txn_box/static_file/static_file.replay.yaml has the
identical with: [ upstream-rsp-status , proxy-req-path ] + as-tuple block, and
that's the snippet doc/admin-guide/plugins/txn_box/examples.en.rst literal-includes
as the documented example. No comparison-parsing changes have landed in txn_box since
10.2.0 either (that window is Coverity/ASAN/OpenSSL cleanups). So instead of "it works
on master," I think we can tell the reporter something stronger: the documented form
wasn't broken on the version they reported either, so the difference has to be in
their actual config or environment -- and we'd need the real file to get further.
Might be worth reopening just long enough to ask for it.
Two smaller notes:
-
The description says the existing coverage "does not isolate either reported
comparison form." The tuple form is isolated (and doc-linked) in static_file. What's
genuinely new here is worth calling out instead: this loads a standalone
txn_box.yamlwith the defaulttxn_box:root key viaplugin.config, whereas
static_file goes throughTxnBoxTestAndRunwithconfig_key="meta.txn_box.global".
The standalone path is what an operator actually uses, and only
prod/mTLS.txnbox.yamlotherwise touches it -- that's a good argument for this test
existing. The scalar select case is new too. -
The reporter's second snippet had no
do:under- eq: 200:- with: upstream-rsp-status select: - eq: 200
This test adds one, so that literal form is still unexercised. Probably not the
cause, but worth knowing it's untested if the issue comes back.
Txn_box's documented tuple example was reported as failing to load, but
its existing coverage is embedded in a broad static-file test and does
not isolate either reported comparison form.
This adds a replay-based regression test that loads the default txn_box
root as a global plugin and verifies heterogeneous tuple selection and
scalar status selection through response mutations.
Fixes: #12335