Preserve environment variables when running testing jobs
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3475974. --> Reported by: [mondrake](https://www.drupal.org/user/1307444) Related to !261 !258 !293 !259 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p><code>BROWSERTEST_OUTPUT_VERBOSE</code> is not passed to run-tests.sh when running PHPUnit tests with concurrency on.</p> <p>The variable works fine when running without concurrency on standard PHPUnit CLI.</p> <h4 id="summary-steps-reproduce">Steps to reproduce</h4> <p>Set <code>BROWSERTEST_OUTPUT_VERBOSE</code> to "false" and <code>_PHPUNIT_CONCURRENT</code> to '1', run functional tests and see the full list of links to generated html output; switch <code>_PHPUNIT_CONCURRENT</code> to '0' and see just the count of pages generated.</p> <p>I think this is due to the processes being run under sudo. However, while the direct call to PHPUnit CLI uses -E to preserve the environment variables, when calling run-tests.sh just two variables are passed in.</p> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Set the -E option also when running via run-tests.sh ==&gt; This didn't work<br> Add www-data user to root group ==&gt; This made it work</p> <h3 id="summary-actual-resolution">Actual resolution</h3> <p>Add options <code> -H -E </code> to all executions of <code>phpunit</code>, <code>run-tests.sh</code> and <code>nightwatch</code></p> > Related issue: [Issue #3400372](https://www.drupal.org/node/3400372)
issue