kubesaw / ksctl

ksctl is a command-line tool to manage your installation of KubeSaw
Apache License 2.0
4 stars 11 forks source link

Removing creationTimestamp under Template object #50

Closed dperaza4dustbit closed 1 month ago

dperaza4dustbit commented 4 months ago

The creationTimestamp field not only pops up under TemplateTier metadata but also under template itself

dperaza4dustbit commented 4 months ago

Will try to figure out if I spot the issue with unit test

dperaza4dustbit commented 4 months ago

Working on fixing the testcases

MatousJobanek commented 4 months ago

as for unit-testing - let's either improve the util_test.go so it verifies objects at any level, or add this check: https://github.com/kubesaw/ksctl/blob/d75821023d8faa2b97e2b01761f090c0d7c53551/pkg/cmd/generate/assertion_test.go#L169-L171 into https://github.com/kubesaw/ksctl/blob/d75821023d8faa2b97e2b01761f090c0d7c53551/pkg/cmd/generate/assertion_test.go#L142-L143 because the assertObject function is not called in the nstemplatetiers_test.go but listObjects is, so it would be verified automatically.

dperaza4dustbit commented 1 month ago

it looks good overall, just waiting for the updates of the unit tests #50 (comment)

Got it

dperaza4dustbit commented 1 month ago

as for unit-testing - let's either improve the util_test.go so it verifies objects at any level, or add this check:

https://github.com/kubesaw/ksctl/blob/d75821023d8faa2b97e2b01761f090c0d7c53551/pkg/cmd/generate/assertion_test.go#L169-L171

into https://github.com/kubesaw/ksctl/blob/d75821023d8faa2b97e2b01761f090c0d7c53551/pkg/cmd/generate/assertion_test.go#L142-L143

because the assertObject function is not called in the nstemplatetiers_test.go but listObjects is, so it would be verified automatically.

added assertions to listObject method, thanks for suggestion

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 69.59%. Comparing base (ac3aaca) to head (fd122c3). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #50 +/- ## ========================================== + Coverage 69.57% 69.59% +0.01% ========================================== Files 43 43 Lines 2564 2565 +1 ========================================== + Hits 1784 1785 +1 Misses 589 589 Partials 191 191 ``` | [Files with missing lines](https://app.codecov.io/gh/kubesaw/ksctl/pull/50?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubesaw) | Coverage Δ | | |---|---|---| | [pkg/cmd/generate/util.go](https://app.codecov.io/gh/kubesaw/ksctl/pull/50?src=pr&el=tree&filepath=pkg%2Fcmd%2Fgenerate%2Futil.go&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kubesaw#diff-cGtnL2NtZC9nZW5lcmF0ZS91dGlsLmdv) | `78.16% <100.00%> (+0.15%)` | :arrow_up: |