IntelliJ IDEA Project build - a classpath issue in JUnit runner
Hi,
We have a following issue while migrating from an obsolete Ipr (tests) runner to a new one.
The run configuration in question is a JUnit test runner that runs a bunch of tests, say, in one package.
To put it shortly, we have a sertain class bar.Foo that presents in a classpath listed in a builder log:
[17:15:12]: [Step 4/5] Starting run configuration BuilderTest ...
[17:15:12]: [Step 4/5] java
[17:15:12]: [java] Tests runtime classpath: [..
But when we try to get this class (via Class.forName("bar.Foo"), for instance) either in a test or in a javaagent that is provided in a run confuguraion, it is a failure. Note: in a test, it works this way if we use a system class loader and probably will work well with a current one.
My observations showed me two things:
1. A test class that is executed in thiis build is loaded by some foreign class loader.
2. A classpath system property in a test contains some odd and unexpected value:
/var/tainted/build-agent/lib/runtime-util.jar:/var/tainted/build-agent/plugins/iprPlugin/lib/buildServerIprRunner.jar:vendor/fibers-preload.jar
where the last one is a jar for our own javaagent.As you can see, no trace of our own code, both testing and tested.
Therefore, we fail to apply some pre-test bytecode instrumentations and to scan classes in a classpath, which is required for some of our code.
We sertainly can't procceed without those. Is there any hint how this can be fixed?
Please sign in to leave a comment.
Could you please attach the whole build log or send it to teamcity-feedback[at]jetbrains.com?
I'll do my best.
You will find no trace of our issues in the log, though. They just fail the tests woth no verbose output. If you need it, could you please specify what info do require, exactly.
I would like to take a look at the whole classpath and other parameters used to run this Run configuration.