Skip to content

Commit

Permalink
fix: annotation & naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
jzli committed Aug 22, 2022
1 parent 864a63c commit ee3b957
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion apis/data/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions apis/meta/v1alpha1/project_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (r ProjectSubType) Validate(fld *field.Path) field.ErrorList {
MavenRepositoryProjectSubType: {},
RawRepositoryProjectSubType: {},
ProjectManagementSubtype: {},
TestProjectSubtype: {},
TestProjectSubType: {},
}

if _, exist := supportedTypes[r]; !exist {
Expand Down Expand Up @@ -87,8 +87,8 @@ const (
// ProjectManagementSubtype project management subtype
ProjectManagementSubtype ProjectSubType = "ProjectManagement"

// TestProjectSubtype test project subtype
TestProjectSubtype ProjectSubType = "TestProject"
// TestProjectSubType test project subtype
TestProjectSubType ProjectSubType = "TestProject"

// TODO: add more subtypes
)
Expand Down
4 changes: 2 additions & 2 deletions apis/meta/v1alpha1/testmodule_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type TestModuleSpec struct {
// TestModuleCaseRef refers to a test module and its order
type TestModuleCaseRef struct {
// TestObjectRef refers to a test case
TestObjectRef `json:"ref"`
TestCase TestObjectRef `json:"ref"`
// Order indicates the ASC order of the object at same level
Order int `json:"order"`
}
Expand Down Expand Up @@ -77,7 +77,7 @@ func (tm *TestModule) ContainsTestCaseID(caseID string) bool {
}

for _, tc := range tm.Spec.TestCases {
if tc.ID == caseID {
if tc.TestCase.ID == caseID {
return true
}
}
Expand Down
2 changes: 1 addition & 1 deletion apis/meta/v1alpha1/testmodule_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ var _ = Describe("TestModule", func() {
tm := TestModule{Spec: TestModuleSpec{
TestCases: []TestModuleCaseRef{
{
TestObjectRef: TestObjectRef{ID: "123", Name: "abc"},
TestCase: TestObjectRef{ID: "123", Name: "abc"},
},
},
}}
Expand Down
2 changes: 1 addition & 1 deletion apis/meta/v1alpha1/testplan_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ type TestProjectOptions struct {
Search string `json:"search"`
}

func GetRefByIDFromMap(m map[string]*TestObjectRef, ID string) *TestObjectRef {
func RefFromMap(m map[string]*TestObjectRef, ID string) *TestObjectRef {
if m == nil {
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions apis/meta/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions plugin/client/testcase.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
duckv1 "knative.dev/pkg/apis/duck/v1"
)

// ClientTestCase for test case
type ClientTestCase interface {
List(ctx context.Context, baseURL *duckv1.Addressable, params metav1alpha1.TestProjectOptions, options ...OptionFunc) (*metav1alpha1.TestCaseList, error)
Get(ctx context.Context, baseURL *duckv1.Addressable, params metav1alpha1.TestProjectOptions, options ...OptionFunc) (*metav1alpha1.TestCase, error)
Expand Down
1 change: 1 addition & 0 deletions plugin/client/testcaseexecution.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
duckv1 "knative.dev/pkg/apis/duck/v1"
)

// ClientTestCaseExecution client for test case execution
type ClientTestCaseExecution interface {
List(ctx context.Context,
baseURL *duckv1.Addressable,
Expand Down
1 change: 1 addition & 0 deletions plugin/client/testmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
duckv1 "knative.dev/pkg/apis/duck/v1"
)

// ClientTestModule client for test module
type ClientTestModule interface {
List(ctx context.Context, baseURL *duckv1.Addressable, params metav1alpha1.TestProjectOptions, options ...OptionFunc) (*metav1alpha1.TestModuleList, error)
}
Expand Down
1 change: 1 addition & 0 deletions plugin/client/testplan.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
duckv1 "knative.dev/pkg/apis/duck/v1"
)

// ClientTestPlan client for test plan
type ClientTestPlan interface {
List(ctx context.Context,
baseURL *duckv1.Addressable,
Expand Down

0 comments on commit ee3b957

Please sign in to comment.