Skip to content

test(bdd): group non-empty YAML key assertions - #1058

Merged
sbaum1994 merged 1 commit into
mainfrom
test/bdd-nonempty-yaml-keys-dsl
Aug 21, 2026
Merged

test(bdd): group non-empty YAML key assertions#1058
sbaum1994 merged 1 commit into
mainfrom
test/bdd-nonempty-yaml-keys-dsl

Conversation

@sbaum1994

@sbaum1994 sbaum1994 commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

TL;DR

Add one table-driven YAML assertion for non-empty keys and replace repeated registration-output checks across eight BDD features. The feature files still show every key being checked, while missing and empty values now report the failing table row.

Additional Details

Why

Registration scenarios repeated the same long file path for each generated ID. Grouping those assertions improves readability without hiding the file, key names, or expected non-empty behavior.

What changed

  • Register yaml file "..." should have non-empty keys: with a required key column.
  • Distinguish missing keys from keys whose resolved value is empty.
  • Test valid tables, missing rows, bad headers, blank keys, missing YAML keys, and empty YAML values.
  • Migrate grouped assertions in local CLI, local Helmfile, observability, and EKS features.
  • Add the step to the BDD DSL catalog.

Customer Release Notes

Not customer visible.

Plan Summary

Not applicable. This changes test code and feature wording only.

Usage

Then yaml file "registration.yaml" should have non-empty keys:
  | key            |
  | clusterID      |
  | clusterGroupID |

Notes

Live-run issue log:

No runtime observability or architecture behavior changes.

References

Related Pull Requests

Dependencies

None. No license review or NOTICE update is required.

For the Reviewer

Please focus on the table validation and row-specific errors in tests/bdd/steps/assertion_steps.go and tests/bdd/dsl/yamledit.go.

For QA

  • go test -short ./...: passed
  • golangci-lint run --config .golangci.yml ./...: passed with 0 issues
  • TestSingleClusterUp: 3 scenarios, 51 steps passed
  • TestSingleClusterHelmfile: 5 scenarios, 48 steps passed
  • TestObservabilityAll: 1 scenario, 37 steps passed
  • TestMultiClusterUp: 4 scenarios, 63 steps passed
  • TestMultiClusterHelmfile: 5 scenarios, 68 steps passed; see the NVCT note above
  • TestObservabilityCompute: 1 scenario, 45 steps passed
  • EKS feature wiring is covered by the short suite; no live EKS install was run

Additional QA is not required for this test-only DSL change.

Issues

Closes #863
Relates to #858

Checklist

  • I am familiar with the Contributing Guidelines.
  • I have signed off my commits for Developer Certificate of Origin (DCO) compliance.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Summary by CodeRabbit

  • New Features

    • Added table-driven validation for confirming multiple YAML keys exist and contain non-empty values.
    • Validation supports dotted key paths and reports clear details for missing, unreadable, or empty values.
  • Tests

    • Expanded coverage for valid data, missing keys, empty values, malformed validation tables, and invalid table entries.
    • Updated cluster registration scenarios to validate required identifiers consistently and account for generated, non-deterministic values.

Add a table-driven YAML assertion that distinguishes missing keys from empty values, and migrate repeated registration-output checks across local and EKS features.

Closes #863

Signed-off-by: Stephanie Baum <sbaum@nvidia.com>
@sbaum1994
sbaum1994 requested a review from a team as a code owner August 21, 2026 09:25
@sbaum1994
sbaum1994 requested a review from jjayaraman-1 August 21, 2026 09:25
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: abd1ff90-0de0-474f-b24b-7738f89075a8

📥 Commits

Reviewing files that changed from the base of the PR and between 356d8ff and 20375e8.

📒 Files selected for processing (13)
  • tests/bdd/PLAN.md
  • tests/bdd/dsl/yamledit.go
  • tests/bdd/dsl/yamledit_test.go
  • tests/bdd/features/multi-cluster-eks-helmfile.feature
  • tests/bdd/features/multi-cluster-helmfile.feature
  • tests/bdd/features/multi-cluster-up.feature
  • tests/bdd/features/observability-all.feature
  • tests/bdd/features/observability-compute.feature
  • tests/bdd/features/single-cluster-eks-helmfile.feature
  • tests/bdd/features/single-cluster-helmfile.feature
  • tests/bdd/features/single-cluster-up.feature
  • tests/bdd/steps/assertion_steps.go
  • tests/bdd/steps/steps_test.go

Included review availability: Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The BDD DSL adds a table-driven assertion for non-empty YAML keys. The assertion validates table structure, reports key-specific errors, and replaces repeated registration-value checks across feature scenarios.

Changes

Grouped YAML assertions

Layer / File(s) Summary
YAML key validation
tests/bdd/dsl/yamledit.go, tests/bdd/dsl/yamledit_test.go
RequireNonEmptyYAMLKeys checks dotted YAML keys and reports indexed errors for missing or empty values.
BDD step wiring and validation
tests/bdd/steps/assertion_steps.go, tests/bdd/steps/steps_test.go, tests/bdd/PLAN.md
The new table-based step is registered, documented, and tested for valid and invalid table inputs.
Registration scenario migration
tests/bdd/features/*.feature
Repeated assertions are consolidated for generated identity fields, with comments identifying non-deterministic values.

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

Merge Risk: ⚪ Minimal · up to 20375

This change only improves BDD YAML assertion grouping and error reporting without changing customer-facing or runtime behavior; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: jjayaraman-1

Sequence Diagram(s)

sequenceDiagram
  participant BDDScenario
  participant YAMLAssertionStep
  participant RequireNonEmptyYAMLKeys
  participant ReadYAMLKey
  BDDScenario->>YAMLAssertionStep: provide YAML path and key table
  YAMLAssertionStep->>RequireNonEmptyYAMLKeys: validate listed keys
  RequireNonEmptyYAMLKeys->>ReadYAMLKey: read each dotted key
  ReadYAMLKey-->>RequireNonEmptyYAMLKeys: return value or error
  RequireNonEmptyYAMLKeys-->>YAMLAssertionStep: return validation result
  YAMLAssertionStep-->>BDDScenario: pass or report assertion error
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 4 files. (9 skipped: 9 unsupported.) Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title follows Conventional Commits and accurately describes the BDD test assertion grouping change.
Linked Issues check ✅ Passed The changes satisfy issue #863 by adding, validating, testing, documenting, and migrating the grouped non-empty YAML key assertion.
Out of Scope Changes check ✅ Passed All changes support the linked issue by implementing, testing, documenting, or migrating the grouped YAML key assertion.
✨ 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-nonempty-yaml-keys-dsl

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

@sbaum1994
sbaum1994 added this pull request to the merge queue Aug 21, 2026
Merged via the queue into main with commit 5d9ab70 Aug 21, 2026
18 checks passed
@sbaum1994
sbaum1994 deleted the test/bdd-nonempty-yaml-keys-dsl branch August 21, 2026 22:14
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.

BDD DSL: Group non-empty YAML key assertions

2 participants