-
-
Notifications
You must be signed in to change notification settings - Fork 665
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
Failed to compile <package>: output file "<test binary>" could not be found #427
Comments
Hello, The problem seems that ginkgo does not check whether there are any test files that could be compiled into a test binary. Applying the following diff resolves the problem: diff --git a/ginkgo/testrunner/test_runner.go b/ginkgo/testrunner/test_runner.go
index e129136..7bbea4a 100644
--- a/ginkgo/testrunner/test_runner.go
+++ b/ginkgo/testrunner/test_runner.go
@@ -23,6 +23,7 @@ import (
type TestRunner struct {
Suite testsuite.TestSuite
+ noTestFiles bool
compiled bool
compilationTargetPath string
@@ -151,6 +152,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) {
@@ -224,6 +230,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 { Let me know if any more debugging is needed on my side. If you're OK with the proposed change, I'd be happy to send a PR. Cheers, |
Hey, I run into the same issue and prepared your changes as a fix. Bear with me! 🙏 |
I'm working through the backlog of old Ginkgo issues - apologies as this issue is probably stale now. I've added this to the v2 backlog. |
My environment
I'm running using ginkgo 747514b.
Go version is
go version go1.9.2 darwin/amd64
Go env:
What I'm trying to do
Run the following commands:
What I expect to see
No failure as there are no test cases.
What I see instead
I've tested the same sequence of commands, but using
go test
instead ofginkgo -r
, and it works just fine:I have not looked at ginkgo`s source code in order to troubleshoot the problem. I plan to do so tomorrow.
Thanks for your awesome work!
Ivan
The text was updated successfully, but these errors were encountered: