Skip to content
This repository has been archived by the owner on Nov 20, 2019. It is now read-only.

Parse parallel tests #29

Open
tebeka opened this issue Aug 27, 2016 · 4 comments
Open

Parse parallel tests #29

tebeka opened this issue Aug 27, 2016 · 4 comments

Comments

@tebeka
Copy link
Owner

tebeka commented Aug 27, 2016

Originally BitBucket issue 12

calmh

jb@syno:~/s/g/s/s/l/protocol $ go test -short -v > results.txt
jb@syno:~/s/g/s/s/l/protocol $ go2xunit < results.txt
error: 36: orphan end test

results.txt

tebeka

This has been discussed before, and this means guessing. I might consider guess with something like --guess-parallel command line switch - patches are welcome :)

calmh

I'm sorry, can you elaborate on what the guessing entails? Do you mean for capturing random stdout output that is not sent through t.Log() and so on? Because all other output and the result status is correctly attached to the test name as far as I can tell, i.e.

jb@syno:~/t/part $ go test -v
=== RUN   TestPar1Success
=== RUN   TestPar2Success
=== RUN   TestPar3Error
=== RUN   TestPar4Error
=== RUN   TestPar5Skip
--- SKIP: TestPar5Skip (0.00s)
    par_test.go:33: skip
--- FAIL: TestPar3Error (0.30s)
    par_test.go:22: bug
--- FAIL: TestPar4Error (0.31s)
    par_test.go:28: fail
--- PASS: TestPar1Success (0.34s)
--- PASS: TestPar2Success (0.34s)
FAIL

In fact, it seems like the "RUN" lines could in principle be ignored and just the status, timestamp and output collected, which will look the same regardless if we're in parallel mode or not...

tebeka

Hmm - seems like I need to think a bit more on this. My concern was that random output will be randomly added to different tests and one PASS will not be match to the right RUN. Looking at the sources of testing packages, there's fmt.Printf("=== RUN %s\n", t.name) which might collide with other tests IMO. I'll re-open and have a look soon-ish.

@misabel
Copy link

misabel commented Nov 10, 2016

Any updates on this issue?

@tebeka
Copy link
Owner Author

tebeka commented Nov 11, 2016

Not yet. I'm doing a big rewrite now to allow streaming (see #41) and will try to add experimental support for parallel tests as well.

@utrack
Copy link

utrack commented Apr 19, 2017

Interesting thing:

=== RUN   Test__NewServer_returns_no_hits
=== RUN   Test__Server_with_defined_hits_returns_results
--- PASS: Test__Server_with_defined_hits_returns_results (0.00s)
=== RUN   Test__Search_over_unknown_index_returns_404
--- PASS: Test__Search_over_unknown_index_returns_404 (0.00s)
--- PASS: Test__NewServer_returns_no_hits (0.00s)
PASS
coverage: 47.9% of statements
ok  	search_api/lib/estest	0.013s

^ works, but

=== RUN   Test__NewServer_returns_no_hits
=== RUN   Test__Server_with_defined_hits_returns_results
=== RUN   Test__Search_over_unknown_index_returns_404
--- PASS: Test__Server_with_defined_hits_returns_results (0.00s)
--- PASS: Test__Search_over_unknown_index_returns_404 (0.00s)
--- PASS: Test__NewServer_returns_no_hits (0.00s)
PASS
coverage: 47.9% of statements
ok  	search_api/lib/estest	0.013s

does not.

@tebeka
Copy link
Owner Author

tebeka commented Apr 19, 2017

Sorry, slow going on this one. Will try to speed it up.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants