Page MenuHomePhabricator

Re-work Minify's testRunJsFile test to not use forbidden @runInSeparateProcess which breaks CI publishing
Closed, ResolvedPublic

Description

Split out from T319458: Investigate potential issues with pcov in phpunit-coverage-php74-docker-publish.

testRunJsFile uses the @runInSeparateProcess to, well, run in a separate process. I suspect that the CLI options for enabling pcov are not being passed through. This seems to be the only test in codesearch using the option, and codesniffer also forbids the annotation. I think the easiest thing would be to refactor the test to avoid the option.

Event Timeline

This annotation was brought in with a change to improve test coverage, and though the repo was building fine with the previous commit ever since then (2021-03-09) https://doc.wikimedia.org/cover/mediawiki-libs-Minify/ hasn't been updated.

Change 838817 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/libs/Minify@master] Revert "tests: Fix code coverage of ensureExpandedStates() and address Doxygen warnings"

https://gerrit.wikimedia.org/r/838817

If the goal is to reset $expandedStates after CliTest to its default value, what about an @internal resetExpandedStatesForTests method that could be called in setUp? It seems trivial to implement and should have the desired effect.

Change 838817 merged by jenkins-bot:

[mediawiki/libs/Minify@master] tests: Don't 'fix' coverage of ensureExpandedStates() via @runInSeparateProcess

https://gerrit.wikimedia.org/r/838817

Krinkle assigned this task to Jdforrester-WMF.