Skip to content

validate: use golden yaml for expected status - #500

Open
Dhanalakshmi-D04 wants to merge 1 commit into
RamenDR:mainfrom
Dhanalakshmi-D04:golden-yaml-application-tests
Open

validate: use golden yaml for expected status#500
Dhanalakshmi-D04 wants to merge 1 commit into
RamenDR:mainfrom
Dhanalakshmi-D04:golden-yaml-application-tests

Conversation

@Dhanalakshmi-D04

Copy link
Copy Markdown

What

Converts the large inline report.ApplicationStatus and report.ClustersStatus struct literals used in
pkg/validate/application/command_test.go and pkg/validate/clusters/command_test.go into golden yaml fixtures
under testdata/, loaded via new loadApplicationStatus / loadClustersStatus test helpers.

This follows the same golden-file pattern already used by html_test.go in both packages.

Why

The inline struct literals were ~180–570 lines each, making the tests hard to read and maintain. The yaml equivalents are
significantly shorter and easier to edit by hand.

Testing

  • go build ./...
  • go test ./...

Fixes #422

@coderabbitai

coderabbitai Bot commented Aug 11, 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: Pro Plus

Run ID: ed2db2fe-f21b-4a96-968e-abafc9aa790f

📥 Commits

Reviewing files that changed from the base of the PR and between 6b97a92 and 35bf2c3.

📒 Files selected for processing (7)
  • pkg/validate/application/application_test.go
  • pkg/validate/application/command_test.go
  • pkg/validate/application/testdata/appset-deploy-rbd.yaml
  • pkg/validate/clusters/clusters_test.go
  • pkg/validate/clusters/command_test.go
  • pkg/validate/clusters/testdata/k8s-status.yaml
  • pkg/validate/clusters/testdata/ocp-status.yaml
🚧 Files skipped from review as they are similar to previous changes (3)
  • pkg/validate/application/application_test.go
  • pkg/validate/clusters/clusters_test.go
  • pkg/validate/clusters/command_test.go
📜 Recent review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go

📄 CodeRabbit inference engine (.cursor/rules/project.mdc)

**/*.go: Use proper punctuation in comments - end sentences with periods
All Go files need SPDX license headers - check existing files for the format
Check existing code for error formatting conventions in Go

Files:

  • pkg/validate/application/command_test.go
**/*_test.go

📄 CodeRabbit inference engine (.cursor/rules/project.mdc)

Use helpers.FakeTime(t) for time-dependent tests to ensure reproducibility in Go tests

Files:

  • pkg/validate/application/command_test.go
🧠 Learnings (7)
📓 Common learnings
Learnt from: nirs
Repo: RamenDR/ramenctl PR: 0
File: :0-0
Timestamp: 2026-05-12T22:11:16.268Z
Learning: In the RamenDR/ramenctl repository, `TestValidateLastGroupSyncTime` (pkg/validate/application/command_validated_test.go) uses golden YAML files with hardcoded time values and does NOT depend on wall-clock time. Do not flag it for missing `helpers.FakeTime(t)` usage — the FakeTime guideline applies only to tests that call time.Now() or otherwise depend on the current time at runtime.
Learnt from: nirs
Repo: RamenDR/ramenctl PR: 456
File: pkg/gather/command_test.go:467-468
Timestamp: 2026-05-20T23:17:29.721Z
Learning: In `pkg/gather/command_test.go`, the gather command tests do not depend on wall-clock time. They load pre-baked golden YAML report data via `helpers.AddGatheredData` and explicitly skip duration assertions in `checkStep` (noted by the comment "We cannot check duration since it may be zero on windows"). Do not suggest adding `helpers.FakeTime(t)` to these tests.
📚 Learning: 2026-05-12T22:11:16.268Z
Learnt from: nirs
Repo: RamenDR/ramenctl PR: 0
File: :0-0
Timestamp: 2026-05-12T22:11:16.268Z
Learning: In the RamenDR/ramenctl repository, `TestValidateLastGroupSyncTime` (pkg/validate/application/command_validated_test.go) uses golden YAML files with hardcoded time values and does NOT depend on wall-clock time. Do not flag it for missing `helpers.FakeTime(t)` usage — the FakeTime guideline applies only to tests that call time.Now() or otherwise depend on the current time at runtime.

Applied to files:

  • pkg/validate/application/testdata/appset-deploy-rbd.yaml
  • pkg/validate/clusters/testdata/ocp-status.yaml
  • pkg/validate/application/command_test.go
