nick-boss-tech opened a new pull request, #5299:
URL: https://github.com/apache/solr/pull/5299

   🤖 *AI text below* 🤖 *(reviewed by Nick Shanin)*
   
   Draft status is deliberate: parts of this suite can only run under upstream 
CI, as the Limits section states. The change is complete and ready for review.
   
   Jira: [SOLR-18609](https://issues.apache.org/jira/browse/SOLR-18609). This 
work grew out of the one-line BATS fix in SOLR-18565 and the example in PR 
#5225.
   
   ## What happens today
   
   **Several packaging BATS suites assert on command output with ad-hoc shell 
comparisons that can pass when they should fail, and that hide the actual 
output when they do fail.**
   
   Suites capture command output into local variables and compare with `[[ ]]` 
tests, contrary to the repo's own guidance for these files (use `run` with 
`assert_output` / `refute_output`). A partial match can satisfy a `[[ == *...* 
]]` comparison the author intended as exact, and a failure prints the 
comparison rather than what the command produced.
   
   ## What this change does
   
   **Fourteen packaging test and helper files move to the bats-support 
assertion helpers, and a new suite covers the helpers themselves.**
   
   Assertions across the suites are converted to `run` plus `assert_output` / 
`refute_output` form, the rolling-upgrade health checks route through the 
shared `assert_healthy` helper, and the new `test_bats_assertions.bats` 
exercises the shared assertion helpers directly (including the TLS helpers: a 
connection refusal or a closed channel alone cannot satisfy a TLS assertion, a 
handshake failure can, and an unrelated TLS failure cannot satisfy a 
certificate assertion) so a broken helper fails loudly instead of silently 
passing every suite that uses it. No production code changes.
   
   ## Proof
   
   **The helper suite passes in full at the branch head, and the runnable part 
of the local BATS matrix passed in the earlier gate round; the Solr-starting 
suites and the Docker case are named as unproven in Limits, not hidden.**
   
   At head `99d4b8e68b` (rebased onto current `main`, over the merged PR 
#5193), the new `test_bats_assertions.bats` suite passes 9 of 9 on a 
contributor host. In the earlier full local gate round at the pre-rebase head, 
the legacy CLI matrix passed 55 of 62 and the PicoCLI matrix 17 of 18 on both 
JDK 21 and JDK 25, and the SSL suite passed 6 of 7, with the mTLS 
hostname-verification probe failing on a server-side unsupported-algorithm 
diagnostic; the assertion helpers that judge that probe are among the ones the 
new suite now covers directly.
   
   ## Limits
   
   **The Docker rolling-upgrade case has never run, and the Solr-starting 
suites have not been re-run at the rebased head.**
   
   No host in the contributor's pool has Docker, so the rolling-upgrade case 
can only be adjudicated by upstream CI on this PR. The suites that start a Solr 
server were run in the earlier gate round quoted above rather than at this 
rebased head; the rebase touched only the same test files, and the helper suite 
that defines the assertion semantics passes at this head. The neighboring 
PicoCLI work in PRs #5190 and #5204 is disjoint from this change except for one 
line in `test_basic_auth.bats` (their `--rootdir` spelling against this 
branch's `run -0` on the postlogs invocation), which resolves by keeping both 
edits if the branches ever rebase across each other.
   
   *Nick Shanin directed the work and takes responsibility for this 
contribution.*


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to