SemanticMediaWiki / SemanticResultFormats

Provides additional visualizations (result formats) for Semantic MediaWiki
https://www.semantic-mediawiki.org/wiki/Extension:Semantic_Result_Formats
Other
45 stars 75 forks source link

First attempt to run tests for SMW 4 and MW 1.36/1.37 #695

Closed malberts closed 2 years ago

malberts commented 2 years ago

This PR is made in reference to: #694 (only partially, because during test executions classes are not found).

With this PR the tests will at least attempt to run, but then fail due to missing classes.

When adding the following aliases to tests\bootstrap.php (which I doubt is the correct way to do it):

class_alias( '\SMW\Tests\QueryPrinterRegistryTestCase', '\SMW\Test\QueryPrinterRegistryTestCase' );
class_alias( '\SMW\Tests\Integration\JSONScript\JSONScriptTestCaseRunnerTest', '\SMW\Tests\Integration\JSONScript\JsonTestCaseScriptRunnerTest' );
class_alias( '\SMW\Query\ResultPrinters\ResultPrinter', '\SMW\ResultPrinter' );
class_alias( '\SMW\Query\ResultPrinters\FileExportPrinter', '\SMW\FileExportPrinter' );

Then the result looks like this: image CI example: https://github.com/malberts/SemanticResultFormats/runs/4620365772?check_suite_focus=true#step:8:1889

It seems like SMW's aliases are not being loaded correctly in SRF. With the above the tests will work, but it obviously does not fix #694 which requires the aliases outside of the tests.

codecov-commenter commented 2 years ago

Codecov Report

Merging #695 (0a80392) into master (598c269) will increase coverage by 3.27%. The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #695      +/-   ##
============================================
+ Coverage     36.00%   39.28%   +3.27%     
+ Complexity     2044     2043       -1     
============================================
  Files            75       75              
  Lines          7213     7225      +12     
============================================
+ Hits           2597     2838     +241     
+ Misses         4616     4387     -229     
Impacted Files Coverage Δ
SemanticResultFormats.hooks.php 0.00% <ø> (ø)
formats/filtered/src/Filtered.php 93.82% <100.00%> (ø)
formats/gallery/Gallery.php 94.88% <100.00%> (ø)
src/ResourceFormatter.php 100.00% <100.00%> (ø)
formats/Gantt/src/GanttSection.php 82.14% <0.00%> (+82.14%) :arrow_up:
formats/Gantt/GanttPrinter.php 91.34% <0.00%> (+91.34%) :arrow_up:
formats/Gantt/src/GanttTask.php 94.87% <0.00%> (+94.87%) :arrow_up:
formats/Gantt/src/Gantt.php 95.50% <0.00%> (+95.50%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 598c269...0a80392. Read the comment docs.

JeroenDeDauw commented 2 years ago

Looks good so far

malberts commented 2 years ago

Finally!

Is the SMW version check acceptable here in the last commit? It looks like because SMW 3.2.3 still uses the wgParser global directly I also need to access it directly in the test. If I don't have the version check then the SMW 3.2.3 test run has 2 failures (the same 2 that were previously failing in the other 3 runs).