Skip to content

test(bdd): cover control observability install - #564

Open
sbaum1994 wants to merge 4 commits into
mainfrom
test/bdd-observability-control-pr2
Open

test(bdd): cover control observability install#564
sbaum1994 wants to merge 4 commits into
mainfrom
test/bdd-observability-control-pr2

Conversation

@sbaum1994

@sbaum1994 sbaum1994 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Why

Issue #522 requires live coverage for each observability profile. Rendering cannot verify that the control profile installs its shared dependencies, selects the correct monitors, or runs the function autoscaler on local arm64.

What changed

  • Add a live ncp-local Helmfile scenario for observability.profile: control.
  • Configure both stack environments and use autoscaler chart 0.2.0 with multi-architecture image 1.18.10.
  • Verify shared releases, target allocation, included control-plane ServiceMonitors, and excluded compute-plane monitors.
  • Add one table-driven step that checks named ServiceMonitors with a combined kubectl get, plus DSL and wiring tests.

Customer Release Notes

Not customer visible.

Plan Summary

Installs the self-managed and observability stacks on k3d-ncp-local. Defaults are unchanged.

Usage

From tests/bdd:

BDD_CLEANUP_MODE=topology-single \
  go test -run '^TestObservabilityControl$' -timeout 90m -count=1 -v .

Testing

  • go test -short ./...: passed.
  • ./scripts/lint.sh: passed.
  • Live k3d-ncp-local run: 32/32 steps passed in 3m07s.

Notes

PR #523 supplies the tracked Makefile wrapper. Until it merges, the feature stages Makefile.dist through the BDD ledger.

References

Related Pull Requests

Dependencies

None. No license or NOTICE changes.

Issues

Relates to #522

@sbaum1994
sbaum1994 requested a review from a team as a code owner July 30, 2026 06:00
@sbaum1994
sbaum1994 requested a review from balajinvda July 30, 2026 06:00
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR adds a BDD scenario for installing the observability control profile in a local k3d environment. It adds ServiceMonitor assertions, mocked harness wiring, generated-value checks, and live execution.

Changes

Observability control profile

Layer / File(s) Summary
ServiceMonitor assertion support
tests/bdd/PLAN.md, tests/bdd/dsl/kubectl.go, tests/bdd/dsl/kubectl_test.go, tests/bdd/steps/assertion_steps.go, tests/bdd/steps/steps_test.go
Adds validated command construction and Godog steps for checking multiple ServiceMonitors with one Kubernetes command.
Control profile installation and validation
tests/bdd/features/observability-control.feature
Configures Helmfile inputs and secrets, installs the control profile, and verifies monitoring resources, OpenTelemetry configuration, and excluded monitors.
BDD harness and live entry point
tests/bdd/godog_test.go
Seeds fixtures and mocked responses, verifies Helmfile invocation and generated values, and adds canned outputs, setup helpers, exact-command matching, and a live feature test.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Godog
  participant Helmfile
  participant Kubernetes
  Godog->>Helmfile: Install local-bdd-observability-control
  Helmfile->>Kubernetes: Deploy control profile resources
  Godog->>Kubernetes: Verify releases and monitor resources
Loading

Suggested reviewers: balajinvda

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately describes the added BDD coverage for the control observability installation.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/bdd-observability-control-pr2

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/bdd/features/observability-control.feature`:
- Around line 38-40: Update the conflict precheck comment in the topology
bootstrap feature to include the exact required `make destroy` remediation
command, replacing the current ncp-local-cluster command while preserving the
surrounding port-overlap guidance.
- Around line 69-72: Update the observability-control feature’s target allocator
assertion to query .spec.targetAllocator.enabled directly with kubectl jsonpath
and verify the result is true, rather than relying on independent YAML substring
checks. Adjust the corresponding fake-runner command and expected result in
godog_test.go to match the new query.
- Around line 83-88: Strengthen the monitor absence checks in the
observability-control scenario by asserting Kubernetes NotFound error text, not
only exit code 1, for each servicemonitor and podmonitor command. Update the
corresponding fake runner responses to emit the same NotFound output so the
scenario verifies missing resources rather than unrelated command failures.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 21906d5b-8e2f-490a-8b8c-3f44a39944f8

📥 Commits

Reviewing files that changed from the base of the PR and between f43b7fb and 70f2bf1.

📒 Files selected for processing (2)
  • tests/bdd/features/observability-control.feature
  • tests/bdd/godog_test.go

Comment thread tests/bdd/features/observability-control.feature Outdated
Comment thread tests/bdd/features/observability-control.feature Outdated
Comment thread tests/bdd/features/observability-control.feature

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/bdd/godog_test.go`:
- Around line 466-496: Update TestObservabilityControlFeatureFileWiresToSteps
and its newFakeRunner command map to add explicit successful canned results for
the helm registry login command and all four expected positive servicemonitor
lookups, using the exact generated command strings. Preserve the existing
install-step post-run substring assertion and current negative monitor results.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 60a86ead-09ea-4435-994b-e6fb3929e161

📥 Commits

Reviewing files that changed from the base of the PR and between 70f2bf1 and 3030758.

📒 Files selected for processing (2)
  • tests/bdd/features/observability-control.feature
  • tests/bdd/godog_test.go

Comment thread tests/bdd/godog_test.go
Add a live Helmfile scenario that provisions ncp-local with the control profile and verifies shared releases, target allocation, control monitors, and compute monitor exclusions.

Select function-autoscaler chart 0.2.0 for the current token template and override its unavailable appVersion with the multi-architecture 1.18.10 image for local arm64 validation.

Refs: #522, #527
Signed-off-by: Stephanie Baum <sbaum@nvidia.com>
@sbaum1994
sbaum1994 force-pushed the test/bdd-observability-control-pr2 branch from 3030758 to 101c24e Compare July 30, 2026 22:30
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