Skip to content

Commit

Permalink
separate custom openapi test from the others
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha41575 committed Oct 5, 2021
1 parent 0d8c107 commit 11e19a3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 22,040 deletions.
3 changes: 2 additions & 1 deletion Makefile
Expand Up @@ -229,7 +229,8 @@ generate-kustomize-api: $(MYGOBIN)/k8scopy

.PHONY: test-unit-kustomize-api
test-unit-kustomize-api: build-kustomize-api
cd api; go test ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222"
cd api; go test ./... -ldflags "-X sigs.k8s.io/kustomize/api/provenance.version=v444.333.222"; \
cd krusty; OPENAPI_TEST=true go test -run TestCustomOpenAPIFieldFromComponentWithOverlays

.PHONY: test-unit-kustomize-plugins
test-unit-kustomize-plugins:
Expand Down
5 changes: 5 additions & 0 deletions api/krusty/openapicustomschema_test.go
Expand Up @@ -5,6 +5,7 @@ package krusty_test

import (
"io/ioutil"
"os"
"testing"

"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -350,6 +351,10 @@ func TestCustomOpenAPIFieldFromComponent(t *testing.T) {
// test for https://github.com/kubernetes-sigs/kustomize/issues/4179
// kustomize is not seeing the openapi field from the component defined in the overlay
func TestCustomOpenAPIFieldFromComponentWithOverlays(t *testing.T) {
if val, ok := os.LookupEnv("OPENAPI_TEST"); !ok || val != "true" {
t.SkipNow()
}

th := kusttest_test.MakeHarness(t)

// overlay declaring the component
Expand Down

0 comments on commit 11e19a3

Please sign in to comment.