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
Several test files configure CDS by assigning string-JSON to process.env.cds_requires_* (and similar) at module top, instead of using cds's normal profile / .cdsrc.json / cds.test() config mechanism.
Fragile & load-order-sensitive: the assignment must run before any@sap/cds require, or it's silently ignored. This module-load-order coupling is exactly what forced the delete cds.env hack that test: run full suite on HANA + fix two HANA span/metric bugs (#477 §2, §5) #481 had to remove (reading cds.env at collection time froze the singleton before the profile applied).
Stringly-typed: hand-built JSON strings, no validation, easy to get subtly wrong.
Bypasses the intended mechanism: cds already supports --profile + .cdsrc.json profiles and cds.test(dir, ...args) options; most of these overrides could be expressed there instead.
Follow-up
Move these config overrides to proper --profile / .cdsrc.json profiles or cds.test(...) arguments where possible, and reduce reliance on process.env.cds_requires_*.
Origin: maintainer review on #481 (the delete cds.env fragility thread). Part of the test-quality cluster (#477 / #478 / #475).
Several test files configure CDS by assigning string-JSON to
process.env.cds_requires_*(and similar) at module top, instead of using cds's normal profile /.cdsrc.json/cds.test()config mechanism.Sites:
test/tracing-messaging-inboxed.test.js,test/tracing-messaging-persistent-outbox.test.js,test/tracing-messaging-without-outbox.test.js—process.env.cds_requires_messaging = JSON.stringify({ ... })test/logging.test.js—process.env.cds_requires_telemetry_tracing = JSON.stringify({ exporter: false })andprocess.env.cds_log = JSON.stringify({ ... })test/passport.test.js—process.env.cds_requires_scheduling = 'false'test/tracing-attributes.test.js—process.env.cds_remote_native__fetch = 'true'Why this is worth fixing
@sap/cdsrequire, or it's silently ignored. This module-load-order coupling is exactly what forced thedelete cds.envhack that test: run full suite on HANA + fix two HANA span/metric bugs (#477 §2, §5) #481 had to remove (readingcds.envat collection time froze the singleton before the profile applied).--profile+.cdsrc.jsonprofiles andcds.test(dir, ...args)options; most of these overrides could be expressed there instead.Follow-up
Move these config overrides to proper
--profile/.cdsrc.jsonprofiles orcds.test(...)arguments where possible, and reduce reliance onprocess.env.cds_requires_*.Origin: maintainer review on #481 (the
delete cds.envfragility thread). Part of the test-quality cluster (#477 / #478 / #475).