diff --git a/.gitignore b/.gitignore index 9ec1cab47..7bf213cdc 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ junit.xml .generate_exes .generate_files checkouts +/report/*.xml +/release diff --git a/Makefile b/Makefile index 374d53c71..9d8b401dc 100644 --- a/Makefile +++ b/Makefile @@ -153,7 +153,7 @@ ut: vendor run-etcd run-kubernetes-master -v $(CURDIR):/go/src/github.com/$(PACKAGE_NAME):rw \ -v $(CURDIR)/.go-pkg-cache:/go-cache/:rw \ -e GOCACHE=/go-cache \ - $(CALICO_BUILD) sh -c 'cd /go/src/github.com/$(PACKAGE_NAME) && ginkgo -r --skipPackage vendor .' + $(CALICO_BUILD) sh -c 'cd /go/src/github.com/$(PACKAGE_NAME) && ginkgo -r --skipPackage vendor $(GINKGO_ARGS) .' ## Run etcd as a container (calico-etcd) run-etcd: stop-etcd diff --git a/lib/apis/v3/v3_suite_test.go b/lib/apis/v3/v3_suite_test.go index c5779857d..d3c54b0d5 100644 --- a/lib/apis/v3/v3_suite_test.go +++ b/lib/apis/v3/v3_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestV2(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "v3 API Suite") + junitReporter := reporters.NewJUnitReporter("../../../report/v3_api_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "v3 API Suite", []Reporter{junitReporter}) } diff --git a/lib/backend/backend_suite_test.go b/lib/backend/backend_suite_test.go index 85b334241..39d9c8a6e 100644 --- a/lib/backend/backend_suite_test.go +++ b/lib/backend/backend_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestEtcd(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Datastore backend Suite") + junitReporter := reporters.NewJUnitReporter("../../report/datastore_backend_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Datastore backend Suite", []Reporter{junitReporter}) } diff --git a/lib/backend/etcd/etcd_suite_test.go b/lib/backend/etcd/etcd_suite_test.go index ff4cc19c3..068a7c175 100644 --- a/lib/backend/etcd/etcd_suite_test.go +++ b/lib/backend/etcd/etcd_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestEtcd(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Etcd Suite") + junitReporter := reporters.NewJUnitReporter("../../../report/etcd_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Etcd Suite", []Reporter{junitReporter}) } diff --git a/lib/backend/etcdv3/etcdv3_suite_test.go b/lib/backend/etcdv3/etcdv3_suite_test.go index 9103ceb2e..aec176d8f 100644 --- a/lib/backend/etcdv3/etcdv3_suite_test.go +++ b/lib/backend/etcdv3/etcdv3_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestEtcd(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "EtcdV3 Suite") + junitReporter := reporters.NewJUnitReporter("../../../report/etcdv3_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "EtcdV3 Suite", []Reporter{junitReporter}) } diff --git a/lib/backend/k8s/conversion/conversion_suite_test.go b/lib/backend/k8s/conversion/conversion_suite_test.go index dd291f0ec..a44967771 100644 --- a/lib/backend/k8s/conversion/conversion_suite_test.go +++ b/lib/backend/k8s/conversion/conversion_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestConversion(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Conversion Suite") + junitReporter := reporters.NewJUnitReporter("../../../../report/conversion_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Conversion Suite", []Reporter{junitReporter}) } diff --git a/lib/backend/k8s/k8s_suite_test.go b/lib/backend/k8s/k8s_suite_test.go index dbc6ceda3..4a4d77753 100644 --- a/lib/backend/k8s/k8s_suite_test.go +++ b/lib/backend/k8s/k8s_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( "testing" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestModel(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "Model Suite") + junitReporter := reporters.NewJUnitReporter("../../../report/model_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Model Suite", []Reporter{junitReporter}) } diff --git a/lib/backend/k8s/resources/resources_suite_test.go b/lib/backend/k8s/resources/resources_suite_test.go index 4b6d610c5..77520487a 100644 --- a/lib/backend/k8s/resources/resources_suite_test.go +++ b/lib/backend/k8s/resources/resources_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( "testing" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestModel(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "K8s resources Suite") + junitReporter := reporters.NewJUnitReporter("../../../../report/k8s_resources_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "K8s resources Suite", []Reporter{junitReporter}) } diff --git a/lib/backend/model/model_suite_test.go b/lib/backend/model/model_suite_test.go index 0176ebdeb..d9b496a4c 100644 --- a/lib/backend/model/model_suite_test.go +++ b/lib/backend/model/model_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestModel(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Model Suite") + junitReporter := reporters.NewJUnitReporter("../../../report/model_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Model Suite", []Reporter{junitReporter}) } diff --git a/lib/backend/syncersv1/bgpsyncer/bgpsyncer_suite_test.go b/lib/backend/syncersv1/bgpsyncer/bgpsyncer_suite_test.go index 7996d57bd..fb55ab846 100644 --- a/lib/backend/syncersv1/bgpsyncer/bgpsyncer_suite_test.go +++ b/lib/backend/syncersv1/bgpsyncer/bgpsyncer_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestClient(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "BGP syncer test suite") + junitReporter := reporters.NewJUnitReporter("../../../../report/bgpsyncer_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "BGP syncer test suite", []Reporter{junitReporter}) } diff --git a/lib/backend/syncersv1/felixsyncer/felixsyncerv1_suite_test.go b/lib/backend/syncersv1/felixsyncer/felixsyncerv1_suite_test.go index 0db80e034..89832b520 100644 --- a/lib/backend/syncersv1/felixsyncer/felixsyncerv1_suite_test.go +++ b/lib/backend/syncersv1/felixsyncer/felixsyncerv1_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestClient(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "Felix syncer test suite") + junitReporter := reporters.NewJUnitReporter("../../../../report/felix_syncer_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Felix syncer test Suite", []Reporter{junitReporter}) } diff --git a/lib/backend/syncersv1/updateprocessors/updateprocessors_suite_test.go b/lib/backend/syncersv1/updateprocessors/updateprocessors_suite_test.go index 324239d2b..046ea5723 100644 --- a/lib/backend/syncersv1/updateprocessors/updateprocessors_suite_test.go +++ b/lib/backend/syncersv1/updateprocessors/updateprocessors_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestClient(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "Syncer update processors suite") + junitReporter := reporters.NewJUnitReporter("../../../../report/syncer_update_proc_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Syncer update processors suite", []Reporter{junitReporter}) } diff --git a/lib/backend/watchersyncer/watchersyncer_suite_test.go b/lib/backend/watchersyncer/watchersyncer_suite_test.go index e478d7eb8..5dd3bb438 100644 --- a/lib/backend/watchersyncer/watchersyncer_suite_test.go +++ b/lib/backend/watchersyncer/watchersyncer_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestClient(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "Backend multi-watcher/syncer test suite") + junitReporter := reporters.NewJUnitReporter("../../../report/backend_watcher_syncer_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Backend multi-watcher/syncer test suite", []Reporter{junitReporter}) } diff --git a/lib/clientv3/client_suite_test.go b/lib/clientv3/client_suite_test.go index de22b5045..bb7601408 100644 --- a/lib/clientv3/client_suite_test.go +++ b/lib/clientv3/client_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestClient(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "client Suite") + junitReporter := reporters.NewJUnitReporter("../../report/client_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "client Suite", []Reporter{junitReporter}) } diff --git a/lib/converter/converter_suite_test.go b/lib/converter/converter_suite_test.go index e9d9076fe..3a1fd53a7 100644 --- a/lib/converter/converter_suite_test.go +++ b/lib/converter/converter_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestConverter(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Converter Suite") + junitReporter := reporters.NewJUnitReporter("../../report/converter_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Converter Suite", []Reporter{junitReporter}) } diff --git a/lib/errors/errors_suite_test.go b/lib/errors/errors_suite_test.go index ab97497b8..dbcb65963 100644 --- a/lib/errors/errors_suite_test.go +++ b/lib/errors/errors_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestModel(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Errors Suite") + junitReporter := reporters.NewJUnitReporter("../../report/errors_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Errors Suite", []Reporter{junitReporter}) } diff --git a/lib/health/health_suite_test.go b/lib/health/health_suite_test.go index 7399149bb..e1a9b5c93 100644 --- a/lib/health/health_suite_test.go +++ b/lib/health/health_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( "testing" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestSet(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "Health Suite") + junitReporter := reporters.NewJUnitReporter("../../report/health_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Health Suite", []Reporter{junitReporter}) } diff --git a/lib/hwm/hwm_suite_test.go b/lib/hwm/hwm_suite_test.go index 6d349934d..0f1abc882 100644 --- a/lib/hwm/hwm_suite_test.go +++ b/lib/hwm/hwm_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestHwm(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "HWM Tracker Suite") + junitReporter := reporters.NewJUnitReporter("../../report/hwm_tracker_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "HWM Tracker Suite", []Reporter{junitReporter}) } diff --git a/lib/ipam/ipam_suite_test.go b/lib/ipam/ipam_suite_test.go index a65f74fb4..af07c9b58 100644 --- a/lib/ipam/ipam_suite_test.go +++ b/lib/ipam/ipam_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestIpam(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "IPAM Suite") + junitReporter := reporters.NewJUnitReporter("../../report/ipam_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "IPAM Suite", []Reporter{junitReporter}) } diff --git a/lib/jitter/jitter_suite_test.go b/lib/jitter/jitter_suite_test.go index 88d3ddac7..2f4b348bc 100644 --- a/lib/jitter/jitter_suite_test.go +++ b/lib/jitter/jitter_suite_test.go @@ -31,6 +31,6 @@ func init() { func TestJitter(t *testing.T) { RegisterFailHandler(Fail) - junitReporter := reporters.NewJUnitReporter("junit.xml") + junitReporter := reporters.NewJUnitReporter("../../report/jitter_suite.xml") RunSpecsWithDefaultAndCustomReporters(t, "Jitter Suite", []Reporter{junitReporter}) } diff --git a/lib/logutils/logutils_suite_test.go b/lib/logutils/logutils_suite_test.go index e5d3852f5..e86e9bd82 100644 --- a/lib/logutils/logutils_suite_test.go +++ b/lib/logutils/logutils_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2016-2018 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,6 +28,6 @@ import ( func TestLogutils(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - junitReporter := reporters.NewJUnitReporter("junit.xml") + junitReporter := reporters.NewJUnitReporter("../../report/logutils_suite.xml") RunSpecsWithDefaultAndCustomReporters(t, "Logutils Suite", []Reporter{junitReporter}) } diff --git a/lib/names/names_suite_test.go b/lib/names/names_suite_test.go index a1aaba6a1..557d085b5 100644 --- a/lib/names/names_suite_test.go +++ b/lib/names/names_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,10 +18,12 @@ import ( "testing" . "github.com/onsi/ginkgo" + "github.com/onsi/ginkgo/reporters" . "github.com/onsi/gomega" ) func TestClient(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "names Suite") + junitReporter := reporters.NewJUnitReporter("../../report/names_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "names Suite", []Reporter{junitReporter}) } diff --git a/lib/numorstring/numorstring_suite_test.go b/lib/numorstring/numorstring_suite_test.go index 5f7b6d105..9e70d47c9 100644 --- a/lib/numorstring/numorstring_suite_test.go +++ b/lib/numorstring/numorstring_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,9 +18,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestNumorstring(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Numorstring Suite") + junitReporter := reporters.NewJUnitReporter("../../report/numorstring_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Numorstring Suite", []Reporter{junitReporter}) } diff --git a/lib/selector/parser/parser_suite_test.go b/lib/selector/parser/parser_suite_test.go index 86bb72054..250cc0e86 100644 --- a/lib/selector/parser/parser_suite_test.go +++ b/lib/selector/parser/parser_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestParser(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Parser Suite") + junitReporter := reporters.NewJUnitReporter("../../../report/parser_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Parser Suite", []Reporter{junitReporter}) } diff --git a/lib/selector/selectors_suite_test.go b/lib/selector/selectors_suite_test.go index 9dfbdc419..a84ddfbb1 100644 --- a/lib/selector/selectors_suite_test.go +++ b/lib/selector/selectors_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestSelectors(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Selectors Suite") + junitReporter := reporters.NewJUnitReporter("../../report/selectors_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Selectors Suite", []Reporter{junitReporter}) } diff --git a/lib/selector/tokenizer/tokenizer_suite_test.go b/lib/selector/tokenizer/tokenizer_suite_test.go index f04ab7d55..40d6cbc4f 100644 --- a/lib/selector/tokenizer/tokenizer_suite_test.go +++ b/lib/selector/tokenizer/tokenizer_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestTokenizer(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Tokenizer Suite") + junitReporter := reporters.NewJUnitReporter("../../../report/tokenizer_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Tokenizer Suite", []Reporter{junitReporter}) } diff --git a/lib/set/set_suite_test.go b/lib/set/set_suite_test.go index 3577ad6eb..2ddc05457 100644 --- a/lib/set/set_suite_test.go +++ b/lib/set/set_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2016-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,6 +28,6 @@ import ( func TestSet(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - junitReporter := reporters.NewJUnitReporter("junit.xml") + junitReporter := reporters.NewJUnitReporter("../../report/set_suite.xml") RunSpecsWithDefaultAndCustomReporters(t, "Set Suite", []Reporter{junitReporter}) } diff --git a/lib/upgrade/migrator/clients/v1/k8s/resources/resources_suite_test.go b/lib/upgrade/migrator/clients/v1/k8s/resources/resources_suite_test.go index 4bb4909e6..4c8681a44 100644 --- a/lib/upgrade/migrator/clients/v1/k8s/resources/resources_suite_test.go +++ b/lib/upgrade/migrator/clients/v1/k8s/resources/resources_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,9 +19,12 @@ import ( . "github.com/onsi/gomega" "testing" + + "github.com/onsi/ginkgo/reporters" ) func TestModel(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Calico upgrade KDD v1 resources Suite") + junitReporter := reporters.NewJUnitReporter("../../../../../../../report/resources_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "Calico upgrade KDD v1 resources Suite", []Reporter{junitReporter}) } diff --git a/lib/upgrade/migrator/migrate_suite_test.go b/lib/upgrade/migrator/migrate_suite_test.go index 3bb2310fe..c68652ca9 100644 --- a/lib/upgrade/migrator/migrate_suite_test.go +++ b/lib/upgrade/migrator/migrate_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2017 Tigera, Inc. All rights reserved. +// Copyright (c) 2017-2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestClient(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "calico-upgrade migration pkg suite") + junitReporter := reporters.NewJUnitReporter("../../../report/migrate_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "calico-upgrade migration pkg suite", []Reporter{junitReporter}) } diff --git a/lib/validator/v1/validator_suite_test.go b/lib/validator/v1/validator_suite_test.go index 8a6a1b39b..b7d39b09e 100644 --- a/lib/validator/v1/validator_suite_test.go +++ b/lib/validator/v1/validator_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ import ( "testing" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) @@ -29,5 +30,6 @@ func init() { func TestValidator(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "Validator Suite") + junitReporter := reporters.NewJUnitReporter("../../../report/v1_validator_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "v1 Validator Suite", []Reporter{junitReporter}) } diff --git a/lib/validator/v3/validator_suite_test.go b/lib/validator/v3/validator_suite_test.go index 8e9d1db51..0ff30c0ed 100644 --- a/lib/validator/v3/validator_suite_test.go +++ b/lib/validator/v3/validator_suite_test.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Tigera, Inc. All rights reserved. +// Copyright (c) 2016,2018 Tigera, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,11 +20,13 @@ import ( "testing" + "github.com/onsi/ginkgo/reporters" "github.com/projectcalico/libcalico-go/lib/testutils" ) func TestValidator(t *testing.T) { testutils.HookLogrusForGinkgo() RegisterFailHandler(Fail) - RunSpecs(t, "Validator Suite") + junitReporter := reporters.NewJUnitReporter("../../../report/v3_validator_suite.xml") + RunSpecsWithDefaultAndCustomReporters(t, "v3 Validator Suite", []Reporter{junitReporter}) } diff --git a/report/README.txt b/report/README.txt new file mode 100644 index 000000000..62085d257 --- /dev/null +++ b/report/README.txt @@ -0,0 +1 @@ +// This directory is intended to hold the junit XML reports generated by fv and unit tests.