Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[tycho-user] Passing environment variable to tests

Hi guys,

I'm trying to make a system (optional) env variable visible to tests in Tycho:

It works when the variable is set on the host. But when the variable is not set it fails with:
Caused by: java.lang.NullPointerException
        at org.apache.commons.exec.environment.EnvironmentUtils.toStrings(
        at org.apache.commons.exec.launcher.Java13CommandLauncher.exec(
        at org.apache.commons.exec.DefaultExecutor.launch(
        at org.apache.commons.exec.DefaultExecutor.executeInternal(
        at org.apache.commons.exec.DefaultExecutor.execute(
        at org.eclipse.sisu.equinox.launching.internal.DefaultEquinoxLauncher.execute(
        at org.eclipse.tycho.surefire.TestMojo.runTest(

I have found the ticket that is fixed in 0.23.0 so I guess it was only a fix for empty variable. Here I want to support "unset" variable.

FYI in my tests there is something like:
if (System.getenv("TRAVIS") != null) {
  // Do something specific to travis}

Any help is appreciated.



Back to the top