Closed sormuras closed 6 years ago
@forax I wanted to pass TesterConf via a constructor parameter but due to the different class loaders the type looks different at run-time. Had to resort to generic map... do you see a more elegant and type-safe way passing arguments to the TestRunner instance?
Plugins like the packager makes the difference between the parameters of the plugin PackagerConf and the parameters of the underlying command (jar) by using a simple POJO named Jar.
So instead of using a Map, you can declare a non public immutable class with all the fields you need, if it is created in the same package as the runner it should work because this package is visible by both classloaders (i hope).
Compiling it works, running not.
Caused by: java.lang.NoSuchMethodException: com.github.forax.pro.plugin.tester.TesterRunner.<init>(com.github.forax.pro.plugin.tester.TesterFixture)
at java.base/java.lang.Class.getConstructor0(Class.java:3326)
at java.base/java.lang.Class.getConstructor(Class.java:2128)
at com.github.forax.pro.plugin.tester@0.11/com.github.forax.pro.plugin.tester.TesterPlugin.execute(TesterPlugin.java:94)
with TesterFixture.java
as:
class TesterFixture {
final Path path;
final boolean parallel;
TesterFixture(Path path, boolean parallel) {
this.path = path;
this.parallel = parallel;
}
}
Trying to load the fixture class with the new class loader now...
...looks good so far. Next commit is almost done.
Remove the SlowNoopTests.java
show-casing the effect of parallel execution before merge?
I'll rebase and merge to master
this PR as-is. Then you may tune it to your likings locally. This includes leaving the SlowNoopTests.java
demo in place or pruning it. Same goes for the changes in test.pro
. Methinks, setting tester.parallel(true)
is always a good idea.
D'accord?
yes, i agree.
for parallel, tester is not the only plugin to have that option, i will perhaps promote it to the convention to have a way to disable parallel build for all plugins.
Needs a polishing pass...