Skip to content

chore: cds^10#440

Closed
sjvans wants to merge 10 commits into
mainfrom
cds10
Closed

chore: cds^10#440
sjvans wants to merge 10 commits into
mainfrom
cds10

Conversation

@sjvans

@sjvans sjvans commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Upgrade Test Suite for CDS v10 Compatibility

Refactor

♻️ Refactored the test suite to align with CDS v10 conventions, migrating from inline process.env configuration overrides to CDS profiles and a dedicated .cdsrc.json file. The CI pipeline matrix is also narrowed to CDS v9 only, with v10 commented out as a future target.

Changes

  • .github/workflows/ci.yml: Removed CDS v8 from the test matrix (now v9 only); removed v8-specific install steps; added a commented-out v10 entry for future use.
  • .gitignore: Removed the ignore rule for test/bookshop/.cdsrc.json (now tracked); added .claude/ to the ignore list.
  • test/bookshop/.cdsrc.json: New file — Centralizes CDS profile-based configuration for logging, metrics, metrics-outbox, metrics-outbox-disabled, tracing-attributes, persistent-outbox, and without-outbox profiles, replacing scattered process.env overrides.
  • test/bookshop/package.json: Added @sap/cds-dk as a dev dependency; removed _outbox entry and [metrics-outbox]/[metrics-outbox-disabled] profile blocks (moved to .cdsrc.json); added _scheduling flag.
  • test/logging.test.js: Removed inline process.env telemetry/logging config overrides; switched to --profile logging. Retained a minimal cds_log env override with a note about cls_custom_fields profile precedence limitation.
  • test/metrics.test.js: Removed process.env.cds_requires_telemetry_metrics_config override; switched to --profile metrics.
  • test/metrics-outbox.test.js: Fixed a race condition by waiting on E2 instead of E1 for retry tracking; extended wait time; snapshots counter values before assertions to avoid flaky comparisons.
  • test/tracing-attributes.test.js: Removed process.env exporter override; switched to --profile tracing-attributes.
  • test/tracing-messaging-persistent-outbox.test.js: Renamed CASE to persistent-outbox; removed redundant process.env overrides; skipped the describe block pending vitest migration.
  • test/tracing-messaging-without-outbox.test.js: Renamed CASE to without-outbox; fixed messaging config to use outboxed: false instead of outbox: false.
  • test/tracing-messaging-with-in-memory-outbox.test.js: Removed — in-memory queues are not supported in CDS v10.
  • test/tracing-messaging.js: Switched from cds.test().in(...) to cds.test(..., '--profile', CASE).
  • test/tracing.test.js: Switched from cds.test().in(...) to cds.test(...).
  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.26.11

  • Summary Prompt: Default Prompt
  • Correlation ID: 03cf6a2a-ae17-41bf-af02-c44adf8f5639
  • Event Trigger: pull_request.edited
  • File Content Strategy: Full file content
  • Output Template: Default Template
  • LLM: anthropic--claude-4.6-sonnet

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR refactors test configuration from inline process.env overrides to CDS profiles (.cdsrc.json), which is a clean improvement. The main issues found are: two copy-paste mistakes in REVISIT comments (wrong profile name referenced), and the in-memory-outbox test dropping the critical outbox: { kind: 'in-memory-outbox' } setting from its env override, which may cause that test case to not exercise the intended code path.

PR Bot Information

Version: 1.26.11

  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: ffefc4d8-0bc2-4c85-beed-2debefc0d843
  • Event Trigger: pull_request.opened
  • File Content Strategy: Full file content

Comment thread test/tracing-messaging-in-memory-outbox.test.js Outdated
Comment thread test/tracing-messaging-persistent-outbox.test.js Outdated
Comment thread test/tracing-messaging-without-outbox.test.js Outdated
Comment thread test/tracing-messaging-in-memory-outbox.test.js Outdated
@sjvans sjvans changed the title cds^10 chore: cds^10 Jun 26, 2026
@sjvans sjvans mentioned this pull request Jun 26, 2026
1 task
@sjvans
sjvans marked this pull request as ready for review June 26, 2026 12:41
@sjvans
sjvans requested review from PDT42 and hm23 June 26, 2026 12:42

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is a well-structured refactoring that centralises test configuration into .cdsrc.json profiles and drops CDS v8 matrix support. Two issues were raised: the missing in-memory-outbox profile (no test coverage for that scenario) and the potential race condition in metrics-outbox.test.js where the snapshot may already reflect retry-2 side effects due to ordering of the wait and snapshot lines.

PR Bot Information

Version: 1.26.11

  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.ready_for_review
  • File Content Strategy: Full file content
  • Correlation ID: e2544745-64ee-46f6-aa91-9cadcee6c0b4

Comment on lines +175 to +176
while (currentRetryCount[E2] < 2) await wait(100)
await wait(300) // ... for the retry to be processed and metrics to be collected

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic Error: The snapshot at line 182-183 is taken after await wait(300) at line 176, meaning E2's retry has already been processed and totalOut/totalFailed may already reflect the extra increment from retry 2. The snapshot should be taken before the 300ms wait to reliably capture the state before the retry fires.

Suggested change
while (currentRetryCount[E2] < 2) await wait(100)
await wait(300) // ... for the retry to be processed and metrics to be collected
while (currentRetryCount[E2] < 2) await wait(100)
// Snapshot counters now: retry 2 fires at t+1250ms (waitingTime(2)), which overlaps
// with the wait below, causing totalOut/totalFailed to advance ahead of the metric export
const snapOut = { ...totalOut }
const snapFailed = { ...totalFailed }
await wait(300) // ... for the retry to be processed and metrics to be collected

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

Comment thread .github/workflows/ci.yml Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep this for later, once cds-version will be [9, 10]?

@cap-js cap-js deleted a comment from hyperspace-pr-bot Bot Jun 26, 2026
@sjvans

sjvans commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

superseded by #443 (which will be part of #441)

@sjvans sjvans closed this Jun 26, 2026
@sjvans
sjvans deleted the cds10 branch July 1, 2026 07:59
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.

2 participants