Tweaking CLASSPATH for running test via gatling.sh

Hi
I have a question regarding running tests that are packed into a JAR file. Specifically, I have a compiled test written in Java, which is packed into a file named test.jar. Now, I’m aiming to execute it using the gatling.sh script.

Previously, with Gatling version 3.7, the process was straightforward – just setting the CLASSPATH to point to the directory containing test.jar along with its dependencies sufficed. However, with the introduction of GatlingCLI in version 3.8, it seems this method no longer works. Upon examining the code, I came across the OpenSourceRunCommand class, where the classpath is constructed as follows:

val classPath = GatlingLibs ++ UserLibs ++ List(config.resourcesDirectory.toString) ++ GatlingConfFiles

So, if I understand correctly, is it now impossible to pass the classpath to Gatling? It seems the only viable option is to place test.jar into the UserLibs folder. Am I correct in assuming this? Is there no alternative method to run tests from a custom or user-defined folder? (I am aware of the -bf and -rsf options, but those only seemed to work when I placed the .class files there and were not effective with JARs.)

Thanks for your help.

Hi,

As of Gatling 3.10, you can add custom libs in users-files/lib.

However, please note that we’ll be killing this existing bundle and replace it with a standalone maven based one as of Gatling 3.11. See Bundle: replace existing bundle with a maven wrapper one · Issue #4512 · gatling/gatling · GitHub.

We strongly recommend using a real build tool based project to bring extra libraries in the classpath.

Regards

When you plan to release 3.11 ?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.