When a variable is defined in a target earlier in the runconfig file, with no value, like

MYENVVAR

it appears with the name "MYENVVAR=" in the environment of a test run from a later target in the runconfig. It does not appear when doing megatest -show-runconfig -target <target>

The workaround is to put "" for the value of the var.