Do not run commands as other user as we lose env variables

Created on 9 November 2023, almost 2 years ago

Problem/Motivation

Env variables are not passed when running commands via sudo, and we need to declare them explicitly. It'd be great if all the variables that are set are available when running the tests commands, which are run as "www-data" user via "sudo -u" commands.

Steps to reproduce

See πŸ› [GitlabCI] run-tests.sh does not pass on SYMFONY_DEPRECATIONS_HELPER environment variable value to spawned processes Fixed where "SYMFONY_DEPRECATIONS_HELPER" was not being recognized by "run-tests.sh".

Proposed resolution

As suggested by @longwave in the parent issue in #4 option 3:

Stop using sudo entirely, we are in throwaway containers so does it matter if the tests run as root?

After this is done here, the "Drupal core" gitlabci files could use the same changes.

Remaining tasks

MR

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Component

gitlab-ci

Created by

πŸ‡ͺπŸ‡ΈSpain fjgarlin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024