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

changing depedencies and build plan to be able to use parallel buld or mvnd and to be sure artifacts are available when running its use verifier in auto mode (e.g embedded most of the time) or mvnd and use verifier in auto mode (e.g embedded most of the time) #479

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ properties(
disableConcurrentBuilds()
]
)

final def oses = ['linux':'ubuntu && maven', 'windows':'windows-he']
final def mavens = env.BRANCH_NAME == 'master' ? ['3.8.x', '3.2.x'] : ['3.8.x']
// all non-EOL versions and the first EA
Expand Down
78 changes: 75 additions & 3 deletions surefire-its/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.test.redirectTestOutputToFile>true</maven.test.redirectTestOutputToFile>
</properties>

<dependencies>
Expand Down Expand Up @@ -78,6 +79,57 @@
<artifactId>commons-lang3</artifactId>
<scope>test</scope>
</dependency>
<!-- those dependencies are here to fake the build plan calculation
and being able to use -Txx or mvnd and have a faster multithread build
-->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit-platform</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit3</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-testng</artifactId>
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -172,6 +224,11 @@
<profiles>
<profile>
<id>run-its</id>
<properties>
<verifier.forkMode>auto</verifier.forkMode>
<surefireMemory>-Xmx512m</surefireMemory>
<surefire.extraArgLine>-server -XX:+UseG1GC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.awt.headless=true -Djdk.net.URLClassPath.disableClassPathURLCheck=true</surefire.extraArgLine>
</properties>
<build>
<plugins>
<plugin>
Expand All @@ -183,7 +240,7 @@
<threadCount>1</threadCount>
<perCoreThreadCount>false</perCoreThreadCount>
<forkMode>once</forkMode>
<argLine>-server -Xmx64m -XX:+UseG1GC -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Djava.awt.headless=true -Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
<argLine>${surefireMemory} ${surefire.extraArgLine}</argLine>
<includes>
<include>org/apache/**/*IT*.java</include>
</includes>
Expand All @@ -195,10 +252,9 @@
<maven.settings.file>${project.build.directory}/private/settings.xml</maven.settings.file>
<maven.toolchains.file>${project.build.directory}/private/toolchains.xml</maven.toolchains.file>
<maven.test.tmpdir>${project.build.directory}</maven.test.tmpdir>
<verifier.forkMode>forked</verifier.forkMode>
<verifier.forkMode>${verifier.forkMode}</verifier.forkMode>
<jacoco.agent>${jacoco-it.agent}</jacoco.agent>
</systemPropertyVariables>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<shutdown>kill</shutdown>
</configuration>
<dependencies>
Expand All @@ -217,6 +273,22 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<localRepositoryPath>${settings.localRepository}</localRepositoryPath>
</configuration>
<executions>
<execution>
<id>install-dependencies</id>
<phase>pre-integration-test</phase>
<goals>
<goal>install</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void testForkModePerTest()
@Test
public void testForkModeNever()
{
String[] pids = doTest( unpack( getProject() ).forkNever() );
String[] pids = doTest( unpack( getProject() ).setForkJvm().forkNever() );
assertSamePids( pids );
assertEndWith( pids, "_1_1", 3 );
assertEquals( "my pid is equal to pid 1 of the test", getMainPID(), pids[0] );
Expand All @@ -82,7 +82,7 @@ public void testForkModeNever()
@Test
public void testForkModeNone()
{
String[] pids = doTest( unpack( getProject() ).forkMode( "none" ) );
String[] pids = doTest( unpack( getProject() ).setForkJvm().forkMode( "none" ) );
assertSamePids( pids );
assertEndWith( pids, "_1_1", 3 );
assertEquals( "my pid is equal to pid 1 of the test", getMainPID(), pids[0] );
Expand Down Expand Up @@ -116,7 +116,7 @@ public void testForkModeOncePerThreadTwoThreads()
@Test
public void testForkCountZero()
{
String[] pids = doTest( unpack( getProject() ).forkCount( 0 ) );
String[] pids = doTest( unpack( getProject() ).setForkJvm().forkCount( 0 ) );
assertSamePids( pids );
assertEndWith( pids, "_1_1", 3 );
assertEquals( "my pid is equal to pid 1 of the test", getMainPID(), pids[0] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void jarShouldUseFile()
@Test
public void jarNotForkingShouldUseFile()
{
unpack( "surefire-855-failsafe-use-jar" )
unpack( "surefire-855-failsafe-use-jar" ).setForkJvm()
.maven().sysProp( "forkMode", "never" ).executeVerify().assertIntegrationTestSuiteResults( 3, 0, 0, 1 );
}

Expand All @@ -55,4 +55,4 @@ public void osgiBundleShouldUseFile()
{
unpack( "surefire-855-failsafe-use-bundle" ).maven().executeVerify().verifyErrorFree( 2 );
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.xml=org.apache.log4j.FileAppender
log4j.appender.xml.file=example_xml.log
log4j.appender.xml.file=target/example_xml.log
log4j.appender.xml.append=false
log4j.appender.xml.layout=org.apache.log4j.xml.XMLLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
log4j.appender.R.File=target/example.log


log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

log4j.appender.xml=org.apache.log4j.FileAppender
log4j.appender.xml.file=example_xml.log
log4j.appender.xml.file=target/example_xml.log
log4j.appender.xml.append=false
log4j.appender.xml.layout=org.apache.log4j.xml.XMLLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
log4j.appender.R.File=example.log
log4j.appender.R.File=target/example.log


log4j.appender.R.MaxFileSize=100KB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=1

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n
log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n