[feature-1707]: Increase unit test coverage to 90%#896
Conversation
controllers/csm_controller_test.go
Outdated
| @@ -1,4 +1,4 @@ | |||
| // Copyright © 2022 - 2023 Dell Inc. or its subsidiaries. All Rights Reserved. | |||
| // Copyright © 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | |||
There was a problem hiding this comment.
Should be 2022-2025. You don't lose copyright for previous years.
core/semver/semver.go
Outdated
| /* | ||
| Copyright © 2025 Dell Inc. or its subsidiaries. All Rights Reserved. |
There was a problem hiding this comment.
As Don said, this should be 2021-2025
core/semver/semver.go
Outdated
| }() // #nosec G20 | ||
| } | ||
|
|
||
| gitdesc := chkErr(doExec("git", "describe", "--long", "--dirty")) |
There was a problem hiding this comment.
This line may give you trouble because it creates inconsistent UT-- the code executes on the current commit status, I had to extract it out in my semver https://github.com/dell/csi-powerflex/pull/420/files#diff-a656f5ce872be362bd5d216186de6396334c2c2c77830591f5e7dec50a853f9fR67-R68
| tests := []struct { | ||
| name string | ||
| format string | ||
| outputFile string | ||
| expectEmptyFile bool | ||
| readFileFunc func(file string) ([]byte, error) |
There was a problem hiding this comment.
If you're hitting coverage, it's fine, but I needed to add some more control to this so that I could inject a desired "git describe" output in csi-powerflex: https://github.com/dell/csi-powerflex/pull/420/files#diff-050199f17155af589ff5135cf4ee18854937db044813677c6e90805f076cb421R47-R53
main.go
Outdated
| @@ -1,4 +1,4 @@ | |||
| // Copyright © 2021 - 2023 Dell Inc. or its subsidiaries. All Rights Reserved. | |||
| // Copyright © 2025 Dell Inc. or its subsidiaries. All Rights Reserved. | |||
There was a problem hiding this comment.
Copyright years.
Also, it isn't fun, but you're probably going to need to do some smoke tests since main.go was changed.
There was a problem hiding this comment.
Yes, I built the Operator image and installed it successfully.
Description
Increase unit test coverage to 90%.
GitHub Issues
List the GitHub issues impacted by this PR:
Checklist:
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration
Unit tests. Installed Operator verify that it runs.