Skip to content
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

Install semantic-result-formats dev-master for MW 1.42 #85

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

paladox
Copy link
Contributor

@paladox paladox commented Dec 18, 2024

No description provided.

@gesinn-it-gea
Copy link
Member

Good idea to add SRF to the CI matrix

@gesinn-it-gea
Copy link
Member

Might be required for Maps, too

@paladox
Copy link
Contributor Author

paladox commented Dec 18, 2024

Not sure why this happens:

EPHPUnit 9.6.16 by Sebastian Bergmann and contributors.
Runtime:       PHP 8.2.26
Configuration: phpunit.xml.dist
Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

I didn't get it for the other extensions.

Copy link

codecov bot commented Dec 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.87%. Comparing base (80e1a3e) to head (d0c1646).

Additional details and impacted files
@@            Coverage Diff            @@
##             master      #85   +/-   ##
=========================================
  Coverage     74.87%   74.87%           
  Complexity      716      716           
=========================================
  Files            36       36           
  Lines          2289     2289           
=========================================
  Hits           1714     1714           
  Misses          575      575           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gesinn-it-gea
Copy link
Member

@paladox can you try to run phpunit --migrate-configuration locally to get phpunit.xml.dist migrated

@paladox
Copy link
Contributor Author

paladox commented Dec 18, 2024

@gesinn-it-gea seems it’s caused by vimeo/psalm.

I guess updating it to version 5 may fix it but idk.

@paladox
Copy link
Contributor Author

paladox commented Dec 18, 2024

@gesinn-it-gea now this happens:

1) SD\Tests\Integration\JSONScript\JsonTestCaseScriptRunnerTest::testCaseFile with data set "browsedata-display-of-categories-default.json" ('/var/www/html/extensions/Sema...t.json')
Wikimedia\Rdbms\DBQueryError: Error 1146: Table 'wiki.unittest_semantic_drilldown_values' doesn't exist
Function: MediaWikiIntegrationTestCase::truncateTables
Query: TRUNCATE TABLE `unittest_semantic_drilldown_values`
/var/www/html/includes/libs/rdbms/database/Database.php:1203
/var/www/html/includes/libs/rdbms/database/Database.php:1187
/var/www/html/includes/libs/rdbms/database/Database.php:1161
/var/www/html/includes/libs/rdbms/database/Database.php:652
/var/www/html/includes/libs/rdbms/database/Database.php:3013
/var/www/html/tests/phpunit/MediaWikiIntegrationTestCase.php:2148
/var/www/html/tests/phpunit/MediaWikiIntegrationTestCase.php:2130
/var/www/html/tests/phpunit/MediaWikiIntegrationTestCase.php:779
/var/www/html/extensions/SemanticMediaWiki/tests/phpunit/SMWIntegrationTestCase.php:205

@paladox
Copy link
Contributor Author

paladox commented Dec 18, 2024

I'm not sure if SemanticMediaWiki/SemanticMediaWiki#5870 would fix it. but it at least fixes

Deprecated: Use of Wikimedia\Rdbms\DatabaseMySQL::listViews was deprecated in MediaWiki 1.42. [Called from SMW\Tests\Utils\Connection\TestDatabaseTableBuilder::generateListOfTables in /var/www/html/extensions/SemanticMediaWiki/tests/phpunit/Utils/Connection/TestDatabaseTableBuilder.php at line 166] in /var/www/html/includes/debug/MWDebug.php on line 379

I'm wondering if you'll be able to have a look @gesinn-it-gea ? not sure if the error is caused by something else. Dunno why the table isn't created.

@gesinn-it-gea
Copy link
Member

@gesinn-it-ilm I think you discovered "table 'wiki.unittest_semantic_drilldown_values' doesn't exist" too. Can you please give @paladox some feedback and align where to fix (either here or in a separate PR)

@paladox
Copy link
Contributor Author

paladox commented Dec 19, 2024

I'm not sure if SemanticMediaWiki/SemanticMediaWiki#5870 would fix it. but it at least fixes

Deprecated: Use of Wikimedia\Rdbms\DatabaseMySQL::listViews was deprecated in MediaWiki 1.42. [Called from SMW\Tests\Utils\Connection\TestDatabaseTableBuilder::generateListOfTables in /var/www/html/extensions/SemanticMediaWiki/tests/phpunit/Utils/Connection/TestDatabaseTableBuilder.php at line 166] in /var/www/html/includes/debug/MWDebug.php on line 379

I'm wondering if you'll be able to have a look @gesinn-it-gea ? not sure if the error is caused by something else. Dunno why the table isn't created.

Doesn't look like it fixed it. But it did fix the deprecated notice. Not sure why or how to fix the table not being created.

@paladox
Copy link
Contributor Author

paladox commented Dec 19, 2024

