SemanticResultFormats icon indicating copy to clipboard operation
SemanticResultFormats copied to clipboard

Tests against MW master are broken

Open JeroenDeDauw opened this issue 5 years ago • 7 comments

https://travis-ci.org/SemanticMediaWiki/SemanticResultFormats/builds/642565636

Broken since last September.

JeroenDeDauw avatar Jan 27 '20 21:01 JeroenDeDauw

https://travis-ci.org/SemanticMediaWiki/SemanticResultFormats/builds/642565636 Broken since last September.

Well, this isn't surprising as one can see from the error message "Fatal error: Declaration of SMW\Tests\DatabaseTestCase::setUpBeforeClass() must be compatible with PHPUnit\Framework\TestCase::setUpBeforeClass(): void" with typing being enforced because master uses PHPUnit 7 (or 8 or 9, I don't know I stopped following what happens on master) which means those methods need to be updated.

I don't know whether adding : void to all required methods (setUp, tearDown etc.) breaks PHPUnit 6.5 or not but SRF should first switch to PHPUnit 6.5 as a minimum and take it from there.

To be honest it is kind of silly to add those typings to ~1000 test classes in SMW alone hence it is not on my priority list.

mwjames avatar Feb 01 '20 09:02 mwjames

Uh yeah. I'm not a fan of :void myself and think there have been a number of dubious breaking changes like that in PHPUnit over the years. Please don't let that scare you of types in general :)

JeroenDeDauw avatar Feb 01 '20 11:02 JeroenDeDauw

Maybe the tool Rector can be used to add ": void" ? https://github.com/rectorphp/rector/issues/962

akuckartz avatar Feb 02 '20 16:02 akuckartz

@JeroenDeDauw I'm working on #570. In this context, I'd update .travis.yaml to install a compatible Mermaid version.

Shall I temp. disable

  include:
    #- env: DB=mysql; MW=master; SMW=~3.1@dev; TYPE=coverage
    #  php: 7.3

to avoid Travis reporting errors because of #567?

gesinn-it-gea avatar Mar 13 '20 08:03 gesinn-it-gea

Just replace master with the most recent working version. Then we keep the coverage build

JeroenDeDauw avatar Mar 13 '20 16:03 JeroenDeDauw

Maybe the tool Rector can be used to add ": void" ?

No need, this can be done with a simple search and replace. Or rather 4 of them (setUp, tearDown, setUpBeforeClass, ...) but this is still easy/quick.

JeroenDeDauw avatar Mar 13 '20 16:03 JeroenDeDauw

No need, this can be done with a simple search and replace. Or rather 4 of them (setUp, tearDown, setUpBeforeClass, ...) but this is still easy/quick.

There is nothing to fix on the SMW side (because I already did that #4465, #4566 which could have been done by anyone else but again ...) and if everyone would take a closer look on why and where the failing happens then it should become obvious that MW master can only run with SMW master while any other version is incompatible.

mwjames avatar Mar 14 '20 08:03 mwjames