mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-31 02:08:13 +00:00 
			
		
		
		
	Merge pull request #52382 from spiffxp/test-apps-go-junit-repot
Automatic merge from submit-queue (batch tested with PRs 52376, 52439, 52382, 52358, 52372) Workaround go-junit-report bug for TestApps **What this PR does / why we need it**: Fix output from pkg/kubectl/apps/TestApps unit test **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #51253 **Special notes for your reviewer**: Literally copy-pasta of the approach taken in #45320. Maybe a sign that this should be extracted into something shared. I'm just trying to see if we can make https://k8s-testgrid.appspot.com/kubernetes-presubmits and https://k8s-testgrid.appspot.com/release-master-blocking a little more green for now. ```release-note NONE ```
This commit is contained in:
		| @@ -37,6 +37,8 @@ go_test( | |||||||
|     deps = [ |     deps = [ | ||||||
|         ":go_default_library", |         ":go_default_library", | ||||||
|         "//vendor/github.com/onsi/ginkgo:go_default_library", |         "//vendor/github.com/onsi/ginkgo:go_default_library", | ||||||
|  |         "//vendor/github.com/onsi/ginkgo/config:go_default_library", | ||||||
|  |         "//vendor/github.com/onsi/ginkgo/types:go_default_library", | ||||||
|         "//vendor/github.com/onsi/gomega:go_default_library", |         "//vendor/github.com/onsi/gomega:go_default_library", | ||||||
|     ], |     ], | ||||||
| ) | ) | ||||||
|   | |||||||
| @@ -17,13 +17,33 @@ limitations under the License. | |||||||
| package apps_test | package apps_test | ||||||
|  |  | ||||||
| import ( | import ( | ||||||
| 	"testing" |  | ||||||
|  |  | ||||||
| 	. "github.com/onsi/ginkgo" | 	. "github.com/onsi/ginkgo" | ||||||
|  | 	. "github.com/onsi/ginkgo/config" | ||||||
|  | 	. "github.com/onsi/ginkgo/types" | ||||||
| 	. "github.com/onsi/gomega" | 	. "github.com/onsi/gomega" | ||||||
|  |  | ||||||
|  | 	"fmt" | ||||||
|  | 	"testing" | ||||||
| ) | ) | ||||||
|  |  | ||||||
| func TestApps(t *testing.T) { | func TestApps(t *testing.T) { | ||||||
| 	RegisterFailHandler(Fail) | 	RegisterFailHandler(Fail) | ||||||
| 	RunSpecs(t, "Apps Suite") | 	RunSpecsWithDefaultAndCustomReporters(t, "Apps Suite", []Reporter{newlineReporter{}}) | ||||||
| } | } | ||||||
|  |  | ||||||
|  | // Print a newline after the default newlineReporter due to issue | ||||||
|  | // https://github.com/jstemmer/go-junit-report/issues/31 | ||||||
|  | type newlineReporter struct{} | ||||||
|  |  | ||||||
|  | func (newlineReporter) SpecSuiteWillBegin(config GinkgoConfigType, summary *SuiteSummary) {} | ||||||
|  |  | ||||||
|  | func (newlineReporter) BeforeSuiteDidRun(setupSummary *SetupSummary) {} | ||||||
|  |  | ||||||
|  | func (newlineReporter) AfterSuiteDidRun(setupSummary *SetupSummary) {} | ||||||
|  |  | ||||||
|  | func (newlineReporter) SpecWillRun(specSummary *SpecSummary) {} | ||||||
|  |  | ||||||
|  | func (newlineReporter) SpecDidComplete(specSummary *SpecSummary) {} | ||||||
|  |  | ||||||
|  | // SpecSuiteDidEnd Prints a newline between "35 Passed | 0 Failed | 0 Pending | 0 Skipped" and "--- PASS:" | ||||||
|  | func (newlineReporter) SpecSuiteDidEnd(summary *SuiteSummary) { fmt.Printf("\n") } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Kubernetes Submit Queue
					Kubernetes Submit Queue