- Issue created by @fjgarlin
- πΊπΈUnited States cmlara
Not sure if we want this as part of this issue or a new issue:
# Finally, execute tests. - sudo -u www-data -E vendor/bin/phpunit --no-interaction --printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --bootstrap $PWD/web/core/tests/bootstrap.php $_WEB_ROOT/modules/custom --log-junit junit.xml $_PHPUNIT_EXTRA - cp /var/log/apache2/test.apache.access.log $CI_PROJECT_DIR/apache.access.log.txt
If phpunit has any failed tests GitLab stops execution and the Apache access log will not be copied into the assets. The only real options that I'm aware of are to either
- Copy the artifact in an after_script
- Capture the failure from the phpunit step and hold it to be returned after the copy step.
We also might want the /var/log/apache2/test.apache.error.log log too.
- π«π·France andypost
We also might want the /var/log/apache2/test.apache.error.log log too.
Maybe better to configure Apache to write logs besides fetched source code?
- π³πΏNew Zealand xurizaemon Εtepoti, Aotearoa π
Suggestion in https://git.drupalcode.org/project/gitlab_templates/-/merge_requests/33#... -
<VirtualHost *:80> DocumentRoot ${CI_PROJECT_DIR}/web RewriteEngine On Alias "/apc" "/var/www/apc" Alias "/server-status" "/var/www/apc" <Directory "${CI_PROJECT_DIR}/web"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order Allow,Deny Allow from All </Directory> ServerSignature Off CustomLog ${CI_PROJECT_DIR}/tmp/webserver-access.log.txt ErrorLog ${CI_PROJECT_DIR}/tmp/webserver-error.log.txt </VirtualHost>
(based on the existing config from the drupalci image, with only the changes necessary)
I think with the above, we'd also want to drop the apache configuration to set the run user as www-data. Running it as root would remove the need to use
sudo
to execute tests; both webserver and tests will run as the same user in CI then.The above config could be introduced as an additional file in
/etc/apache2/sites-available/ci.conf
, then while DrupalCI and Gitlab CI are both in use, Gitlab CI can have ana2ensite/a2dissite
step to switch configurations. - πͺπΈSpain fjgarlin
Note that exposing error and access logs, and doing so in the "after_script" section are really quick changes, so I'm hoping to land those small things with this one β¨ Run phpunit tests from a single job in parallel Fixed (the concurrency will be controlled by a flag..).
I like the suggestion made in #6 about having different configurations and enable/disable as needed.
- π«π·France andypost
There's nuance https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4843
- Merge request !35Draft: #3372464: Change localhost for names of service in use β (Closed) created by fjgarlin
- Status changed to Closed: duplicate
over 1 year ago 4:15pm 2 November 2023 - πͺπΈSpain fjgarlin
I think all sort of "global" or "generic" improvements will (and should) be worked on here #3389921: New templates for contrib: mirror as much as possible all the GitlabCI jobs from core β , so I'm going to mark this as duplicate (unless somebody things we shouldn't).
The more we can mirror what core does in this project, when it comes to server set-up (apache in this case), the better and easier it'll be to maintain.
If we want to have small iterations on the existing template, I suggest creating new issues with specific suggestions/improvements.
- π¬π§United Kingdom jonathan1055
This was "closed (duplicate)" in November 2023, so MR35 can be closed too. Thanks.