Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Oct 20 10:53
    3rdstage commented #1403
  • Oct 20 10:25
    bric3 commented on 8622b6d
  • Oct 20 04:45
    asinbow synchronize #133
  • Oct 19 08:22
    sbrannen edited #1154
  • Oct 19 08:20
    sbrannen labeled #2452
  • Oct 19 08:20
    sbrannen closed #2452
  • Oct 19 08:20
    sbrannen commented #2452
  • Oct 19 08:18
    sbrannen labeled #2452
  • Oct 19 08:18
    sbrannen labeled #2452
  • Oct 19 08:18
    sbrannen labeled #2452
  • Oct 18 22:50
    l0s edited #2449
  • Oct 18 21:56
    l0s edited #2449
  • Oct 18 21:55
    codecov[bot] commented #2449
  • Oct 18 21:55
    codecov[bot] commented #2449
  • Oct 18 21:55
    l0s synchronize #2449
  • Oct 18 19:12
    angelyan edited #2454
  • Oct 18 18:56
    angelyan synchronize #2454
  • Oct 18 18:32
    angelyan edited #2454
  • Oct 18 18:32
    angelyan edited #2454
  • Oct 18 18:32
    angelyan edited #2454
Steve Ebersole
@sebersole
Ok, will do. Thanks Christian
Christian Stein
@sormuras
You're welcome.
Steve Ebersole
@sebersole
TaraFan
@TaraFan_1_twitter
Hello!
I've used junit in the past along with rest assured in order to test an app
It was a small app, with the number of test cases under 500. I was able to write code for unique test cases and use the parameterised runner for parametric test cases
Now however, I see myself testing a huge app with potentially thousands of test cases
Not only that, there is an expectation that I set up CI as well.
TaraFan
@TaraFan_1_twitter
This is an issue for me since these are api test cases, they are not really unit tests I can run during build creation
2 replies
They need to be run after the app has been built and deployed on a staging server
So my question is, with junit5, can I get away without writing code of all my test cases?
I'm thinking of using postman for writing all of test cases manually and then once I'm done, I'll save it to a DB.
When the tests need to run, I would like to pull them from the DB and feed it to junit which will run them for me
So I'm thinking, I'll go with a few, very generic tests parametric tests.
TaraFan
@TaraFan_1_twitter
Before executing junit, just populate ,say, csv files using the DB and use these for the parametric tests
I feel this might work but I also feel with junit 5 there might be a better solution
What do you guys think :-)
2 replies
Johnathan Gilday
@gilday

I love parallel test execution in JUnit 5. I'm working on optimizing a large, parallel test suite today.

The tests' assertions block while they wait for messages from an MQ broker. While a test is blocked waiting for messages to assert, I'd like to somehow communicate to the ForkJoinPool running the tests that it should proceed to execute another test case. I'm going to consider some options like

  • Execute the blocking assertions in a new ForkJoinTask
  • Introduce ForkJoinPool.ManagedBlocker to the blocking assertions
  • See what it would take to allow "async tests" e.g. test methods that return a CompletableFuture

If anyone has experimented with this before, I'd be happy to hear some lessons learned 😄

Johnathan Gilday
@gilday
ForkJoinPool.ManagedBlocker yields good results in some experiments. I'm going to follow through on that option
Michal Bernhard
@michalbcz

JUnit documentation for @Disabled use word "should" in "should not be executed" - does it mean something special?

I understand word "should" as something which may happen, but it's not 100% sure. Like they say in https://tools.ietf.org/html/rfc2119. So when I read this javadoc I wonder if it's indicate something or if it's just wrong wording (and rather "shall not be executed" should be used).

Opinions? Thanks.

