-
Notifications
You must be signed in to change notification settings - Fork 2
Feature/7 default display banner navigation #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/7 default display banner navigation #8
Conversation
…and update configuration to display banner images with 28:9 ratio and place blocks for navigation and banners on install.
…nt working for the banner block.
…n subsite overview and subsite page nodes.
…the test is getting Drupal\Core\Entity\EntityMalformedException: The "node" entity cannot have a URI as it does not have an ID in...
@andybroomfield @Adnan-cds @stephen-cox @ekes anyone able to make any more suggestions on fixing the remaining errors on these tests? I'm getting there, slowly!
|
The entity_reference_hierarchy field is defined in the entity_hierarchy module. So if you please add it to the list of modules needed to run this test, this error should go away. I haven't checked the other issue about the username :( |
In moving from localgov_campaigns to localgov_subsites, a number of tests were copied over including Kernel tests that assert back references are maintained by node CRUD hooks between the overview and page nodes. These back references are not a feature of the subsites module and the test redundant so removing.
…der on /node/add/localgov_subsite_overview page but causes fatal error as it assumes a node id will exist when the node has yet to be created.
… fix which prevents undefined index notices when using SQLite.
composer.json
Outdated
"homepage": "https://github.com/localgovdrupal/localgov_subsites", | ||
"license": "GPL-2.0-or-later", | ||
"minimum-stability": "dev", | ||
"repositories": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi James,
IIRC repository declarations only work in root-level composer.json files. As a quick workaround, you can try updating the SQLite authentication details used in the test runner Docker container. Currently it says sqlite://localhost/dev/shm/test.sqlite. Replacing it with sqlite://database:database@localhost/dev/shm/test.sqlite may work. This will of course mean rebuilding the Docker container which Steve can do later.
I have to say I haven't tested this at all. If you have SQLite in your development site, you should be able to try it there first.
FAO @Iam-Jam @stephen-cox
…n the installation profiles composer.json to be effective.
Quick summary of my changes: The entity hierarchy_module depends on dbal. The latter causes undefined index notices when using SQLite (which is being used by the GitHub test runner) and consequently the tests would fail. I was originally trying to include a fix for DBAL via a Composer alias to a fork of the project but this would need to done further up the composer tree so I am now trying to do this via a composer patch in this project. |
Currently the tests are failing due an exception raised by a dependency of the DBAL module see We do not run into this exception when running the tests with MySQL. cc @finnlewis |
Is this the code throwing the exception James? |
That does look like the code generating the error @Adnan-cds - any ideas how we fix it? |
I tried to run the Kernel test bundled with dbal in a fresh install of localgov using Sqlite as the database. It indeed fails although the error is slightly different - it can't find a database table. This will take some time to troubleshoot. I may be able to look into it next week. In the mean time, I don't mind approving this pull request if you comment out this Kernel test of localgov_subsites after verifying that it runs okay in MySQL. |
I cannot reproduce these errors locally. Errors seen in https://github.com/localgovdrupal/localgov_subsites/pull/8/checks?check_run_id=1489320195
Steps to try to reproduce:
Result: No errors. The table name appears to be:
Which seems reasonable - my regex is not good enough to spot where that might fail in /^[a-zA-Z]\w{1,64}$/: |
@Adnan-cds thanks for looking... all the tests pass for me locally when running in MySQL !!! |
In that case you need to decide how best to preserve the Kernel test class but not run it! Perhaps Steve will have some idea :) Sorry, I am trying to avoid getting involved into anything this week :( |
@stephen-cox and @ekes any brain power or time to help out with this one? One thing I am wondering is whether we should / could move to using MySQL to test against in the Github testing workflow. I am running some tests locally to benchmark both SQLite and MySQL against the same tests to confirm the performance differential. Other than that, any idea how to fix this SQLite testing issue with dbal ? |
For the record, running locally with MySQL, the tests do now pass This is conditional on
|
This is what I have on my old Mac to use sqlite outside lando How slow do the tests run with MySQL on Github? Would it really be a huge cost to use that? |
I have re-created the locally using SQLite. In order to do so I used the following connection config.:
With the The exception originates in a vendor library which I have hacked locally but this had led to further exceptions from the same library. We could continue to try to fix these issues, although very unclear how much effort's gonna be involved, but these issues are specific to SQLite using a prefix which I would argue is fairly edge case. So our options are:
EDIT: This may be useful: |
Thanks James, SQLite is significantly faster for tests. It will also take a rebuild of the test runner / docker image to change these from sqlite to MySQL. Possibly worth a try but will require co-ordination from @stephen-cox @Adnan-cds @andybroomfield to make sure we are all aware of and support the changes. I do think the best solution would be to get the libraries workgin with SQLite. The maintainer of the dbal module and that library said that he was not aware of the prefix issue on https://www.drupal.org/project/dbal/issues/3186378#comment-13928669 So I reckon he might be able to help is resolve the issues in his library. If we can articulate the problem and the cause on Github issues, he seems quick to respond. @ekes might be able to help too. @stephen-cox, @ekes and I are in DrupalCon Sessions all day / week so may be less available than usual. (Or maybe we'll get bored and dive in!?!) |
Good morning. I hope you all have a good time there :) We are expecting to go live today, so I hope to have some breathing space once that happens. Weather is not looking good though (foggy), so launch may be delayed. But I am hopeful. I would like to have a stab at this dbal/sqlite chaos post-launch. |
There is probably one more option: ditching |
Update on where my debugging has taken me: After hacking the regex in the nested-set library we get a DBAL
Using the The Which uses the nested-set library to create the Doctrine DBAL schema object and general the create table SQL. At this point, the table name passed to DBAL is still As far as I can tell DBAL does not support creating databases within schemas: https://github.com/doctrine/dbal/blob/2.12.x/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php#L353 But perhaps I'm missing something?! |
Hi Andy, Finn, James, I followed James' suggestion and updated the DBAL and PreviousNext's DBAL wrapper to work with prefixed table names. Quite predictably, I saw the same errors as James:
Note that this is happening within a test where config is getting imported. The database is probably locked because Drupal's config import process (or some other part) has locked it. Wikipedia puts it nicely:
The D.o ticket that Andy suggests is also to do with locking. It even has a patch. It may be possible to enable concurrent writes for SQLite. I will see if I can find anything on this. We can also try the patch attached to that. Finn's latest change passes the tests but fails due to coding standard error. So for now, I am happy to go with that. Perhaps we can open a new ticket to look into running this module's tests under SQLite. |
Thanks for looking @Adnan-cds As you mentioned, I've added the check for SQLite connection to each of the failing tests, so it will just skip the tests if running in sqlite. Not ideal, but hopefully OK for now. The tests do now pass. I've created an issue to track further attempts as getting the tests working in SQLite #11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Massive thanks to everyone who has worked on this difficult one :)
No description provided.