Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ginkgo test runner when no test available #570

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions ginkgo/testrunner/test_runner.go
Expand Up @@ -24,6 +24,7 @@ import (
type TestRunner struct {
Suite testsuite.TestSuite

noTestFiles bool
compiled bool
compilationTargetPath string

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down