-
Notifications
You must be signed in to change notification settings - Fork 1
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
Cleanup after ephemeral volume test #127
Conversation
… it's NA to other tests. Auto-cleanup is now the default for the eph volume test, other tests never clean up.
…ling for ephemeral volume test).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the test failure in the failed check:
`=== RUN TestCleanupAfterTest/Functional_test_with_no-cleanup_=false
time="2025-01-14T03:55:30Z" level=info msg="Using EVENT observer type"
time="2025-01-14T03:55:30Z" level=info msg="Using default config"
time="2025-01-14T03:55:30Z" level=error msg="Can't load config at "/github/home/.kube/config", error = stat /github/home/.kube/config: no such file or directory"
time="2025-01-14T03:55:30Z" level=error msg="can't get config from specified file; &{%!e(string=stat) %!e(string=/github/home/.kube/config) %!e(syscall.Errno=2)}"
time="2025-01-14T03:55:30Z" level=error msg="Couldn't create new kubernetes client. Error = config can't be nil"
--- FAIL: TestCleanupAfterTest (0.01s)
--- FAIL: TestCleanupAfterTest/Functional_test_with_no-cleanup=_false (0.01s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x28f4b40]
goroutine 12 [running]:
testing.tRunner.func1.2({0x2e08040, 0x46e47e0})
/usr/local/go/src/testing/testing.go:1632 +0x230
testing.tRunner.func1()
/usr/local/go/src/testing/testing.go:1635 +0x35e
panic({0x2e08040?, 0x46e47e0?})
/usr/local/go/src/runtime/panic.go:785 +0x132
github.com/dell/cert-csi/pkg/testcore/runner.NewFunctionalSuiteRunner({0x0?, 0x3499320?}, {0x0?, 0x180?}, 0x1?, 0xa8?, 0xb4?, 0x0, 0xc0002485b0)
/github/workspace/pkg/testcore/runner/functional-runner.go:58 +0x60
github.com/dell/cert-csi/pkg/cmd.createFunctionalSuiteRunner(0xc00051bce0, 0x0, 0x0)
/github/workspace/pkg/cmd/functionalcmd.go:138 +0x714
github.com/dell/cert-csi/pkg/cmd.TestCleanupAfterTest.func3(0xc0000fa000)
/github/workspace/pkg/cmd/functionalcmd_test.go:108 +0x85
testing.tRunner(0xc0000fa000, 0xc0005e1860)
/usr/local/go/src/testing/testing.go:1690 +0xf4
created by testing.(*T).Run in goroutine 11
/usr/local/go/src/testing/testing.go:1743 +0x390
FAIL github.com/dell/cert-csi/pkg/cmd 0.047s
? github.com/dell/cert-csi/pkg/helm [no test files]
? github.com/dell/cert-csi/pkg/k8sclient/resources/commonparams [no test files]
? github.com/dell/cert-csi/pkg/k8sclient/resources/metrics [no test files]
? github.com/dell/cert-csi/pkg/k8sclient/resources/node [no test files]
? github.com/dell/cert-csi/pkg/k8sclient/resources/csistoragecapacity [no test files]`
@gallacher GH action failed, since it was run in env without kube config. Fixed that, now test env doesn't need kube config.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
pkg/cmd/functionalcmd.go
Outdated
@@ -682,6 +674,14 @@ func getFunctionalEphemeralCreationCommand(globalFlags []cli.Flag) cli.Command { | |||
Name: "pod-name, pname", | |||
Usage: "custom name for pod and cloned volume pod to create", | |||
}, | |||
cli.BoolFlag{ | |||
Name: "no-cleanup, nc", | |||
Usage: "include this flag do disable cleanup after test", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo.
pkg/cmd/functionalcmd.go
Outdated
}, | ||
cli.BoolFlag{ | ||
Name: "no-cleanup-on-fail, ncof", | ||
Usage: "include this flag do disable cleanup on fail", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo.
43b9430
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this fix to the test whereby the cleanup logic was broken, leaving garbage around impacting possible subsequent runs. CSM 1.13 only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this fix to the test whereby the cleanup logic was broken, leaving garbage around impacting possible subsequent runs. CSM 1.13 only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this fix to the test whereby the cleanup logic was broken, leaving garbage around impacting possible subsequent runs. CSM 1.13 only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving this fix to the test whereby the cleanup logic was broken, leaving garbage around impacting possible subsequent runs. CSM 1.13 only.
Description
Ephemeral volume test never did cleanup, regardless of the --no-cleanup flag. The fix adds code to do auto-cleanup for ephemeral volume test unless --no-cleanup is set. Other functional tests don't have --no-cleanup flag, since it make no sense for them.
GitHub Issues
List the GitHub issues impacted by this PR:
Checklist:
How Has This Been Tested?
Tested with a new unit-test that checks that auto-cleanup is done after ephemeral volume tests, unless no-cleanup is set. Results attached.
Full unit-test log:
test.txt