-
Notifications
You must be signed in to change notification settings - Fork 41
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
Config tests failing when using MySQL #135
Comments
The table used in the unit tests is not meant to reflect the structure of the table of the plugin itself, but rather to assert the valid operations done by the The table name can be changed if it is causing unexpected issues, or test failures. As of the latest releases, the config tests do not seem to be failing. If they are, we would need more information to address them. |
Good day @FMCorz , may I ask, how do you run the PHPUnit tests for block_xp? I ask because you said "the config tests do not seem to be failing". The way Moodle Core works (Core as in, without any additional code, a.k.a. Moodle Vanilla), is by using prefixes to manage tables. The three basic (default) prefixes are: Moodle Vanilla uses these three default prefixes because that's the minimum amount of sites that need to be generated in order to have a Moodle testing platform. In theory each of the three would live in its own database, but in practice, the three 'databases' are merged into a single one, and they are differentiated from each other via prefixes. The problem with using the 'phpunit' prefix, is that then wrongly named tables are generated. In the case of the test Thank you so much for you attention, and sorry if this was a bit long, I decided to write at length given your addition of the label named 'additional information required'. Let me know if something of what I say is wrong, that's why I ask about how do you perform the PHPUnit tests using a Moodle site with the PHPUnit environment initialized. |
Hi @Julian-Tovar, Thank you for the thorough explanation. I am quite familiar with the database structure and the use of prefixes. You are right that the However, the table name there is only used as a temporary table that is both created and dropped during each of the corresponding unit tests. This table will not persist after tests are run, nor should it. Creating a new table is required to assess the well functioning the The name of the table is arbitrary, and I chose If unit tests are not failing when you run them, then I think we can safely close this issue as the unit test does what it is meant to do, irrespective of the arbitrary table name. If the tests are failing, then please do share the traceback so that we can implement a fix. I run unit tests with |
Hi @FMCorz thank you so much for introducing me to |
Hi @FMCorz So here is a more detailed report of the failures. Setting up the PHPUnit environmentUsing a terminal in the Moodle's root directory, execute:
Failure in the
|
Hi @Julian-Tovar, We should have ran the tests on MySQL for sure, as you identified the We will leave the warning as is for now, and address it later. Thanks again! |
Thank you so much, and sorry for the confusion about the table name, I think it is a valid name, although I have never seen one named like that, but then again I'm not too experienced with table names in PHPUnit tests in Moodle plugins, so for all I know, it's valid. |
As reported on the official Moodle Tracker (https://tracker.moodle.org/browse/MDL-74847):
The text was updated successfully, but these errors were encountered: