Repository navigation
test(hybrid): draft DISCARD reconcile on real HANA (#2909) - #2970
Merged
Merged
Conversation
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).
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_integrityon, discarding a Mission draft reconciles the parent rollup via the rootafter('DISCARD','Missions.drafts')handler. The DB cascade removes the draftCompletionPathItemschild, bypassing the per-rowafter('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
TaskRecordis staleIN_PROGRESS. draftEdit the Mission → discard the draft → assert the MISSION record heals toCOMPLETED.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:hybridCI job, which has the full service bindings (incl. XSUAA).Test robustness
isSafeForWrites()— never runs against a prod DB.legacyId(990901–990907, outside real-data range), pre-wiped inbeforeAlland cleaned inafterAll.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 localcds bind(verified both behave identically). It's written to the exact conventions of the existing hybrid suite and is intended to execute in thetest:hybridCI job. Reviewer: please confirm it runs green there.Test plan
test:hybridCI job (real HANA + XSUAA) — the actual bartest/hybrid/*suite (harness, guard, cleanup pattern)