@gesinn-it-ilm I think you discovered "table 'wiki.unittest_semantic_drilldown_values' doesn't exist" too. Can you please give @paladox some feedback and align where to fix (either here or in a separate PR)

How’d you resolve it @gesinn-it-ilm ?

(only seems to happen on mw 1.42, passes in 1.40? Not sure why 1.39 tests fail tho (they aren’t failing with the same error, the table not found/not created))

@gesinn-it-ilm
Copy link
Contributor

@paladox not sure I know how to fix it. Need to investigate a bit further.

I think that some changes on SMW cause this problem here. Few weeks ago MW 1.42 worked perfect.
We had similar issue in SMW tests, not the same. It probably has to do something with test env set up on SMW side. But not sure where and what, because a lot of things were changed on SMW since then.

Need more time to check.

@paladox
Copy link
Contributor Author

paladox commented Dec 19, 2024

@gesinn-it-ilm
Copy link
Contributor

gesinn-it-ilm commented Dec 19, 2024

@paladox yes, those changes were made in order to make integration tests use MediaWikiIntegrationTestCase. After that we have make SemanticDrilldown tests run again.
That PR contains a lot of changes and improvements.

@paladox
Copy link
Contributor Author

paladox commented Dec 20, 2024

I had a look to see but I couldn't figure it out :(

@gesinn-it-ilm
Copy link
Contributor

@paladox I fully understand you. The codebase is huge, a lot of things need to be checked. So it is time cosuming for sure.
I am checking this as well.

@paladox
Copy link
Contributor Author

paladox commented Dec 20, 2024

The difference between https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/DatabaseTestCase.php#L174 and https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/SMWIntegrationTestCase.php#L182

is that in the later it sets use-normal-table and that's not in the former. Dunno if it's that. I dunno where it's getting the table name from because I see code that does CREATE TEMPORARY x table... but then it should exist?

@paladox
Copy link
Contributor Author

paladox commented Dec 20, 2024

It also uses MediaWikiIntegrationTestCase... compared to the former one which uses phpunit test case directly. Guess that could possibly be why (not sure).

@paladox
Copy link
Contributor Author

paladox commented Dec 20, 2024

Hmm, wait https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/Utils/Connection/TestDatabaseTableBuilder.php#L71 erased the MW db prefix. It states MediaWikiTestCase adds it. But in the test failure it says "Error 1146: Table 'wiki.unittest_semantic_drilldown_values' doesn't exist"

Although https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/Utils/Connection/TestDatabaseTableBuilder.php#L65C10-L65C21 makes it sunittest_.

So I wonder if the table wiki.semantic_drilldown_values table exist or wiki.sunittest_semantic_drilldown_values. Dunno if I went down a rabbit hole with this.

@paladox
Copy link
Contributor Author

paladox commented Dec 20, 2024

Not sure if the class can extend MediaWikiIntegrationTestCase because you can't change the dbprefix. Unless we change TestDatabaseTableBuilder.php idk. Could be wrong.

@paladox
Copy link
Contributor Author

paladox commented Dec 20, 2024

@gesinn-it-ilm ^

@gesinn-it-ilm
Copy link
Contributor

@paladox first of all, thanks for this investigation. I am not sure as well for the TestDatabaseTableBuilder.php. My idea is to check the commits from the last week. Probably something was changed in SMW that affected the SemanticDrilldown CI 1.42.

Not sure why it suddenly stop working. Some reason must be somewhere there.

Changing the SMW to use MediaWikiIntegrationTestCase instead of phpunit test case in integration tests was very tricky task for all of us. So I think this task will be similar. But let's check everything.

@gesinn-it-ilm gesinn-it-ilm marked this pull request as draft December 22, 2024 18:54
@paladox
Copy link
Contributor Author

paladox commented Dec 23, 2024

@paladox first of all, thanks for this investigation. I am not sure as well for the TestDatabaseTableBuilder.php. My idea is to check the commits from the last week. Probably something was changed in SMW that affected the SemanticDrilldown CI 1.42.

Not sure why it suddenly stop working. Some reason must be somewhere there.

Changing the SMW to use MediaWikiIntegrationTestCase instead of phpunit test case in integration tests was very tricky task for all of us. So I think this task will be similar. But let's check everything.

Looks like CI last passed before SemanticMediaWiki/SemanticMediaWiki#5792, on Nov 25th.

@gesinn-it-ilm
Copy link
Contributor

@paladox yes, that is correct. I am checking the commits after that, because some change after that period probably cause this issue with SD MW 1.42.
I made some progress, but still working on it.

@paladox
Copy link
Contributor Author

paladox commented Dec 23, 2024

@paladox yes, that is correct. I am checking the commits after that, because some change after that period probably cause this issue with SD MW 1.42. I made some progress, but still working on it.

Oh, that's awesome! Thanks for looking into it!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants