From cf77588d1ba41e86376ab72bb976167d98328606 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Wed, 3 Apr 2019 15:34:55 +0200 Subject: [PATCH] Fix ginkgo test runner when no test available Signed-off-by: Sascha Grunert --- ginkgo/testrunner/test_runner.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ginkgo/testrunner/test_runner.go b/ginkgo/testrunner/test_runner.go index dccb39518..b35c6af82 100644 --- a/ginkgo/testrunner/test_runner.go +++ b/ginkgo/testrunner/test_runner.go @@ -24,6 +24,7 @@ import ( type TestRunner struct { Suite testsuite.TestSuite + noTestFiles bool compiled bool compilationTargetPath string @@ -156,6 +157,11 @@ func (t *TestRunner) CompileTo(path string) error { fmt.Println(string(output)) } + if bytes.Contains(output, []byte("[no test files]")) { + t.noTestFiles = true + return nil + } + if fileExists(path) == false { compiledFile := t.Suite.PackageName + ".test" if fileExists(compiledFile) { @@ -229,6 +235,9 @@ func copyFile(src, dst string) error { } func (t *TestRunner) Run() RunResult { + if t.noTestFiles { + return PassingRunResult() + } if t.Suite.IsGinkgo { if t.numCPU > 1 { if t.parallelStream {