Skip to content

Commit

Permalink
fix: fix uts
Browse files Browse the repository at this point in the history
  • Loading branch information
SparkYuan committed Nov 21, 2023
1 parent 7e34017 commit d1be343
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 41 deletions.
23 changes: 4 additions & 19 deletions pkg/cmd/build/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,39 +42,24 @@ var (

func TestCompileOptions_preSet(t *testing.T) {
type fields struct {
Settings []string
Output string
Output string
}
type want struct {
Settings []string
Output string
Output string
}

tests := []struct {
name string
fields fields
want want
}{
{
name: "preset-nothing",
fields: fields{
Settings: []string{"ci-test/settings.yaml", "kcl.yaml"},
Output: "ci-test/stdout.golden.yaml",
},
want: want{
Settings: []string{"ci-test/settings.yaml", "kcl.yaml"},
Output: "ci-test/stdout.golden.yaml",
},
},
{
name: "preset-everything",
fields: fields{
Settings: []string{},
Output: "",
Output: "",
},
want: want{
Settings: []string{"kcl.yaml"},
Output: "ci-test/stdout.golden.yaml",
Output: "",
},
},
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import (

"kusionstack.io/kusion/pkg/cmd/apply"
"kusionstack.io/kusion/pkg/cmd/build"
"kusionstack.io/kusion/pkg/cmd/compile"
// we need to import the compile pkg to keep the compile command available
"kusionstack.io/kusion/pkg/cmd/compile" //nolint:staticcheck
"kusionstack.io/kusion/pkg/cmd/deps"
"kusionstack.io/kusion/pkg/cmd/destroy"
"kusionstack.io/kusion/pkg/cmd/env"
Expand Down
18 changes: 7 additions & 11 deletions pkg/generator/kcl/kcl_generator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,15 @@ func TestGenerateSpec(t *testing.T) {
}

type args struct {
workDir string
filenames []string
settings []string
arguments map[string]string
overrides []string
disableNone bool
overrideAST bool
workDir string
filenames []string
settings []string
arguments map[string]string
}
testArgs := args{
filenames: []string{},
settings: []string{"testdata/kcl.yaml"},
arguments: map[string]string{"image": "nginx:latest"},
disableNone: true,
filenames: []string{},
settings: []string{"testdata/kcl.yaml"},
arguments: map[string]string{"image": "nginx:latest"},
}
tests := []struct {
name string
Expand Down
10 changes: 0 additions & 10 deletions test/e2e/kusionctl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ var _ = ginkgo.Describe("Kusion Configuration Commands", func() {
})
})

ginkgo.Context("kusion check testing", func() {
ginkgo.It("kusion check", func() {
// kusion check testing
path := filepath.Join(GetWorkDir(), "konfig", "example", "multi-stack", "dev")
output, err := ExecKusionWithWorkDir("kusion check", path)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
gomega.Expect(output).To(gomega.ContainSubstring("Generating Intent"))
})
})

ginkgo.Context("kusion ls testing", func() {
ginkgo.It("kusion ls", func() {
path := filepath.Join(GetWorkDir(), "konfig")
Expand Down

0 comments on commit d1be343

Please sign in to comment.