Skip to content

Commit de95e75

Browse files
committed
pkg/repo: Copy repo validation test in
Signed-off-by: Stephen Augustus <[email protected]>
1 parent d70652e commit de95e75

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

pkg/repo/repo_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
"k8s.io/enhancements/pkg/repo"
2929
)
3030

31-
func TestValidate(t *testing.T) {
31+
func TestProposalValidate(t *testing.T) {
3232
testcases := []struct {
3333
name string
3434
file string

pkg/repo/validate_test.go

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
Copyright 2021 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package repo_test
18+
19+
import (
20+
"testing"
21+
22+
"github.com/stretchr/testify/require"
23+
24+
"k8s.io/enhancements/pkg/repo"
25+
)
26+
27+
func TestRepoValidate(t *testing.T) {
28+
r, repoErr := repo.New("testdata")
29+
require.Nil(t, repoErr)
30+
31+
warnings, valErrMap, err := r.Validate()
32+
require.Nil(t, err)
33+
require.Len(t, valErrMap, 0)
34+
35+
t.Logf(
36+
"KEP validation succeeded, but the following warnings occurred: %v",
37+
warnings,
38+
)
39+
}

0 commit comments

Comments
 (0)