📚 Learning: 2026-05-20T20:00:29.810Z
Learnt from: nirs
Repo: RamenDR/ramenctl PR: 456
File: pkg/validate/application/command.go:329-332
Timestamp: 2026-05-20T20:00:29.810Z
Learning: In `pkg/validate/application/command.go` (RamenDR/ramenctl), `s.PrimaryCluster.Name` and `s.SecondaryCluster.Name` are always populated by the time `validatePrimaryCluster`/`validateSecondaryCluster` return an error, so embedding those names in `step.Err` via `fmt.Sprintf("Failed to validate primary cluster %q", s.PrimaryCluster.Name)` is safe and intentional — the cluster name is never empty at that point.

Applied to files:

  • pkg/validate/clusters/testdata/k8s-status.yaml
  • pkg/validate/clusters/testdata/ocp-status.yaml
  • pkg/validate/application/command_test.go
📚 Learning: 2026-05-20T23:18:04.966Z
Learnt from: nirs
Repo: RamenDR/ramenctl PR: 456
File: pkg/test/command_test.go:589-590
Timestamp: 2026-05-20T23:18:04.966Z
Learning: In `pkg/test/command_test.go` (and related test files in the ramenctl repository), do NOT suggest adding `helpers.FakeTime(t)` in test setup. Duration is intentionally excluded from `checkStep` assertions (there is an explicit comment: "We cannot check duration since it may be zero on windows"), so fake-time stabilization is unnecessary and has already been discussed and rejected by the maintainer (nirs).

Applied to files:

  • pkg/validate/application/command_test.go
📚 Learning: 2026-05-20T23:17:29.721Z
Learnt from: nirs
Repo: RamenDR/ramenctl PR: 456
File: pkg/gather/command_test.go:467-468
Timestamp: 2026-05-20T23:17:29.721Z
Learning: In `pkg/gather/command_test.go`, the gather command tests do not depend on wall-clock time. They load pre-baked golden YAML report data via `helpers.AddGatheredData` and explicitly skip duration assertions in `checkStep` (noted by the comment "We cannot check duration since it may be zero on windows"). Do not suggest adding `helpers.FakeTime(t)` to these tests.

Applied to files:

  • pkg/validate/application/command_test.go
📚 Learning: 2026-05-20T18:45:08.052Z
Learnt from: nirs
Repo: RamenDR/ramenctl PR: 456
File: pkg/gather/command.go:207-214
Timestamp: 2026-05-20T18:45:08.052Z
Learning: In `pkg/gather/command.go` (RamenDR/ramenctl), cancellation is not supported during the `gatherApplication` gather loop because the context is not passed into that code path. Cancellation is only detected in subsequent steps via the context. Therefore, checking `errors.Is(r.Err, context.Canceled)` inside `gatherApplication`'s result loop is not needed.

Applied to files:

  • pkg/validate/application/command_test.go
