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

No output for ran tests with junit + maven #82

Open
lefou opened this issue Oct 1, 2014 · 4 comments
Open

No output for ran tests with junit + maven #82

lefou opened this issue Oct 1, 2014 · 4 comments

Comments

@lefou
Copy link

lefou commented Oct 1, 2014

After trying the little example ("a pair of numbers") from the README.md page in a Maven project, I can't see the expected output:

a pair of numbers
  2 / 4 is two
  8 / 4 is two

but instead this:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.example.BehaveTest
Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.391 sec - in org.example.BehaveTest

Results :

Tests run: 2, Failures: 0, Errors: 0, Skipped: 0

How to enable the expected output from above (at least one line for each ran test)?

@lefou
Copy link
Author

lefou commented Dec 1, 2014

This ticket resp. the answer to this question isn't that important to me anymore. (I started a very simple project (Poor Mans Lambda Test, here on GitHub) based on TestNG, which does exactly what I wanted (tests as lambdas, nice colored output, ...) for Java.)

But, can it be you just overlooked this issue or is it the question? Is the expectation to see some nice output per test (e.g. the test name, as said on the Readme) wrong?

Best regards

@RichardWarburton
Copy link
Owner

Hi Tobias,

My apologies for not getting back to you earlier - slipped through my radar.

The amount/type of output that you get depends on what runner you're using. If you're running in an IDE you'll see a nice report and if you're running the tests through the scala-test runner you'll get a nice printed output on the commandline.

Unfortunately if you're using junit + maven as your runner harness you get what junit + maven offers - which is very little in the way of output. I'm going to leave this issue open but rename it to be a bit more precise. I will look into this issue - but its on the backlog as of now. Pull requests welcome.

@RichardWarburton RichardWarburton changed the title No output for ran tests No output for ran tests with junit + maven Dec 3, 2014
@lefou
Copy link
Author

lefou commented Dec 3, 2014

Thanks for your reply. As I told you above, I decided to not use LambdaBehave (for now) but created my own project, a really simple Layer on top of TestNG which actually prints these nice messages in all existing runners (Ant, Maven, standalone). As I use simple STDOUT printing (as I said, very simple) while the tests gets executed, I guess it should not be that hard to add such an output to LambdaBehave too. Feel free to borrow what you need: https://github.com/lefou/poor-mans-lambda-test/blob/master/src/main/java/de/tobiasroeser/lambdatest/testng/FreeSpec.java

I'd argue, that requiring a Maven user to configure a scalatest runner is already too inconvenient. Also, AFAIK you would still have to write an XML test suite or something like that, to get your tests executed with scalatest, don't you?

At least for me as a long time Scala and ScalaTest user, I was searching for something comparable to ScalaTest but for a pure Java8 project (to avoid all the extra non-default configuration in Maven).

Edit: I just fixed the mistaken name "JBehave" with "LambdaBehave"

@RichardWarburton
Copy link
Owner

Thanks for your reply, but just to clarify:

  • I wasn't recommending that people use scala-test - I was just using it as an example of a runner that gives nice formatting.
  • I'll investigate the available options for nicer reporting. I might well end up writing a custom runner for maven and intellij in order to get better lambda-behave integration into these projects. Any custom runner will have really nice reports.

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

No branches or pull requests

2 participants