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

chore: modify test package name #6472

Merged
merged 1 commit into from
Apr 18, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
605 changes: 303 additions & 302 deletions pkg/apis/pipeline/v1/matrix_types_test.go

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions pkg/apis/pipeline/v1/taskref_types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,47 +14,51 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1
package v1_test

import "testing"
import (
"testing"

v1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1"
)

func TestTaskRef_IsCustomTask(t *testing.T) {
tests := []struct {
name string
tr *TaskRef
tr *v1.TaskRef
want bool
}{{
name: "not a custom task - apiVersion and Kind are not set",
tr: &TaskRef{
tr: &v1.TaskRef{
Name: "foo",
},
want: false,
}, {
// related issue: https://github.com/tektoncd/pipeline/issues/6459
name: "not a custom task - apiVersion is not set",
tr: &TaskRef{
tr: &v1.TaskRef{
Name: "foo",
Kind: "Example",
},
want: false,
}, {
name: "not a custom task - kind is not set",
tr: &TaskRef{
tr: &v1.TaskRef{
Name: "foo",
APIVersion: "example/v0",
},
want: false,
}, {
name: "custom task with name",
tr: &TaskRef{
tr: &v1.TaskRef{
Name: "foo",
Kind: "Example",
APIVersion: "example/v0",
},
want: true,
}, {
name: "custom task without name",
tr: &TaskRef{
tr: &v1.TaskRef{
Kind: "Example",
APIVersion: "example/v0",
},
Expand Down
6 changes: 4 additions & 2 deletions pkg/apis/pipeline/v1beta1/cluster_task_conversion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package v1beta1
package v1beta1_test

import (
"context"
"testing"

v1beta1 "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
)

func TestClusterTaskConversionBadType(t *testing.T) {
good, bad := &ClusterTask{}, &Pipeline{}
good, bad := &v1beta1.ClusterTask{}, &v1beta1.Pipeline{}

if err := good.ConvertTo(context.Background(), bad); err == nil {
t.Errorf("ConvertTo() = %#v, wanted error", bad)
Expand Down
Loading