📚 Learning: 2026-05-12T19:36:08.290Z
Learnt from: CR
Repo: RamenDR/ramenctl PR: 0
File: .cursor/rules/project.mdc:0-0
Timestamp: 2026-05-12T19:36:08.290Z
Learning: Applies to **/*_test.go : Use `helpers.FakeTime(t)` for time-dependent tests to ensure reproducibility in Go tests

Applied to files:

  • pkg/validate/application/command_test.go
🔇 Additional comments (4)
pkg/validate/application/command_test.go (1)

119-119: LGTM!

pkg/validate/application/testdata/appset-deploy-rbd.yaml (1)

1-9: LGTM!

pkg/validate/clusters/testdata/k8s-status.yaml (1)

1-324: LGTM!

pkg/validate/clusters/testdata/ocp-status.yaml (1)

1-315: LGTM!


📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Improved validation test maintainability by moving large expected results into readable YAML fixtures.
    • Added coverage for application and cluster status loading from test data.
    • Preserved expected validation results for Kubernetes, OpenShift, and application deployment scenarios.

Walkthrough

The validation tests replace large inline expected status structures with YAML golden fixtures. Test helpers load and unmarshal application and cluster reports. Unused imports, variables, and constants are removed.

Changes

Golden YAML validation

Layer / File(s) Summary
Application status fixture loading
pkg/validate/application/application_test.go, pkg/validate/application/command_test.go, pkg/validate/application/testdata/appset-deploy-rbd.yaml
The application test loads expected report.ApplicationStatus data from YAML. The inline expectation and unused declarations are removed.
Cluster status fixture loading
pkg/validate/clusters/clusters_test.go, pkg/validate/clusters/command_test.go, pkg/validate/clusters/testdata/*.yaml
The cluster tests load Kubernetes and OpenShift report.ClustersStatus data from YAML golden fixtures. Unused declarations are removed.

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

Possibly related PRs

Suggested reviewers: raaizik, netzzer

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: replacing inline expected status values with golden YAML fixtures.
Description check ✅ Passed The description accurately explains the conversion, motivation, affected tests, testing commands, and linked issue.
Linked Issues check ✅ Passed The changes satisfy issue #422 by moving application and cluster expected status structs into maintainable golden YAML fixtures.
Out of Scope Changes check ✅ Passed All changes support the stated test-fixture conversion and do not introduce unrelated production or test behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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.

🧹 Nitpick comments (2)
pkg/validate/application/application_test.go (1)

168-179: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

The fixture loaders omit the fixture name in failure messages. Both helpers accept a fixture name but report ReadFile() error and Unmarshal() error without it. A failing test does not identify which fixture is broken, and loadClustersStatus serves two fixtures.

  • pkg/validate/application/application_test.go#L168-L179: bind the joined path to a variable and include it in both t.Fatalf messages.
  • pkg/validate/clusters/clusters_test.go#L152-L163: apply the same change so k8s_status.yaml and ocp_status.yaml failures are distinguishable.
🤖 Prompt for 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.

In `@pkg/validate/application/application_test.go` around lines 168 - 179, Update
loadApplicationStatus in pkg/validate/application/application_test.go at lines
168-179 to store the joined fixture path and include it in both ReadFile and
Unmarshal failure messages. Apply the same change to loadClustersStatus in
pkg/validate/clusters/clusters_test.go at lines 152-163 so failures identify
whether k8s_status.yaml or ocp_status.yaml is affected.
pkg/validate/application/testdata/passed_status.yaml (1)

1-1: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

The golden fixtures carry no provenance comment. All three files are generated from resources in pkg/testdata/ and must be regenerated when those resources change. Nothing in the files states this. Issue #422 names this maintenance requirement. YAML comments cost nothing at load time.

  • pkg/validate/application/testdata/passed_status.yaml#L1-L1: add a header comment naming TestValidateApplicationPassed and the source resources.
  • pkg/validate/clusters/testdata/k8s_status.yaml#L1-L1: add a header comment naming TestValidateClustersK8s and pkg/testdata/clusters/k8s.
  • pkg/validate/clusters/testdata/ocp_status.yaml#L1-L1: add a header comment naming TestValidateClustersOcp and pkg/testdata/clusters/ocp.
🤖 Prompt for 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.

In `@pkg/validate/application/testdata/passed_status.yaml` at line 1, Add
provenance header comments to
pkg/validate/application/testdata/passed_status.yaml at lines 1-1 naming
TestValidateApplicationPassed and its source resources; add a header to
pkg/validate/clusters/testdata/k8s_status.yaml at lines 1-1 naming
TestValidateClustersK8s and pkg/testdata/clusters/k8s; and add a header to
pkg/validate/clusters/testdata/ocp_status.yaml at lines 1-1 naming
TestValidateClustersOcp and pkg/testdata/clusters/ocp.
🤖 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.

Nitpick comments:
In `@pkg/validate/application/application_test.go`:
- Around line 168-179: Update loadApplicationStatus in
pkg/validate/application/application_test.go at lines 168-179 to store the
joined fixture path and include it in both ReadFile and Unmarshal failure
messages. Apply the same change to loadClustersStatus in
pkg/validate/clusters/clusters_test.go at lines 152-163 so failures identify
whether k8s_status.yaml or ocp_status.yaml is affected.

In `@pkg/validate/application/testdata/passed_status.yaml`:
- Line 1: Add provenance header comments to
pkg/validate/application/testdata/passed_status.yaml at lines 1-1 naming
TestValidateApplicationPassed and its source resources; add a header to
pkg/validate/clusters/testdata/k8s_status.yaml at lines 1-1 naming
TestValidateClustersK8s and pkg/testdata/clusters/k8s; and add a header to
pkg/validate/clusters/testdata/ocp_status.yaml at lines 1-1 naming
TestValidateClustersOcp and pkg/testdata/clusters/ocp.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 90be598f-fb4c-4c30-9195-23fac7c4c8bc

📥 Commits

Reviewing files that changed from the base of the PR and between e945659 and 6b97a92.

📒 Files selected for processing (7)
  • pkg/validate/application/application_test.go
  • pkg/validate/application/command_test.go
  • pkg/validate/application/testdata/passed_status.yaml
  • pkg/validate/clusters/clusters_test.go
  • pkg/validate/clusters/command_test.go
  • pkg/validate/clusters/testdata/k8s_status.yaml
  • pkg/validate/clusters/testdata/ocp_status.yaml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (2)
**/*.go