Sam Brannen
@sbrannen
@michalbcz, the JUnit 5 documentation does not aim to adhere to the Key words for use in RFCs to Indicate Requirement Levels. In the context of the @Disabled annotation, the word "should" can safely be interpreted as "shall" if that makes it clearer for you.
For the sake of clarity, we could consider changing the text to read:
@Disabled is used to signal that the annotated test class or test method is currently disabled and will not be executed.
Feel free to create an issue on GitHub if you like.
Sam Brannen
@sbrannen
FWIW, the use of "should" is quite prevalent across the documentation, and that's likely because that's simply they way I talk.
Pengcheng Zhou(Kevin)
@KevinZhou92
Hi Junit5 team, do you know how can i capture the full stack trace in junit output? I'm doing my load test with junit5 framework, however, junit only returns me something like
2020-09-23T17:23:47.492(EDT) [pool-1-thread-1] INFO org.jsmart.zerocode.jupiter.load.JupiterLoadProcessor - 
###JUnit5: Test Failed Due To --> null, 
testIdentifier=TestIdentifier [uniqueId =
ardit-ubt
@ardit-ubt
Anyone knows some good resources to look into for unit testing with Quarkus & JUnit5?
Andreas Paschwitz
@paschi
Hi JUnit team! I'm currently developing a JUnit5 extension (with JUnit 5.7.0) which creates some test data before each test and cleans it up afterwards. For that I'm using the TestInstancePostProcessor and TestInstancePreDestroyCallback. When testing with nested test classes, there seem to be some things happening which I'm not quite sure if they're intended: When the lifecycle of the enclosing class is PER_METHOD, then an instance of the enclosing class is created for the tests in the nested class (as well as one or more nested instances, depending on the lifecycle of the nested class). The post-process hook is called for the enclosing instance and the nested instances, but the pre-destroy hook is only called for the nested instances and not for the enclosing instance. This seems to be inconsistent to me. Is this supposed to work that way?
Sam Brannen
@sbrannen
@paschi That sounds like it might be a bug. Can you please open an issue with a sample application demonstrating the problem? https://github.com/junit-team/junit5/issues/new/choose
Andreas Paschwitz
@paschi
@sbrannen Sure, will do.
Jorge Viana
@jorgeviana
Hello all, I was wondering why junit doesn't have a PendingFeature annotation, like in Spock.
This would be very useful to write bdd style tests, for features that are currently being developed but not finished.
Jorge Viana
@jorgeviana
Well.
Well 🙂 Actually it seems it is not very hard to implement with the Extensions mechanism. I'll try to have a go with that.
Sergey
@romankovsv
Hi Guys, I am running tests with ConsoleLauncher using Cucumber, tests run correctly, but the configuration for reporting seems completely ignored, could you please help me out
task consoleLauncherTest(type:JavaExec) { dependsOn(testClasses) def reportsDir = file("$buildDir/test-results") outputs.dir(reportsDir) classpath = sourceSets["test"].runtimeClasspath main = "org.junit.platform.console.ConsoleLauncher" args("--scan-classpath") args("--include-engine", "cucumber") args("--reports-dir", reportsDir) }
task consoleLauncherTest(type:JavaExec) {
dependsOn(testClasses)
def reportsDir = file("$buildDir/test-results")
outputs.dir(reportsDir)
classpath = sourceSets["test"].runtimeClasspath
main = "org.junit.platform.console.ConsoleLauncher"
args("--scan-classpath")
args("--include-engine", "cucumber")
args("--reports-dir", reportsDir)
}
I have following config for Ccucumber

@Cucumber
@CucumberOptions(
glue = {"stepdefs"},
plugin = {"html:build/cucumber-reports/report.html"},
features = {"src/test/resources/features"})
public class CucumberRunnerTest {

}

Yura
@22f
Hi guys! junit.org seem's to be down and unavalaible. Is it known?
Christian Stein
@sormuras
ardit-ubt
@ardit-ubt
hi guys, I need some advice on how to create a test runner class using Junit5 for unit tests; also is there a possibility to create a (@Before) method which will be executed before any test in any class, not like the @BeforeEach methods which apply only to a single class methods?
Jonathan Bluett-Duncan
@jbduncan
@ardit-ubt Yep, I believe what you're after is @BeforeAll: it runs once before every test in the test class it's defined in. I hope this helps.
ardit-ubt
@ardit-ubt
@jbduncan not really, I'm aware of '@BeforeAll' but it only runs before the tests in the test class it's defined. I'm looking for a global setup (init) method which will run before any test in any class...
2 replies
Carlos Macasaet
@l0s
Hi, I'm interested in contributing to junit-team/junit5#2229, but I'd like a clarification on the requirements. ( more in thread )
3 replies
Kevin Choi
@kevinyc-dri
hello I need to create several assignments in repl.it teams and for each assignment I need to create tests...are there any resources that anyone can point me to?
CALDEJOS
@joscompu
JUnit 5 = Plataforma JUnit + JUnit Júpiter + JUnit Vintage

Hi good day.

I am new to recommended tests to start

Thank you very much

Johnathan Gilday
@gilday
Is there a way for an Extension to know that it is running in the EngineTestKit? I'm working on an ExecutionCondition that would disable tests unless they're being run in the EngineTestKit
Filip Hrisafov
@filiphr
Hey everyone, I've played around the JUnit Jupiter API in order to migrate one of our JUnit 4 Runners. One way to achieve what I need would be through a LauncherDiscoveryListener. The only way that a custom one can be done, without my writing my own engine is if I can register one via an SPI. In order to achieve that I came up with filiphr/junit5@f92e4b7. There are no tests yet, but if the JUnit team agrees to the approach in that commit I am going to write the tests and create a PR. Is it worth it if I spend more time on this or is it something that is out of the question?