Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move testdata to root #1

Conversation

ArangoGutierrez
Copy link

Go mod automatically ignores the /testdata directory. This change ensures that the rootfs for source/pci tests are not included in the module definition.

@@ -232,7 +232,8 @@ func TestPciSource(t *testing.T) {
// Run test cases
for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
hostpath.SysfsDir = hostpath.HostDir(filepath.Join(packagePath, "testdata", tc.rootfs, "sys"))
mockSysfsPath := filepath.Join(packagePath, "..", "..", "testdata", "source", "pci", tc.rootfs, "sys")
Copy link
Owner

Choose a reason for hiding this comment

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

Is the package path used for anything else other than the testdata dir? should we just set that directly instead?

Copy link
Author

Choose a reason for hiding this comment

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

umm you maybe right, packagePath has no other use, so we could even trim the init func at the beginning of the file

Copy link
Author

Choose a reason for hiding this comment

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

Done

Go mod automatically ignores the /testdata directory.
This change ensures that the rootfs for source/pci tests are not
included in the module definition.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar
Copy link
Owner

elezar commented Oct 21, 2024

Thanks @ArangoGutierrez. I squashed your changes onto kubernetes-sigs#1921

@elezar elezar closed this Oct 21, 2024
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