Skip to content

Commit

Permalink
fix ci err
Browse files Browse the repository at this point in the history
Signed-off-by: Xieql <xieqianglong@huawei.com>
  • Loading branch information
Xieql committed Jan 9, 2024
1 parent 2ef57e7 commit 486f369
Showing 1 changed file with 26 additions and 24 deletions.
50 changes: 26 additions & 24 deletions pkg/fleet-manager/pipeline/render/predefined_task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import (

"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

pipelineapi "kurator.dev/kurator/pkg/apis/pipeline/v1alpha1"
)

func TestRenderPredefinedTask(t *testing.T) {
Expand All @@ -39,10 +41,10 @@ func TestRenderPredefinedTask(t *testing.T) {
{
name: "git-clone with basic parameters",
cfg: PredefinedTaskConfig{
PipelineName: "test-pipeline",
PipelineNamespace: "kurator-pipeline",
TemplateName: "git-clone",
Params: map[string]string{},
PipelineName: "test-pipeline",
Namespace: "kurator-pipeline",
TemplateName: string(pipelineapi.GitClone),
Params: map[string]string{},
},
expectError: false,
expectedFile: "git-clone.yaml",
Expand All @@ -54,10 +56,10 @@ func TestRenderPredefinedTask(t *testing.T) {
{
name: "go-test with default parameters",
cfg: PredefinedTaskConfig{
PipelineName: "test-pipeline",
PipelineNamespace: "default",
TemplateName: GoTestTask,
Params: map[string]string{},
PipelineName: "test-pipeline",
Namespace: "default",
TemplateName: string(pipelineapi.GoTest),
Params: map[string]string{},
},
expectError: false,
expectedFile: "go-test-default.yaml",
Expand All @@ -69,9 +71,9 @@ func TestRenderPredefinedTask(t *testing.T) {
{
name: "go-test with custom parameters - Go 1.20, ./pkg/..., Linux ARM",
cfg: PredefinedTaskConfig{
PipelineName: "test-pipeline",
PipelineNamespace: "kurator-pipeline",
TemplateName: GoTestTask,
PipelineName: "test-pipeline",
Namespace: "kurator-pipeline",
TemplateName: string(pipelineapi.GoTest),
Params: map[string]string{
"packages": "./pkg/...",
"version": "1.20",
Expand All @@ -90,10 +92,10 @@ func TestRenderPredefinedTask(t *testing.T) {
{
name: "go-lint with custom parameters - latest version, ./src/..., extra flags",
cfg: PredefinedTaskConfig{
PipelineName: "test-pipeline",
PipelineNamespace: "kurator-pipeline",
TemplateName: GoLintTask,
Params: map[string]string{},
PipelineName: "test-pipeline",
Namespace: "kurator-pipeline",
TemplateName: string(pipelineapi.GoLint),
Params: map[string]string{},
},
expectError: false,
expectedFile: "go-lint-custom-value.yaml",
Expand All @@ -106,9 +108,9 @@ func TestRenderPredefinedTask(t *testing.T) {
{
name: "advanced go-lint custom configuration - version 1.25.0, ./cmd/..., specific flags",
cfg: PredefinedTaskConfig{
PipelineName: "test-pipeline",
PipelineNamespace: "kurator-pipeline",
TemplateName: GoLintTask,
PipelineName: "test-pipeline",
Namespace: "kurator-pipeline",
TemplateName: string(pipelineapi.GoLint),
Params: map[string]string{
"package": "./cmd/...",
"version": "1.25.0",
Expand All @@ -125,9 +127,9 @@ func TestRenderPredefinedTask(t *testing.T) {
{
name: "Custom Configuration for Kaniko Build Task",
cfg: PredefinedTaskConfig{
PipelineName: "test-pipeline",
PipelineNamespace: "kurator-pipeline",
TemplateName: BuildPushImage,
PipelineName: "test-pipeline",
Namespace: "kurator-pipeline",
TemplateName: string(pipelineapi.BuildPushImage),
Params: map[string]string{
"image": "ghcr.io/test-orz/test-image:0.3.1",
},
Expand All @@ -145,9 +147,9 @@ func TestRenderPredefinedTask(t *testing.T) {
{
name: "Custom Dockerfile and Context for Kaniko Build Task",
cfg: PredefinedTaskConfig{
PipelineName: "test-pipeline",
PipelineNamespace: "kurator-pipeline",
TemplateName: BuildPushImage,
PipelineName: "test-pipeline",
Namespace: "kurator-pipeline",
TemplateName: string(pipelineapi.BuildPushImage),
Params: map[string]string{
"image": "ghcr.io/test-orz/test-image:0.3.2",
"dockerfile": "./app/Dockerfile",
Expand Down

0 comments on commit 486f369

Please # to comment.