← Back to Pull requests

ci: send test results and coverage to Datadog Test Optimization #150

Open
unknown opened this pull request with 253 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 18, 2026 17:39 UTC
Author

Summary

Sends the unit and acceptance test results, with coverage, to Datadog Test Optimization, so the CI health dashboard can show this provider next to the other Secrets Manager repos.

  • Each test step now also writes its existing go test -v output to a log file under $RUNNER_TEMP. Console output is unchanged.

  • A new composite action, .github/actions/report-tests-to-datadog, converts a log to JUnit with go-junit-report v2.1.0 and uploads it with datadog-ci junit upload. When a coverprofile is given, its total is sent as the test.code_coverage.lines_pct measure.

  • Three suites, all under service terraform-provider-beyondtrust:

  • - unit, with coverage from coverage-unit.out
    - acceptance (product site), with coverage from coverage-acc.out
    - acceptance-admin, covering the three admin-site steps, without coverage because those targets write no coverprofile
  • The report step runs whether its tests passed or failed, and not when the run is cancelled. In the unit job it is skipped for fork and Dependabot PRs. The acceptance jobs are already limited to same-repo PRs and pushes.

  • datadog-ci is the standalone v5.26.1 Linux binary from Datadog's GitHub release, checked against a pinned sha256 (matching the release's checksums.txt).
  • Notes

  • Needs a DATADOG_API_KEY secret visible to this repo before merge. It isn't available here today, and without it every report step fails with "API key is missing", including in the unit job on every PR.

  • Results are uploaded from inside each job, not passed between jobs as artifacts. Artifacts on a public repo can be downloaded by anyone and aren't masked the way logs are, so raw acceptance test output stays out of them.

  • Checked locally: make test-unit through the new pipeline gives 406 tests in the JUnit file at 27.2% coverage, and the upload command is correct when run against a stand-in for datadog-ci. A missing log fails with an error. The acceptance suites have not been run with this change.
  • Jira: SMOP-1833

    Diff: 253 lines (+189 / -64) across 3 files Reviewer: sdahal-bt Review duration: 17777m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 253 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.331
    Real PR Conversation Timeline
    1 comments
    "Review active on #150"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.1% (MEDIUM) · Higher = larger blast radius
    39.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.8% · Safe to merge
    20.8%