Skip to content

enhc: add integration test coverage for locale, webhook, extension, label, branch, audit log, and management token#200

Open
aniket-shikhare-cstk wants to merge 3 commits into
developmentfrom
enhc/integration-test-coverage
Open

enhc: add integration test coverage for locale, webhook, extension, label, branch, audit log, and management token#200
aniket-shikhare-cstk wants to merge 3 commits into
developmentfrom
enhc/integration-test-coverage

Conversation

@aniket-shikhare-cstk

Copy link
Copy Markdown

Summary

  • Adds 7 new integration test files covering previously untested SDK areas: Locale, Webhook, Extension, Label, Branch, Audit Log, and Management Token APIs
  • Introduces TestAssemblySetup with [AssemblyInitialize] for dynamic stack creation before the test run, replacing the static pre-existing stack dependency
  • Introduces TestRunContext for in-memory sharing of the stack API key across test classes
  • Extends Contentstack.cs with 8 optional config properties (TfaEmail, TfaPassword, OAuth, PersonalizeHost, MemberEmail, DeleteDynamicResources, DamV2Enabled, AmOrgUid) read from appSettings.json

HTTP Logging Infrastructure

  • Adds LoggingHttpHandler — a DelegatingHandler that intercepts every HTTP request/response and emits structured JSON to stdout, including method, URL, headers, body, cURL command, and timestamp
  • Adds TestOutputLogger for structured log emission using ###TEST_OUTPUT_START### / ###TEST_OUTPUT_END### markers parsed by the HTML report generator
  • Updates generate_integration_test_report.py to display per-transaction timestamps and duration (ms) in the HTML report

Test plan

  • dotnet build passes with no errors
  • dotnet test --filter "FullyQualifiedName~Integration" runs the new test classes
  • TestAssemblySetup creates a stack at run start and sets TestRunContext.StackApiKey
  • Each new test class (005–009, 023, 024) initializes using the shared stack API key
  • HTML report generated by Scripts/generate_integration_test_report.py shows per-case assertions, cURL commands, and HTTP timestamps
  • appSettings.json is gitignored and not included in this PR

…abel, branch, audit log, and management token

- Add 7 new integration test files (Contentstack005–009, 023, 024) covering
  locale, webhook, extension, label, branch, audit log, and management token APIs
- Add TestAssemblySetup with AssemblyInitialize for dynamic stack creation
- Add TestRunContext for in-memory stack API key sharing across tests
- Update Contentstack.cs with 8 new optional config keys (MemberEmail, TfaEmail,
  TfaPassword, OAuth, PersonalizeHost, DeleteDynamicResources, DamV2Enabled, AmOrgUid)
- Add LoggingHttpHandler to capture HTTP request/response with timestamps and cURL
- Add TestOutputLogger for structured JSON output (ASSERTION, HTTP_REQUEST, HTTP_RESPONSE)
- Update generate_integration_test_report.py with per-transaction timestamp and duration display
- Update .gitignore to exclude appSettings.json, appsettings.template.json, SDK_METHOD_COVERAGE_MAP.md
@aniket-shikhare-cstk aniket-shikhare-cstk requested a review from a team as a code owner June 29, 2026 12:54
@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

🔒 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

…tivity compatibility

- Code (Contentstack.cs:33) uses AddJsonFile("appsettings.json") (lowercase s)
- File was named appSettings.json (capital S) — matched on macOS (case-insensitive)
  but not on Linux CI (case-sensitive), causing FileNotFoundException at test runtime
- Update csproj Content Include and gitignore to match lowercase filename
@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

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