Smoke test the administrator APIs against each database #570
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #570"
general
weight: 0.35
pacmano1
Most of the SQL behind the Administrator's screens doesn't run in any automated test. The CI fixtures under
ci/tests/deploy channels and send messages, and the server's tests of these controllers use mocks. The older database-backed tests (DataPrunerTestsand others) are Derby-only and excluded from the build. A change to a SQL map or the database layer, such as the MyBatis and HikariCP upgrade in #545, could break user management, the event or message browser, or the pruner on one database without CI noticing.This PR adds smoke tests that drive those APIs through the client against the server and database under test, so they run on all seven CI configurations.
Commits
1. Put the engine's jars first on the harness classpath.
run-harness.shsorted every jar alphabetically, so the stockjersey-proxy-client-2.22.1.jarcame beforemirth-client-core.jarandmirth-server.jar, which carry the engine's ownWebResourceFactorywith multipart support. Every multipart call from a harness test failed with "MessageBodyWriter not found … multipart/form-data", so no smoke test could, for example, save channel groups. The engine'smirth-.jarnow go first. This also lets the engine's override of a jTDS class take effect in the harness.2. Add a retrying assertion helper to the smoke test harness.
Harness.awaitAssertedruns a check every 500 ms until it passes or the harness timeout passes.awaitAssertedValuedoes the same for a check that returns the value it verified:- An
AssertionErrormeans "not yet", so the check runs again. On timeout, a newAssertionErroris thrown whose message starts with "Timed out after Ns:" followed by the last failure's message, so it says it timed out and still describes what the check saw.- A check throws
FinalAssertionErrorfor a failure that waiting can't fix. Any other exception, such as a lost connection, is thrown at once.- The value overload has its own name because a lambda that returns a value, such as
() -> count == 0, would otherwise select it silently and pass without checking anything.-
OieServer.awaitStartedandHarness.runMessagenow use it.runMessagestill stops as soon as every message is terminal. A few failure messages change wording, mainly so that timeouts say they timed out. The commit message lists them, and nothing inci/orsmoketest/parses them.3. Smoke test the administrator APIs against each database. The tests go in a new package,
org.openintegrationengine.smoketest.admin, next to the generatedcasespackage, rather than among the harness classes.SharedServer,OieServerand the members the tests call are now public. A newHarness.newChannelloads a channel fixture with a random ID and a name that includes it, so tests never collide with each other or with a channel left by an earlier run. The tests useawaitAssertedandawaitAssertedValuewherever they wait on the server. The test classes are:- UserAccountTest: create, update and remove a user; set, replace and read preferences; a failed login, then a successful one, then the last-login time.
- ChannelGroupTest, CodeTemplateLibraryTest, AlertTest, GlobalScriptsTest, ServerSettingsTest and ConfigurationMapTest: save and reload a channel group, a code template library and template, an alert, the global scripts, a server setting and the configuration map, removing or restoring each afterwards.
- EventBrowserTest: search audit events by name and attribute, and page through them.
- MessageBrowserTest: search messages by content text, metadata column, custom metadata and attachment; page; reprocess; remove.
- DataPrunerTest: run the pruner on a channel with pruning settings and check the event it records.
- DebugUsageTest: deploy with the debugger enabled and check the usage row that is reported, then deleted.
4. Remove legacy tests the smoke tests duplicate.
DonkeyEngineControllerTestsand Donkey'sMessageControllerTestsare never run by the build, and the smoke tests now cover what they check.DataPrunerTestsand the server'sMessageControllerTestsstay, because nothing here prunes messages or runs reprocessing and searches concurrently.A follow-up PR will move the existing hand-written tests (
DatabaseMetadataTest,CommandLineInterfaceTestandWebServiceListenerTest) into packages of their own, and update the smoke test README to match.Limits
Every test leaves the server as it found it, so the tests can run in any order, or twice against the same server. The pruner test prunes every channel with pruning settings, so don't run it against a server whose data matters.
Testing
./gradlew clean buildpasses.Two agent reviews checked the commits, and the first also checked for overlap with existing tests. The only overlap is incidental: the shared admin login, the channel deploys that read code templates and global scripts, and
Harness.fetchMessagelooking up messages by ID. None of the writes, searches, paging, reprocessing, pruning or usage statistics were tested before.---
Drafted with Claude Code*