You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a top-level TESTING.md documenting the test setup and its caveats in one place, and trim the repeated explanatory comments now scattered across the test files.
Why
The test suite has accumulated a lot of hard-won, non-obvious knowledge that currently lives as long comment blocks duplicated across many files (~450+ comment lines in test/). The same caveats are re-explained repeatedly — e.g. the cds.spawn on sqlite skip rationale appears in ~7 places, the process.env.cds_requires_* config pattern in ~6, the Service Manager / multitenancy limitation in ~4. A single doc is easier to keep correct and lets the test files stay lean.
What TESTING.md should cover
How to run: sqlite (default) vs HANA; the env the HANA path needs; npm test / vitest invocation.
HANA specifics: single shared HDI container vs sqlite's per-file in-memory DB, and what that implies — serial file execution, outbox-settle in afterAll, retry: 2, raised timeouts (all gated on CI && HANA_DRIVER in vitest.config.mjs).
Test infrastructure: MyInMemorySpanExporter / MyInMemoryMetricReader (wired via .cdsrc.json profiles; must not require('@sap/cds') at module top; the reader mirrors production DELTA temporality), and the force-flush + poll (expectEventually / eventually) pattern for async span/metric assertions.
Known caveats: the pre-existing startup > NO_TELEMETRY=true local-env artifact, the internal-registry lockfile trap for @sap/* installs.
Then
Reduce the in-file comments to short pointers ("see TESTING.md — HANA shared-container caveats") rather than full re-explanations, keeping only what's needed to read the specific test.
Add a top-level
TESTING.mddocumenting the test setup and its caveats in one place, and trim the repeated explanatory comments now scattered across the test files.Why
The test suite has accumulated a lot of hard-won, non-obvious knowledge that currently lives as long comment blocks duplicated across many files (~450+ comment lines in
test/). The same caveats are re-explained repeatedly — e.g. thecds.spawn on sqliteskip rationale appears in ~7 places, theprocess.env.cds_requires_*config pattern in ~6, the Service Manager / multitenancy limitation in ~4. A single doc is easier to keep correct and lets the test files stay lean.What TESTING.md should cover
npm test/ vitest invocation.afterAll,retry: 2, raised timeouts (all gated onCI && HANA_DRIVERinvitest.config.mjs).MyInMemorySpanExporter/MyInMemoryMetricReader(wired via.cdsrc.jsonprofiles; must notrequire('@sap/cds')at module top; the reader mirrors production DELTA temporality), and the force-flush + poll (expectEventually/eventually) pattern for async span/metric assertions.process.env.cds_requires_*load-order sensitivity (see Tests configure CDS via process.env.cds_requires_* string-JSON instead of profiles/config #486), theTELEMETRY_TEST_HANAflag, and why config must precede any@sap/cdsrequire.startup > NO_TELEMETRY=truelocal-env artifact, the internal-registry lockfile trap for@sap/*installs.Then
Reduce the in-file comments to short pointers ("see TESTING.md — HANA shared-container caveats") rather than full re-explanations, keeping only what's needed to read the specific test.
Part of the test-quality cluster (#477 / #478 / #475 / #486).