-
Notifications
You must be signed in to change notification settings - Fork 542
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
[SUREFIRE-2010] Parameterized Selection Does not Work #476
base: master
Are you sure you want to change the base?
Conversation
Hi @DaGeRe , The JIRA is not well suited to read code patches. We can discuss the code even if the CI would fail. |
{ | ||
@Test | ||
public void testJUnit4() { | ||
OutputValidator validator = unpack("surefire-2010-parameterized-selection-does-not-work").executeTest(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OutputValidator validator =
is useless.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was only for starting. The plan is to run it once with all tests and than with a selector.
Now, I've added
TestFile surefireReportsFile = validator.getSurefireReportsFile( "de.dagere.peass.ExampleTestJUnit4.txt" );
surefireReportsFile.assertContainsText( "Tests run: 2" );
which unfortunately fails.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to this parent POM specifies <forkMode>never</forkMode>
it is a problem for all ITs and the tests won't run in a fork mode. There are two alternatives how to solve this. Override the parameter to the default value <forkMode>once</forkMode>
or use <version>${surefire.version}</version>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I've added the forkMode
.
import org.junit.runners.Parameterized; | ||
import org.junit.runners.Parameterized.Parameters; | ||
|
||
@RunWith(Parameterized.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to adjust the code style in these files well.
Pls configure your IDE, here is instructions and code style XML for your IDEs:
https://maven.apache.org/developers/conventions/code.html#intellij-idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank, I've imported the style and hopefully reformatted it correctly.
@DaGeRe |
Thanks for the hints. I adapted the code, but is there any part of the maven launcher which allows to pass something like
I can debug this with |
Make sure to use org.apache.maven.surefire.its.fixture.SurefireLauncher#sysProp to add the option and not the execute method |
The best way to pass something like unpack( "surefire-2010-parameterized-selection-does-not-work" )
.setTestToRun( "MySelector" )
.executeTest(); |
Hi all! Any news about this problem? Is still actual on maven 3.1.2 and Junit 5.10.1 |
Guys, can somebody to help? |
This pull request provides the example project for an integration test, that checks whether selectors are able to select parameterized tests, e.g.
package.TestClazz#method[1]
, where 1 is the index of the test.Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[SUREFIRE-XXX] - Fixes bug in ApproximateQuantiles
,where you replace
SUREFIRE-XXX
with the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean install
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean install
).To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.