https://pantsbuild.org/ logo
#general
Title
# general
b

brief-engineer-67497

11/21/2018, 2:42 PM
I'm having a weird error. When I run a test in intellij, it works fine bun when I do a
./pants test foo --test-junit-test="MySuite"
I have the following error:
Copy code
There were 2 failures:
                     1) Test mechanism
                     java.lang.NullPointerException
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.AntJunitXmlReportListener.testStarted(AntJunitXmlReportListener.java:383)
                        at org.junit.runner.notification.SynchronizedRunListener.testStarted(SynchronizedRunListener.java:49)
                        at org.junit.runner.notification.RunNotifier$3.notifyListener(RunNotifier.java:121)
                        at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
                        at org.junit.runner.notification.RunNotifier.fireTestStarted(RunNotifier.java:118)
                        at org.junit.internal.runners.ErrorReportingRunner.runCause(ErrorReportingRunner.java:64)
                        at org.junit.internal.runners.ErrorReportingRunner.run(ErrorReportingRunner.java:38)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.CompositeRequestRunner.runChild(CompositeRequestRunner.java:66)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentCompositeRequestRunner$1$1.run(ConcurrentCompositeRequestRunner.java:37)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentRunnerScheduler.finished(ConcurrentRunnerScheduler.java:89)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConcurrentCompositeRequestRunner$1.evaluate(ConcurrentCompositeRequestRunner.java:46)
                        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
                        at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.runLegacy(ConsoleRunnerImpl.java:539)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.run(ConsoleRunnerImpl.java:455)
                        at __shaded_by_pants__.org.pantsbuild.tools.junit.impl.ConsoleRunnerImpl.main(ConsoleRunnerImpl.java:843)
                        at org.pantsbuild.tools.junit.ConsoleRunner.main(ConsoleRunner.java:12)
Any idea why ? I might be messing with pants internals : the app I'm testing has an aspect woven. to perform this task I have a temporary hack which consist in 1/ a task
AspectjCompile
that basically extends
ZincCompile
, override compile, call super.compile and then replace the output class files with the one that have the aspect woven on 2/ a target that copy JvmTarget & inline ScalaLibrary without being JvmTarget to not trigger the regular zinc task I know this is messy but this is supposed to be super temporary …