Skip to content

test(hybrid): draft DISCARD reconcile on real HANA (#2909) - #2970

Merged
jung-thomas merged 1 commit into
DEVfrom
worktree-hybrid-discard-test-2909
Nov 1, 2026
Merged

jung-thomas merged 1 commit into
DEVfrom
worktree-hybrid-discard-test-2909

Conversation

@jung-thomas

Copy link
Copy Markdown
Contributor

Follow-up to #2909 / #2967 (draft_admin_integrity adoption).

Summary

Adds a committed hybrid test that proves the end-to-end behavior on real HANA: with cds.fiori.draft_admin_integrity on, discarding a Mission draft reconciles the parent rollup via the root after('DISCARD','Missions.drafts') handler. The DB cascade removes the draft CompletionPathItems child, bypassing the per-row after('DELETE') reconcile — so this is the assertion the SQLite unit test structurally cannot make.

Scenario

Active Mission → CompletionPath → CPI → tutorial. A user completed the tutorial but their MISSION TaskRecord is stale IN_PROGRESS. draftEdit the Mission → discard the draft → assert the MISSION record heals to COMPLETED.

Why committed, not run ad-hoc

The reconcile-on-discard logic already has SQLite unit coverage (12/12 in #2967). This test adds the real-HANA assertion and belongs in the post-deploy test:hybrid CI job, which has the full service bindings (incl. XSUAA).

Test robustness

  • Guarded by isSafeForWrites() — never runs against a prod DB.
  • Idempotent: supporting rows keyed by high legacyId (990901–990907, outside real-data range), pre-wiped in beforeAll and cleaned in afterAll.
  • The Mission draft is cleared via the HTTP active delete (DELETE IsActiveEntity=true), which removes draft + active together — avoiding the orphaned draft-shadow rows that a plain active-table delete leaves (the trap that makes naive draft-test cleanup non-idempotent).

Local verification note

I could not run this to green locally: like the existing test/hybrid/admin-crud.test.js, it self-skips + reports an XSUAA-binding error under a HANA-only local cds bind (verified both behave identically). It's written to the exact conventions of the existing hybrid suite and is intended to execute in the test:hybrid CI job. Reviewer: please confirm it runs green there.

Test plan

  • test:hybrid CI job (real HANA + XSUAA) — the actual bar
  • Structural parity with existing test/hybrid/* suite (harness, guard, cleanup pattern)
  • LF line endings preserved

Adds a committed hybrid test proving that, with cds.fiori.draft_admin_integrity
on, discarding a Mission draft reconciles the parent rollup via the root
after('DISCARD','Missions.drafts') handler — the cascade removes the draft
CompletionPathItems child at the DB level, bypassing the per-row after('DELETE')
reconcile, so this is the end-to-end HANA assertion the SQLite unit test cannot
make.

Runs in the post-deploy test:hybrid CI job (cds bind --exec … --project hybrid),
guarded by isSafeForWrites(). Idempotent: supporting rows keyed by high legacyId
and cleaned in afterAll; the Mission draft is cleared via the HTTP active delete
(removes draft + active together, avoiding orphaned draft-shadow rows that a
plain active-table delete would leave).
@jung-thomas
jung-thomas merged commit e41adcb into DEV Nov 1, 2026
3 of 4 checks passed
@jung-thomas
jung-thomas deleted the worktree-hybrid-discard-test-2909 branch November 1, 2026 18:07
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