📄 CodeRabbit inference engine (.cursor/rules/project.mdc)

**/*.go: Use proper punctuation in comments - end sentences with periods
All Go files need SPDX license headers - check existing files for the format
Check existing code for error formatting conventions in Go

Files:

  • pkg/validate/application/application_test.go
  • pkg/validate/clusters/clusters_test.go
  • pkg/validate/application/command_test.go
  • pkg/validate/clusters/command_test.go
**/*_test.go

📄 CodeRabbit inference engine (.cursor/rules/project.mdc)

Use helpers.FakeTime(t) for time-dependent tests to ensure reproducibility in Go tests

Files:

  • pkg/validate/application/application_test.go
  • pkg/validate/clusters/clusters_test.go
  • pkg/validate/application/command_test.go
  • pkg/validate/clusters/command_test.go
🔇 Additional comments (6)
pkg/validate/application/application_test.go (1)

13-14: LGTM!

pkg/validate/application/command_test.go (1)

127-129: LGTM!

pkg/validate/clusters/clusters_test.go (1)

13-14: LGTM!

pkg/validate/clusters/testdata/ocp_status.yaml (1)

279-283: LGTM!

pkg/validate/clusters/command_test.go (1)

71-72: LGTM!

Also applies to: 117-118

pkg/validate/application/testdata/passed_status.yaml (1)

93-94: 📐 Maintainability & Code Quality

Keep secondaryCluster.vrg.lastGroupSyncTime without value — the previous inline expectation also set only state: ok, so the fixture does not drop data.

			> Likely an incorrect or invalid review comment.

@nirs nirs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

t.Helper()
data, err := os.ReadFile(filepath.Join("testdata", name))
if err != nil {
t.Fatalf("ReadFile() error: %v", err)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Check if the error includes the file name. If not we want to include it in the error message. Can be tested by modifying the name (e.g. name+".missing").

@@ -0,0 +1,102 @@
hub:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add a comment to the file explaining how it is generated and when we need to update it.

}
// TEMPORARY — delete after generating the file
dumped, _ := yaml.Marshal(expectedStatus)
os.WriteFile("testdata/passed_status.yaml", dumped, 0644)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a good way to generate the golden files, but we cannot leave this code like this. Every commit must be correct and clean - no temporary code we going to remove in the next commit.

You can share this code in the commit messge, explaining how the golden file was geneated.

For this commit, removing the code for generating the golden file is enough.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let name this after the application tested - appset-deploy-rbd - like the testdata directory. In the future we will have more testdata and golden files.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Use - in file names instead of _

Comment thread pkg/validate/clusters/command_test.go Outdated
},
},
}
expected := loadClustersStatus(t, "ocp_status.yaml")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Replacing the huge struct with the yaml seems like the right way for this commit. Let's do the same for the application test.

// TEMPORARY — delete after generating the file
dumped, _ := yaml.Marshal(expectedStatus)
os.WriteFile("testdata/passed_status.yaml", dumped, 0644)
expectedStatus := loadApplicationStatus(t, "passed_status.yaml")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lets squash this commit into the first commit - this is the right way to replace the literal struct with golden file - no need for a partial commit adding a golden file without removing the literal struct.

@Dhanalakshmi-D04

Copy link
Copy Markdown
Author

Thanks for the detailed review, @nirs! I'll address all of these , will push updates shortly!!

@nirs
nirs requested a review from raaizik August 11, 2026 14:30
@Dhanalakshmi-D04
Dhanalakshmi-D04 force-pushed the golden-yaml-application-tests branch from 6b97a92 to 35bf2c3 Compare August 12, 2026 01:32
Replace the large inline report.ApplicationStatus and
report.ClustersStatus struct literals in
validate/application/command_test.go and
validate/clusters/command_test.go with golden yaml fixtures loaded
from testdata/, via new loadApplicationStatus/loadClustersStatus
test helpers. This matches the pattern already used by html_test.go
in both packages.

