Skip to content

Commit

Permalink
🤖 Add automatically generated tests
Browse files Browse the repository at this point in the history
Signed-off-by: Vdaas CI <[email protected]>
  • Loading branch information
vdaas-ci committed Jun 22, 2023
1 parent 0d97a07 commit d58682f
Show file tree
Hide file tree
Showing 220 changed files with 114,737 additions and 147,038 deletions.
147 changes: 71 additions & 76 deletions cmd/agent/core/ngt/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,80 +17,75 @@
// Package main provides program main
package main

import (
"testing"

"github.com/vdaas/vald/internal/test/goleak"
)

// NOT IMPLEMENTED BELOW

func Test_main(t *testing.T) {
type want struct{}
type test struct {
name string
want want
checkFunc func(want) error
beforeFunc func(*testing.T)
afterFunc func(*testing.T)
}
defaultCheckFunc := func(w want) error {
return nil
}
tests := []test{
// TODO test cases
/*
{
name: "test_case_1",
want: want{},
checkFunc: defaultCheckFunc,
beforeFunc: func(t *testing.T,) {
t.Helper()
},
afterFunc: func(t *testing.T,) {
t.Helper()
},
},
*/

// TODO test cases
/*
func() test {
return test {
name: "test_case_2",
want: want{},
checkFunc: defaultCheckFunc,
beforeFunc: func(t *testing.T,) {
t.Helper()
},
afterFunc: func(t *testing.T,) {
t.Helper()
},
}
}(),
*/
}

for _, tc := range tests {
test := tc
t.Run(test.name, func(tt *testing.T) {
tt.Parallel()
defer goleak.VerifyNone(tt, goleak.IgnoreCurrent())
if test.beforeFunc != nil {
test.beforeFunc(tt)
}
if test.afterFunc != nil {
defer test.afterFunc(tt)
}
checkFunc := test.checkFunc
if test.checkFunc == nil {
checkFunc = defaultCheckFunc
}

main()
if err := checkFunc(test.want); err != nil {
tt.Errorf("error = %v", err)
}
})
}
}
//
// func Test_main(t *testing.T) {
// type want struct {
// }
// type test struct {
// name string
// want want
// checkFunc func(want) error
// beforeFunc func(*testing.T)
// afterFunc func(*testing.T)
// }
// defaultCheckFunc := func(w want) error {
// return nil
// }
// tests := []test{
// // TODO test cases
// /*
// {
// name: "test_case_1",
// want: want{},
// checkFunc: defaultCheckFunc,
// beforeFunc: func(t *testing.T,) {
// t.Helper()
// },
// afterFunc: func(t *testing.T,) {
// t.Helper()
// },
// },
// */
//
// // TODO test cases
// /*
// func() test {
// return test {
// name: "test_case_2",
// want: want{},
// checkFunc: defaultCheckFunc,
// beforeFunc: func(t *testing.T,) {
// t.Helper()
// },
// afterFunc: func(t *testing.T,) {
// t.Helper()
// },
// }
// }(),
// */
// }
//
// for _, tc := range tests {
// test := tc
// t.Run(test.name, func(tt *testing.T) {
// tt.Parallel()
// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent())
// if test.beforeFunc != nil {
// test.beforeFunc(tt)
// }
// if test.afterFunc != nil {
// defer test.afterFunc(tt)
// }
// checkFunc := test.checkFunc
// if test.checkFunc == nil {
// checkFunc = defaultCheckFunc
// }
//
// main()
// if err := checkFunc(test.want); err != nil {
// tt.Errorf("error = %v", err)
// }
// })
// }
// }
147 changes: 71 additions & 76 deletions cmd/agent/sidecar/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,80 +17,75 @@
// Package main provides program main
package main

import (
"testing"

"github.com/vdaas/vald/internal/test/goleak"
)

// NOT IMPLEMENTED BELOW

func Test_main(t *testing.T) {
type want struct{}
type test struct {
name string
want want
checkFunc func(want) error
beforeFunc func(*testing.T)
afterFunc func(*testing.T)
}
defaultCheckFunc := func(w want) error {
return nil
}
tests := []test{
// TODO test cases
/*
{
name: "test_case_1",
want: want{},
checkFunc: defaultCheckFunc,
beforeFunc: func(t *testing.T,) {
t.Helper()
},
afterFunc: func(t *testing.T,) {
t.Helper()
},
},
*/

// TODO test cases
/*
func() test {
return test {
name: "test_case_2",
want: want{},
checkFunc: defaultCheckFunc,
beforeFunc: func(t *testing.T,) {
t.Helper()
},
afterFunc: func(t *testing.T,) {
t.Helper()
},
}
}(),
*/
}

for _, tc := range tests {
test := tc
t.Run(test.name, func(tt *testing.T) {
tt.Parallel()
defer goleak.VerifyNone(tt, goleak.IgnoreCurrent())
if test.beforeFunc != nil {
test.beforeFunc(tt)
}
if test.afterFunc != nil {
defer test.afterFunc(tt)
}
checkFunc := test.checkFunc
if test.checkFunc == nil {
checkFunc = defaultCheckFunc
}

main()
if err := checkFunc(test.want); err != nil {
tt.Errorf("error = %v", err)
}
})
}
}
//
// func Test_main(t *testing.T) {
// type want struct {
// }
// type test struct {
// name string
// want want
// checkFunc func(want) error
// beforeFunc func(*testing.T)
// afterFunc func(*testing.T)
// }
// defaultCheckFunc := func(w want) error {
// return nil
// }
// tests := []test{
// // TODO test cases
// /*
// {
// name: "test_case_1",
// want: want{},
// checkFunc: defaultCheckFunc,
// beforeFunc: func(t *testing.T,) {
// t.Helper()
// },
// afterFunc: func(t *testing.T,) {
// t.Helper()
// },
// },
// */
//
// // TODO test cases
// /*
// func() test {
// return test {
// name: "test_case_2",
// want: want{},
// checkFunc: defaultCheckFunc,
// beforeFunc: func(t *testing.T,) {
// t.Helper()
// },
// afterFunc: func(t *testing.T,) {
// t.Helper()
// },
// }
// }(),
// */
// }
//
// for _, tc := range tests {
// test := tc
// t.Run(test.name, func(tt *testing.T) {
// tt.Parallel()
// defer goleak.VerifyNone(tt, goleak.IgnoreCurrent())
// if test.beforeFunc != nil {
// test.beforeFunc(tt)
// }
// if test.afterFunc != nil {
// defer test.afterFunc(tt)
// }
// checkFunc := test.checkFunc
// if test.checkFunc == nil {
// checkFunc = defaultCheckFunc
// }
//
// main()
// if err := checkFunc(test.want); err != nil {
// tt.Errorf("error = %v", err)
// }
// })
// }
// }
Loading

0 comments on commit d58682f

Please sign in to comment.