Skip to content

Commit

Permalink
skaff: parallelize unit tests (#32461)
Browse files Browse the repository at this point in the history
  • Loading branch information
jar-b authored Jul 12, 2023
1 parent 2aa1162 commit 0afd1f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions skaff/datasource/datasourcetest.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ import (
// intricate, they should be unit tested.
{{- end }}
func Test{{ .DataSource }}ExampleUnitTest(t *testing.T) {
t.Parallel()

testCases := []struct {
TestName string
Input string
Expand Down Expand Up @@ -126,7 +128,9 @@ func Test{{ .DataSource }}ExampleUnitTest(t *testing.T) {
}

for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.TestName, func(t *testing.T) {
t.Parallel()
got, err := tf{{ .ServicePackage }}.FunctionFromDataSource(testCase.Input)

if err != nil && !testCase.Error {
Expand Down
4 changes: 4 additions & 0 deletions skaff/resource/resourcetest.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ import (
// intricate, they should be unit tested.
{{- end }}
func Test{{ .Resource }}ExampleUnitTest(t *testing.T) {
t.Parallel()

testCases := []struct {
TestName string
Input string
Expand Down Expand Up @@ -125,7 +127,9 @@ func Test{{ .Resource }}ExampleUnitTest(t *testing.T) {
}

for _, testCase := range testCases {
testCase := testCase
t.Run(testCase.TestName, func(t *testing.T) {
t.Parallel()
got, err := tf{{ .ServicePackage }}.FunctionFromResource(testCase.Input)

if err != nil && !testCase.Error {
Expand Down

0 comments on commit 0afd1f4

Please sign in to comment.