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

Adjusting CLI options passed to Maven test runs #82

Merged
merged 1 commit into from
Nov 14, 2018
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public PluginCompatReport testPlugins()
mconfig.userSettingsFile = config.getM2SettingsFile();
// TODO REMOVE
mconfig.userProperties.put( "failIfNoTests", "false" );
mconfig.userProperties.put( "argLine", "-XX:MaxPermSize=128m" );
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This clobbered both jenkinsci/plugin-pom#131 and the corresponding local workaround in ~/.m2/settings.xml, rendering PCT unusable with the current OpenJDK 8 on Ubuntu. Even before that, it was clobbering the default argline -Xmx768M -Djava.awt.headless=true.

Anyway I question the wisdom of blindly overriding JVM ergonomics during test runs. If there are indeed some test suites which for some reason require an outlandishly large permanent generation—and IIRC this is not even a thing in Java 8 anyway?—then they ought to be specifying that in their POMs.

mconfig.userProperties.putAll(this.config.retrieveMavenProperties());

SCMManagerFactory.getInstance().start();
Expand Down Expand Up @@ -482,7 +481,7 @@ private TestExecutionResult testPluginAgainst(MavenCoordinates coreCoordinates,

List<String> args = new ArrayList<String>();
args.add("--define=maven.test.redirectTestOutputToFile=false");
args.add("--define=concurrency=1");
args.add("--define=forkCount=1");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of jenkinsci/plugin-pom#80 (parent 2.37), concurrency is deprecated and forkCount is what you want. Noticed since a local profile

<profile>
    <id>faster</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <forkCount>1C</forkCount>
    </properties>
</profile>

was no longer being properly countermanded: multiple tests were running concurrently.

args.add("hpi:resolve-test-dependencies");
args.add("hpi:test-hpl");
args.add("surefire:test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ private MavenRunner.Config getMavenConfig(PluginCompatTesterConfig config) throw
mconfig.userSettingsFile = config.getM2SettingsFile();
// TODO REMOVE
mconfig.userProperties.put("failIfNoTests", "false");
mconfig.userProperties.put("argLine", "-XX:MaxPermSize=128m");
mconfig.userProperties.putAll(config.retrieveMavenProperties());

return mconfig;
Expand All @@ -129,4 +128,4 @@ private void removeNodeFolders(File path) throws PomExecutionException, IOExcept
FileUtils.deleteDirectory(nodeModulesFolder);
}
}
}
}