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

add few lines test cases for deprecatedComment #1189

Merged
merged 6 commits into from Jan 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions checkers/testdata/deprecatedComment/negative_tests.go
Expand Up @@ -31,3 +31,26 @@ var (
// dePreca
_ = 0
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ComponentStatus (and ComponentStatus) holds the cluster validation info.
// Deprecated: This API is deprecated in v1.19+
type ComponentStatus struct {
foo string
// +optional
bar string

// +optional
fooBard []string
}

// ComponentStatusList represents the list of component statuses
// Deprecated: This API is deprecated in v1.19+
type ComponentStatusList struct {
string
// +optional
int

Items []ComponentStatus
}
25 changes: 25 additions & 0 deletions checkers/testdata/deprecatedComment/positive_tests.go
Expand Up @@ -181,3 +181,28 @@ type foo3 string
/*! the proper format is `Deprecated: <text>` */
// deprecated in 1.11: use f instead.
type foo4 string

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ComponentStatusBad (and ComponentStatusList) holds the cluster validation info.
/*! use `Deprecated: ` (note the casing) instead of `DeprecaTEd: ` */
// DeprecaTEd: This API is deprecated in v1.19+
type ComponentStatusBad struct {
foo string
// +optional
bar string

// +optional
fooBard []string
}

// ComponentStatusList represents the list of component statuses
/*! use `Deprecated: ` (note the casing) instead of `DeprecaTed: ` */
// DeprecaTed: This API is deprecated in v1.19+
type ComponentStatusListBad struct {
string
// +optional
int

Items []int
}