Golden files were generated by temporarily adding, right after each
struct literal:

    dumped, err := yaml.Marshal(expected)
    if err != nil {
        t.Fatalf("Marshal() error: %v", err)
    }
    if err := os.WriteFile("testdata/<name>.yaml", dumped, 0644); err != nil {
        t.Fatalf("WriteFile() error: %v", err)
    }

running the relevant test once to produce the file, then removing
this code and replacing the struct literal with a call to the
loader helper.

Fixes RamenDR#422
@Dhanalakshmi-D04
Dhanalakshmi-D04 force-pushed the golden-yaml-application-tests branch from 35bf2c3 to d7ba5db Compare August 12, 2026 01:44
@Dhanalakshmi-D04

Copy link
Copy Markdown
Author

@nirs Addressed all review comments: filename in error messages, golden file comments, removed temp generator code, renamed files to match convention (appset-deploy-rbd.yaml, k8s-status.yaml, ocp-status.yaml), and squashed everything into a single clean commit. Also fixed 6 lint issues (import ordering + unused vars left over from the removed literals) that were causing the Lint check to fail. All green locally: go build, go test ./..., and golangci-lint run ./.... ,
waiting for detailed review to work on it if something was misunderstood by me!

@raaizik raaizik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall this is good.
One other remark: k8s.yaml / ocp.yaml would be clearer. -status suffixed file names is fine if you want to distinguish from HTML report goldens - is this the case? @nirs

# TestValidateApplicationPassed in command_test.go.
#
# Generated from the report.ApplicationStatus struct that was previously
# hardcoded in the test, by temporarily marshaling it to yaml and writing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to detail how it used to work ("previously hardcoded in the test")

# TestValidateClustersK8s in command_test.go.
#
# Generated from the report.ClustersStatus struct that was previously
# hardcoded in the test, by temporarily marshaling it to yaml and writing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same

# TestValidateClustersOcp in command_test.go.
#
# Generated from the report.ClustersStatus struct that was previously
# hardcoded in the test, by temporarily marshaling it to yaml and writing

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same

}
s := &report.ApplicationStatus{}
if err := yaml.Unmarshal(data, s); err != nil {
t.Fatalf("Unmarshal() error: %v", err)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
t.Fatalf("Unmarshal() error: %v", err)
t.Fatalf("Unmarshal(%q) error: %v", name, err)

}
s := &report.ClustersStatus{}
if err := yaml.Unmarshal(data, s); err != nil {
t.Fatalf("Unmarshal() error: %v", err)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
t.Fatalf("Unmarshal() error: %v", err)
t.Fatalf("Unmarshal(%q) error: %v", name, err)

Comment on lines +1 to +9
# Golden file for the expected report.ApplicationStatus produced by
# TestValidateApplicationPassed in command_test.go.
#
# Generated from the report.ApplicationStatus struct that was previously
# hardcoded in the test, by temporarily marshaling it to yaml and writing
# it to this path. See the commit message for the exact steps used.
#
# If the test fixtures under pkg/testdata/appset-deploy-rbd/ change,
# this file must be regenerated to match.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The useful parts are only:

  • which test uses the file
  • which pkg/testdata/... tree it tracks
  • regenerate when that tree changes

Comment on lines +1 to +9
# Golden file for the expected report.ClustersStatus produced by
# TestValidateClustersK8s in command_test.go.
#
# Generated from the report.ClustersStatus struct that was previously
# hardcoded in the test, by temporarily marshaling it to yaml and writing
# it to this path. See the commit message for the exact steps used.
#
# If the test fixtures under pkg/testdata/clusters/k8s/ change, this
# file must be regenerated to match.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The useful parts are only:

  • which test uses the file
  • which pkg/testdata/... tree it tracks
  • regenerate when that tree changes

Comment on lines +1 to +9
# Golden file for the expected report.ClustersStatus produced by
# TestValidateClustersOcp in command_test.go.
#
# Generated from the report.ClustersStatus struct that was previously
# hardcoded in the test, by temporarily marshaling it to yaml and writing
# it to this path. See the commit message for the exact steps used.
#
# If the test fixtures under pkg/testdata/clusters/ocp/ change, this
# file must be regenerated to match.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The useful parts are only:

  • which test uses the file
  • which pkg/testdata/... tree it tracks
  • regenerate when that tree changes

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.

validate tests: Use golden yaml reports

4 participants