Skip to content

Commit

Permalink
test: Init with KEP metadata test from cmd/kepval
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Augustus <foo@auggie.dev>
  • Loading branch information
justaugustus committed Feb 2, 2021
1 parent aed343d commit 322997e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hack/verify-kep-metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
cd "${ROOT}"

# run the tests
GO111MODULE=on go test ./cmd/kepval/...
GO111MODULE=on go test ./test/metadata_test.go
9 changes: 9 additions & 0 deletions test/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See the OWNERS docs at https://go.k8s.io/owners

approvers:
- kep-tools-approvers
reviewers:
- kep-tools-reviewers

labels:
- area/enhancements
6 changes: 3 additions & 3 deletions cmd/kepval/main_test.go → test/metadata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

package main
package test

import (
"os"
Expand All @@ -37,7 +37,7 @@ func TestValidation(t *testing.T) {
// Find all the keps
files := []string{}
err := filepath.Walk(
filepath.Join("..", "..", kepsDir),
filepath.Join("..", kepsDir),
func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
Expand Down Expand Up @@ -148,7 +148,7 @@ func TestValidation(t *testing.T) {
// TODO: Is this a duplicate of the package function?
// ignore certain files in the keps/ subdirectory
func ignore(dir, name string) bool {
if dir == "../../keps/NNNN-kep-template" {
if dir == "../keps/NNNN-kep-template" {
return true // ignore the template directory because its metadata file does not use a valid sig name
}

Expand Down

0 comments on commit 322997e

Please sign in to comment.