1
1
// Copyright 2022 VMware, Inc.
2
2
// SPDX-License-Identifier: Apache-2.0
3
3
4
- package release_test
4
+ package schemagenerator_test
5
5
6
6
import (
7
7
"io/fs"
@@ -10,7 +10,7 @@ import (
10
10
"testing"
11
11
12
12
"github.com/stretchr/testify/require"
13
- "github.com/vmware-tanzu/carvel-kapp-controller/cli/pkg/kctrl/cmd/package/release"
13
+ "github.com/vmware-tanzu/carvel-kapp-controller/cli/pkg/kctrl/cmd/package/release/schemagenerator "
14
14
"sigs.k8s.io/yaml"
15
15
)
16
16
@@ -225,7 +225,7 @@ type: object
225
225
fileName := "values.yaml"
226
226
err = os .WriteFile (filepath .Join (dirName , fileName ), []byte (test .input ), fs .ModePerm )
227
227
require .NoError (t , err )
228
- valuesSchema , err := release .NewHelmValuesSchemaGen ("tmp" ).Schema ()
228
+ valuesSchema , err := schemagenerator .NewHelmValuesSchemaGen ("tmp" ).Schema ()
229
229
output , err := yaml .JSONToYAML (valuesSchema .OpenAPIv3 .Raw )
230
230
require .NoError (t , err )
231
231
require .Equal (t , test .want , string (output ), "Expected valuesSchema to match" )
@@ -242,7 +242,7 @@ func TestHelmValuesSchemaGen_Schema_EmptyFile(t *testing.T) {
242
242
fileName := "values.yaml"
243
243
err = os .WriteFile (filepath .Join (dirName , fileName ), []byte ("" ), fs .ModePerm )
244
244
require .NoError (t , err )
245
- valuesSchema , err := release .NewHelmValuesSchemaGen ("tmp" ).Schema ()
245
+ valuesSchema , err := schemagenerator .NewHelmValuesSchemaGen ("tmp" ).Schema ()
246
246
require .NoError (t , err )
247
247
require .Equal (t , 0 , len (valuesSchema .OpenAPIv3 .Raw ), "Expected valuesSchema.OpenAPIv3.Raw to be empty" )
248
248
}
@@ -254,7 +254,7 @@ func TestHelmValuesSchemaGen_Schema_File_Not_Present(t *testing.T) {
254
254
dirName := "tmp"
255
255
err := os .Mkdir (dirName , fs .ModePerm )
256
256
require .NoError (t , err )
257
- valuesSchema , err := release .NewHelmValuesSchemaGen ("tmp" ).Schema ()
257
+ valuesSchema , err := schemagenerator .NewHelmValuesSchemaGen ("tmp" ).Schema ()
258
258
require .NoError (t , err )
259
259
require .Equal (t , 0 , len (valuesSchema .OpenAPIv3 .Raw ), "Expected valuesSchema.OpenAPIv3.Raw to be empty" )
260
260
}
0 commit comments