Closed (fixed)
Project:
Web Experience Toolkit
Version:
6.1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Feb 2025 at 03:49 UTC
Updated:
11 Mar 2025 at 18:24 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
ggh commentedlooks likes its already included in 6.1.x branch please verify
Comment #3
joseph.olstadPatch
https://patch-diff.githubusercontent.com/raw/drupalwxt/wxt/pull/315.diff
Pull request:
https://github.com/drupalwxt/wxt/pull/315
This needs testing.
Comment #4
smulvih2@joseph can you please give some instructions about how to run these tests? If I exec into the web container and run
../vendor/bin/phpunit -c core profiles/wxt/tests/I get this:So it appears I need to provide some environment variables for this to work, please advise. Also I notice from the image in the ticket, you reference
core/phpcs.xmlbut this file doesn't exist in 6.1.x, rathercore/phpcs.xml.dist. Thanks!Comment #5
joseph.olstadTo run those tests need to apply this patch:
https://www.drupal.org/files/issues/2025-02-23/3466676-tests-run.patch
From:
#3466676-109: Drupal 11 preparedness
Comment #6
smulvih2Steps to reproduce (using docker-scaffold):
bootstrap="html/core/tests/bootstrap.php"<env name="SIMPLETEST_BASE_URL" value="http://sitewxt_nginx"/><env name="SIMPLETEST_DB" value="mysql://root:root@sitewxt_db/wxt"/>(to get working with docker-scaffold)docker exec -ti sitewxt_web bash../vendor/bin/phpunit -c ../phpunit.xml profiles/wxt/tests/Comment #7
joseph.olstadI've pushed up a pull request , we can follow up to this post request some entry into the README.md about this and maybe an entry into the official WxT documentation that basically has a small blurb saying that a test script exists and helps folks run this easily.
https://github.com/drupalwxt/wxt/pull/316
Comment #8
web247 commentedNew patch worked fine for me.
Comment #9
joseph.olstad@web247, which patch?
I'm still seeing this error:
Comment #10
joseph.olstadWhen applying this patch: https://www.drupal.org/files/issues/2025-02-23/3466676-tests-run.patch no longer get the "No schema" error however get this error instead:
Comment #11
web247 commented@joseph.olstad I mean, I was able to apply the patch with no issues:
Yeah, I am seeing that error now, didn't get that error before. Strange.
Comment #12
web247 commentedOh, I see what the problem is, in your
phpunit.xmlfile, make sure theSIMPLETEST_BASE_URLsetting points to http://localhost and NOT httpS, after that I was able to pass the tests with my patch:Comment #13
smulvih2So the problem is not that the wxt_core.settings.countries.yml config file is not imported during install, because on a fresh install of 6.1.x I can see the values in the UI as expected, so updating
wxt_core.installis not the solution here. I actually tried to fix the root cause of this issue, which is the wxt_core.settings.countries needs an entry in wxt_core.schema.yml. Once I made the correct entry in the schema file for this, I got another error about the schema for wxt_core.versions (all enabled modules), which will be difficult to deal with since this can change depending on enabled modules.After this, I tried the patch from @web247 and it successfully suppressed the errors about the schema. I think this is the best approach, and allows our phpunit to run fully against the defined tests.
Comment #14
joseph.olstadThis patch actually resolves the countries issue: https://patch-diff.githubusercontent.com/raw/drupalwxt/wxt/pull/315.diff
what I'm saying is, there's another unrelated issue with the test.
I actually spent a lot of time working this 8205 hook update last year, what it does is it fixes what needs fixing related to countries settings.
All I'm doing here is calling it on the install, so that fresh installs get the fix also.
Comment #15
smulvih2@joseph I remember this issue for 5.0.x. The issue was introduced in 5.0.1 when the config file in question was introduced, called
wxt_core_countries.settings.yml- https://github.com/drupalwxt/wxt/tree/5.0.1/modules/custom/wxt_core/config/installThen in 5.0.2 it was renamed
wxt_core.settings.countries.yml- https://github.com/drupalwxt/wxt/tree/5.0.2/modules/custom/wxt_core/config/installSo if a site was on 5.0.1 and gets updated, this update hook
wxt_core_update_8502()is needed to fix the config name. But any site setup on 5.0.2+ will not have this issue since the config filename is now correct.Comment #18
smulvih2Pushed to 5.4.x and 6.1.x. This fixes the phpunit tests. Would be good to add documentation on how to setup and run these tests using docker-scaffold here - https://drupalwxt.github.io/docs/development/, but this can be done as a separate issue.