Skip to content

Moqui integration-testing reference — auth + wiring, folded into verification & QA#18

Open
patelanil wants to merge 1 commit into
mainfrom
feat/moqui-integration-testing-reference
Open

Moqui integration-testing reference — auth + wiring, folded into verification & QA#18
patelanil wants to merge 1 commit into
mainfrom
feat/moqui-integration-testing-reference

Conversation

@patelanil

Copy link
Copy Markdown
Collaborator

Why

Harvested from building an oms-test suite that replays a real Shopify order through the production sync#ShopifyOrder and asserts existing validators. Two silent failure modes cost real time and belong in the shared knowledge, not one project's memory.

What's folded (learnings 1 & 2)

1. Wiring — green ≠ ran.

  • A runtime/component/<name> with no build.gradle is invisible to Gradle (settings.gradle getDirectoryProjects() requires one). gradle test skips it — green, zero specs run.
  • A spec not in the suite's @SelectClasses never runs either. The suite class is the registry.

2. Auth in an integration test.

  • The active realm co.hotwax.auth.OfbizShiroRealm authenticates against OFBiz UserLogin, not moqui.security.UserAccount username — a UserAccount without a matching UserLogin fails with a misleading "No account found".
  • Use the demo admin hotwax.user (oms/data/JA_Demo_AJ_HCUserData.xml) with internalLoginUser (force-login, no password, no credential in the repo). Don't fabricate a per-test user.
  • Load that demo file in setupSpec so the suite is self-contained on a fresh/CI DB.
  • Plus: disableAuthz (paired) for raw entity access, and ec.message.clearErrors() per feature so a stuck error doesn't cascade into unrelated assertions.

Changes

  • New asset assets/moqui-integration-testing.md.
  • Cited from skills/moqui-verification/SKILL.md (step 5 + References) and skills/moqui-qa-technician/SKILL.md (the ultimate hollow green is a suite that ran nothing).
  • Plugin 0.9.00.9.1; README asset count corrected (was stale at 15) → 19.

Coach notes

  • Routed as sponsor-approved (Anil): "Moqui-testing reference in moqui-coding-assistant; fold 1 and 2."
  • No eval-fixture regression replay — there is no builder/QA pack or Moqui-testing fixture in the coach bench yet; the sponsor chose the plain-reference route. Flagging the gap: if we later want these regression-guarded, a builder/QA pack + fixture is the follow-up.
  • Learnings 3 (replay/non-hollow doctrine) and 4 (sync#ShopifyOrder input-shape contract) were not folded here — they land in the order-engine docs + the connector PR, per the routing table.

…rification & QA

Two silent failure modes learned building an oms-test replay suite:

1. Wiring — a component with no build.gradle is invisible to Gradle, and a spec
   absent from the suite's @SelectClasses never runs; either way 'gradle test'
   is green having run nothing. Green != ran.
2. Auth — the active realm (co.hotwax.auth.OfbizShiroRealm) authenticates against
   OFBiz UserLogin, not UserAccount username, so a UserLogin row must exist;
   'No account found' is misleading. Use the demo admin hotwax.user with
   internalLoginUser (force-login, no password), and load its demo data file in
   setupSpec so the suite is self-contained on a fresh/CI DB. Plus disableAuthz
   for raw entity access and clearErrors to stop error-cascade across features.

New asset assets/moqui-integration-testing.md; cited from moqui-verification
(step 5 + references) and moqui-qa-technician (the ultimate hollow green).
Plugin 0.9.0 -> 0.9.1; README asset count corrected to 19.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant