Skip to content

test: Add Test Checks Wipe Disks List#99

Open
irishgordo wants to merge 1 commit into
harvester:mainfrom
irishgordo:investigation/seeder-unmarshalls-not-like-installer
Open

test: Add Test Checks Wipe Disks List#99
irishgordo wants to merge 1 commit into
harvester:mainfrom
irishgordo:investigation/seeder-unmarshalls-not-like-installer

Conversation

@irishgordo
Copy link
Copy Markdown
Contributor

  • we are adding more mock data and a test that checks the wipe disks list gets brought in correctly, we previously did not know that seeder needed to parse content as install.wipediskslist and thought rather, it was supposed to be install.wipe_disks_list , this test just adds baseline sanity to show that it is parsing now how we have configuration set for some internal systems that depend on seeders provisioning process

Resolves: investigation/seeder-unmarshalls-not-like-installer

* we are adding more mock data and a test that checks the wipe disks
  list gets brought in correctly, we previously did not know that seeder
  needed to parse content as install.wipediskslist and thought rather,
  it was supposed to be install.wipe_disks_list , this test just adds
  baseline sanity to show that it is parsing now how we have
  configuration set for some internal systems that depend on seeders
  provisioning process

Resolves: investigation/seeder-unmarshalls-not-like-installer
Signed-off-by: Mike Russell <michael.russell@suse.com>
Copilot AI review requested due to automatic review settings May 18, 2026 18:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a regression test plus a new testdata fixture (customized-create.yaml) to confirm that seeder/Harvester parses install.wipediskslist (the actual key used by harvester-installer) rather than the previously assumed install.wipe_disks_list.

Changes:

  • New test Test_createModeCloudConfigCheckWipeDisksListWorksBecauseSpecClusterConfigWipeDisksDeprecated exercises generateCloudConfig against the new fixture and asserts hc.WipeDisksList is populated.
  • New pkg/tink/testdata/customized-create.yaml fixture containing an install.wipediskslist with four disks and other realistic settings.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
pkg/tink/tink_test.go Adds new test verifying wipediskslist parsing from YAML config.
pkg/tink/testdata/customized-create.yaml New fixture supplying an install.wipediskslist with four entries.
Comments suppressed due to low confidence (2)

pkg/tink/tink_test.go:67

  • Most arguments passed to generateCloudConfig here are empty strings/zero values, including mode, which differs from the other two tests in this file that exercise meaningful values. This makes it hard to tell what configuration is actually being tested, and the unusual vlanID value of 2021 appears arbitrary. Consider passing the same realistic inputs used by Test_createModeCloudConfig (with mode = "create" to match the test name) so the test reflects how generateCloudConfig is actually called in production, and replace 2021 with a documented or shared constant.
	cloudConfig, err := generateCloudConfig("file:///testdata/customized-create.yaml", "", "", "", "", "", "", "", "", nil, nil, nil, "", "", "", "", "", false, false, 2021, "", "", "")

pkg/tink/tink_test.go:72

  • The assertion only checks the length of hc.WipeDisksList but not its contents. Since the purpose of this test is to verify that install.wipediskslist is parsed correctly (vs. the previously assumed install.wipe_disks_list), it would be more meaningful to also assert the actual disk entries (e.g., /dev/vda, /dev/nvme0n1, /dev/sda, /dev/sdb) are present. A length-only check would still pass if the entries were silently misparsed into the wrong slots.
	assert.Len(hc.WipeDisksList, 4)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/tink/tink_test.go
assert.Contains(hc.WipeDisksList, "/dev/vda", "expected to find /dev/vda in wipeDisksList")
}

func Test_createModeCloudConfigCheckWipeDisksListWorksBecauseSpecClusterConfigWipeDisksDeprecated(t *testing.T) {
@irishgordo
Copy link
Copy Markdown
Contributor Author

Thoughts on possibly removing,

WipeDisks bool `json:"wipeDisks,omitempty"`

?

Since our OS level changes break that functionality in Harvester.

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.

3 participants