Skip to content

Commit

Permalink
remove prow ginkgo helper
Browse files Browse the repository at this point in the history
  • Loading branch information
schrej committed Aug 17, 2022
1 parent ccc5b15 commit 3b34d95
Show file tree
Hide file tree
Showing 39 changed files with 16 additions and 243 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

# Test binary, build with `go test -c`
*.test
test-report.xml

junit-report.xml

# Output of the go coverage tool, specifically when used with LiteIDE
*.out
Expand Down
15 changes: 13 additions & 2 deletions hack/test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,19 @@ source ${hack_dir}/common.sh

header_text "running tests using ginkgo"

${hack_dir}/tools/bin/ginkgo --junit-report test-report.xml --keep-going --race -r ${P_FLAG} ${MOD_OPT}
if [[ -n ${ARTIFACTS:-} ]]; then
GINKGO_ARGS="--junit-report junit-report.xml"
fi

ginkgo_result=0
${hack_dir}/tools/bin/ginkgo --keep-going --race -r ${GINKGO_ARGS} ${P_FLAG} ${MOD_OPT} || ginkgo_result=$?

if [[ -n ${ARTIFACTS:-} ]]; then
if grep -Rin '<failure type="Failure">' ${ARTIFACTS}/*; then exit 1; fi
mv ./junit-report.xml ${ARTIFACTS}/junit-report.xml
fi

# if [[ -n ${ARTIFACTS:-} ]]; then
# if grep -Rin '<failure type="Failure">' ${ARTIFACTS}/*; then exit 1; fi
# fi

exit $ginkgo_result
5 changes: 0 additions & 5 deletions pkg/builder/builder_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"k8s.io/client-go/rest"

"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
"sigs.k8s.io/controller-runtime/pkg/internal/testing/addr"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
Expand Down Expand Up @@ -76,10 +75,6 @@ var _ = AfterSuite(func() {
webhook.DefaultPort = 9443
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})

func addCRDToEnvironment(env *envtest.Environment, gvks ...schema.GroupVersionKind) {
for _, gvk := range gvks {
plural, singular := meta.UnsafeGuessKindToResource(gvk)
Expand Down
5 changes: 0 additions & 5 deletions pkg/cache/cache_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand Down Expand Up @@ -56,7 +55,3 @@ var _ = BeforeSuite(func() {
var _ = AfterSuite(func() {
Expect(testenv.Stop()).To(Succeed())
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/cache/internal/internal_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
)

const suiteName = "Cache Internal Suite"
Expand All @@ -30,7 +29,3 @@ func TestSource(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, suiteName)
}

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/certwatcher/certwatcher_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand All @@ -47,7 +46,3 @@ var _ = AfterSuite(func() {
_ = os.Remove(file)
}
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/client/apiutil/apiutil_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"

logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
Expand All @@ -43,7 +42,3 @@ var _ = BeforeSuite(func() {
// for things that technically need a rest.Config for defaulting, but don't actually use them
cfg = &rest.Config{}
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/client/client_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/examples/crd/pkg"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"

logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
Expand Down Expand Up @@ -61,7 +60,3 @@ var _ = BeforeSuite(func() {
var _ = AfterSuite(func() {
Expect(testenv.Stop()).To(Succeed())
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/client/config/config_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand All @@ -37,7 +36,3 @@ func TestConfig(t *testing.T) {
var _ = BeforeSuite(func() {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/client/fake/client_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"

logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
Expand All @@ -37,7 +36,3 @@ func TestSource(t *testing.T) {
var _ = BeforeSuite(func() {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/cluster/cluster_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand Down Expand Up @@ -69,7 +68,3 @@ var _ = BeforeSuite(func() {
var _ = AfterSuite(func() {
Expect(testenv.Stop()).To(Succeed())
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
6 changes: 0 additions & 6 deletions pkg/config/config_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
)

const suiteName = "Config Suite"
Expand All @@ -31,7 +29,3 @@ func TestScheme(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, suiteName)
}

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/controller/controller_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (

"sigs.k8s.io/controller-runtime/pkg/controller/controllertest"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
"sigs.k8s.io/controller-runtime/pkg/metrics"
Expand Down Expand Up @@ -91,7 +90,3 @@ var _ = AfterSuite(func() {
// Put the DefaultBindAddress back
metrics.DefaultBindAddress = ":8080"
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/controller/controllerutil/controllerutil_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
)

const suiteName = "Controllerutil Suite"
Expand Down Expand Up @@ -54,7 +53,3 @@ var _ = BeforeSuite(func() {
var _ = AfterSuite(func() {
Expect(testenv.Stop()).To(Succeed())
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/envtest/envtest_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
admissionv1 "k8s.io/api/admissionregistration/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand Down Expand Up @@ -135,7 +134,3 @@ func initializeWebhookInEnvironment() {
var _ = AfterSuite(func() {
Expect(env.Stop()).NotTo(HaveOccurred())
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
53 changes: 0 additions & 53 deletions pkg/envtest/printer/prow.go

This file was deleted.

5 changes: 0 additions & 5 deletions pkg/finalizer/finalizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
)

type mockFinalizer struct {
Expand Down Expand Up @@ -216,7 +215,3 @@ var _ = Describe("TestFinalizer", func() {
})
})
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/handler/eventhandler_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
. "github.com/onsi/gomega"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand All @@ -50,7 +49,3 @@ var _ = BeforeSuite(func() {
var _ = AfterSuite(func() {
Expect(testenv.Stop()).To(Succeed())
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/healthz/healthz_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand All @@ -36,7 +35,3 @@ func TestHealthz(t *testing.T) {
var _ = BeforeSuite(func() {
logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true)))
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/internal/controller/controller_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand Down Expand Up @@ -56,7 +55,3 @@ var _ = BeforeSuite(func() {
var _ = AfterSuite(func() {
Expect(testenv.Stop()).To(Succeed())
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
5 changes: 0 additions & 5 deletions pkg/internal/recorder/recorder_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"sigs.k8s.io/controller-runtime/pkg/envtest"
"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
logf "sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/log/zap"
)
Expand Down Expand Up @@ -56,7 +55,3 @@ var _ = BeforeSuite(func() {
var _ = AfterSuite(func() {
Expect(testenv.Stop()).To(Succeed())
})

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
6 changes: 0 additions & 6 deletions pkg/internal/testing/addr/addr_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import (

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"sigs.k8s.io/controller-runtime/pkg/envtest/printer"
)

const suiteName = "Addr Suite"
Expand All @@ -32,7 +30,3 @@ func TestAddr(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, suiteName)
}

var _ = ReportAfterSuite("Report to Prow", func(report Report) {
printer.AddReport(report, suiteName)
})
Loading

0 comments on commit 3b34d95

Please sign in to comment.