Skip to content

test: rich HTML report + API suite fixes for enriched v5 stack - #382

Open
aniket-shikhare-cstk wants to merge 1 commit into
developmentfrom
enh/DX-7322-rich-report-and-suite-fixes
Open

test: rich HTML report + API suite fixes for enriched v5 stack#382
aniket-shikhare-cstk wants to merge 1 commit into
developmentfrom
enh/DX-7322-rich-report-and-suite-fixes

Conversation

@aniket-shikhare-cstk

Copy link
Copy Markdown
Contributor

Summary

Adds a rich, self-contained HTML test report and reconciles the API suite with the enriched v5 test stack. No product/SDK source changes — test infrastructure, test-data expectations, and bundler tooling only.

Note: originally intended for base enh/DX-7322, which has since been merged into development and deleted — so this targets development.

Reporting

  • New test/utils/request-capture-plugin.ts — a ContentstackPlugin capturing each HTTP call's method, URL, copy-paste cURL, request/response headers, body, status, duration. Tokens (access/preview/management/live_preview) are masked.
  • New test/utils/assertion-tracker.ts — records every assertion (matcher, expected, actual, pass, negated) by wrapping the built-in matchers, powering an Assertions Verified (Expected vs Actual) section with no test changes.
  • New test/reporting/rich-html-reporter.cjs — single-file self-contained HTML report at reports/contentstack-delivery/html/index.html; prints the path at run end.
  • Wired via jest.config.ts / jest.setup.ts; gated by ENABLE_HTTP_CAPTURE (set in test:api / test:api:report).
  • Fixed a stale console-error suppression so includeReference() validation noise is silenced (SDK message was reworded).

Test fixes

  • Reference specs use complex_all_fields fields (single_ref/multi_ref/self_ref).
  • Sync token assertions handle both cases: stable token when the delta finds no changes, advanced token when the sync log has intervening events. Also accepts pagination_token, realistic pagination bound, tolerant delta-perf threshold.
  • Assets: include dimensions asserts on an image asset; raised the slow error-path timeout for non-prod regions.

Bundlers

  • run-with-report.sh: regenerate lockfile per run (avoids stale-lock npm extraneous bug with the file: SDK dep), surface install errors, fix result counting.
  • Pin webpack to 5.108.0 (5.109.0 resolver regression on @ljharb/* transitive deps).

Notes

  • No secrets committed: .env, reports/, test-results/ are gitignored; changed files scanned for keys/tokens/UIDs (none).
  • .talismanrc updated to whitelist the 4 new report/bundler files (false positives on words like pass/key).

Reporting:
- Add request-capture plugin, assertion tracker, and a single-file HTML
  reporter that shows per-test SDK method, API request, copy-paste cURL,
  request/response, and Assertions Verified (expected vs actual) inline.
  Gated by ENABLE_HTTP_CAPTURE; tokens masked. Wired into jest config/setup.
- Fix stale console-error suppression to match the current SDK message.

Test fixes:
- Reference specs use complex_all_fields fields (single_ref/multi_ref/self_ref).
- Sync token assertions handle both no-change (stable) and change (advanced) cases.
- Asset dimension asserts on an image asset; raise slow error-path test timeout.

Bundlers:
- run-with-report.sh: regenerate lockfile, surface install errors, fix counting.
- Pin webpack to 5.108.0 (5.109 resolver regression with @ljharb transitive deps).

.talismanrc: whitelist the 4 new/updated report+bundler files (false positives).
@aniket-shikhare-cstk
aniket-shikhare-cstk requested a review from a team as a code owner July 26, 2026 21:46
@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@github-actions

Copy link
Copy Markdown

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 98.89% 984/995
🟢 Branches 96.44% 298/309
🟢 Functions 97.77% 219/224
🟢 Lines 99.36% 937/943

Test suite run success

708 tests passing in 35 suites.

Report generated by 🧪jest coverage report action from a03561d

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