Page MenuHomePhabricator

mwext-testextension-zend should load extension mathsearch after math
Closed, ResolvedPublic

Event Timeline

Physikerwelt raised the priority of this task from to Medium.
Physikerwelt updated the task description. (Show Details)
Physikerwelt added subscribers: Physikerwelt, hashar.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptNov 4 2015, 6:11 AM
hashar closed this task as Resolved.Jul 18 2017, 12:32 PM
hashar claimed this task.

That is quite an old bug. The PHPUnit job seems to pass just fine nowadays, I guess Math and MathSearch can now be loaded in random orders (which they should).

Physikerwelt reopened this task as Open.Jul 18 2017, 4:07 PM

No, currently the tests for mathsearch do not run at all. cf. https://gerrit.wikimedia.org/r/#/c/364981/ Mathsearch still depends on the extension Math and I don't see a reasonable way to change that.

greg removed hashar as the assignee of this task.Jul 26 2017, 10:04 PM

Both are migrated to extension.json already. Does it help to set required: Math in MathSearch's extension.json? That should fix the load order.

See also T87390

Last failure seeing:

Fatal error: Couldn't find constant Wikibase\Lib\SnakFormatter::FORMAT_HTML_WIDGET in /home/jenkins/workspace/mwext-testextension-hhvm-jessie-non-voting/src/extensions/MathSearch/ContentMathFormatter.php on line 37

Change 444233 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/extensions/MathSearch@master] MathSearch requires Math to be loaded first

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

Change 444233 abandoned by Hashar:
MathSearch requires Math to be loaded first

Reason:
It still can not find Wikibase\Lib\SnakFormatter::FORMAT_HTML_WIDGET since it got removed in Wikibase by 334a1a04eb1b1083b263d191424968dcd8419a46

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

The load order might not matter anymore. MathSearch currently fails to find Wikibase\Lib\SnakFormatter::FORMAT_HTML_WIDGET which has been removed from Wikibase in July 2017 by 7e7145bcc73ba8d6731d4be1f82c51fd8bcbd3a1 and 334a1a04eb1b1083b263d191424968dcd8419a46

Math got it removed via https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Math/+/364169/ so probably we just have to do the same for MathSearch.

Change 444237 had a related patch set uploaded (by Hashar; owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/MathSearch@master] Remove deprecated SnakFormatter::FORMAT_HTML_WIDGET constant

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

Now MathSearch fails because it lacks support for SnakFormatter::FORMAT_HTML_VERBOSE.

Change 444237 merged by jenkins-bot:
[mediawiki/extensions/MathSearch@master] Remove deprecated SnakFormatter::FORMAT_HTML_WIDGET constant

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

Next issue:

InvalidArgumentException from line 40 of extensions/MathSearch/ContentMathFormatter.php: Unsupported output format: text/html; disposition=verbose

Change 444379 had a related patch set uploaded (by Hashar; owner: Hashar):
[mediawiki/extensions/MathSearch@master] Add SnakFormatter::FORMAT_HTML_VERBOSE support

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

Please change this code to not use any of the Wikibase constants, but read the incoming format as MIME type. E.g. see if the format string starts with "text/html".

More precisely: The entire switch is wrong and should simply be removed.

See https://phabricator.wikimedia.org/diffusion/EMAT/browse/master/src/MathFormatter.php and it's history for reference.

Change 444379 merged by jenkins-bot:
[mediawiki/extensions/MathSearch@master] Stop validating SnakFormatter formatters

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

Physikerwelt raised the priority of this task from Medium to High.Jan 16 2020, 11:04 AM

The fact that MathSearch is currently disabled in Jenkins is not optimal. See ,e.g., T242957

@hashar @Jdforrester-WMF is there anything I can contribute to get the php unit tests running for new patches uploaded to gerrit? Was there any progress to allow self-serviced test setups a la travis?

Physikerwelt lowered the priority of this task from High to Medium.Jan 16 2020, 4:15 PM

wait... I can just write a travis job and then I will be notified if something broke post merge. theoretically not optimal but in practice almost as good for this little extension.

Jdforrester-WMF added a comment.EditedJan 23 2020, 10:44 PM

Hey, I'm trying to understand what this task is asking. Is it:

  1. When patches are written in the MathSearch extension, they should be tested alongside the Math extension and only merge if they all pass.
  2. When patches are written in the Math extension, they should be tested alongside the MathSearch extension and only merge if they all pass.
  3. When patches are written in either the Math or MathSearch extensions, they should be tested alongside the other one extension and only merge if they all pass.

… or something else?

@Jdforrester-WMF somehow this reply slipped through my attention. It is actually much simpler. Running the tests in MathSearch requires the extension Math to be installed. I realized that I can now model this in extension.json :-)

Change 586079 had a related patch set uploaded (by Physikerwelt; owner: Physikerwelt):
[mediawiki/extensions/MathSearch@master] Specify that extension MathSearch depends on extension Math

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

Change 586079 merged by jenkins-bot:
[mediawiki/extensions/MathSearch@master] Specify that extension MathSearch depends on extension Math

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

Change 586095 had a related patch set uploaded (by Physikerwelt; owner: Physikerwelt):
[integration/config@master] Reenable tests for MathSearch

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

Change 586113 had a related patch set uploaded (by Physikerwelt; owner: Physikerwelt):
[mediawiki/extensions/Math@master] Change default for MathLaTeXMLUrl

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

Change 586113 merged by jenkins-bot:
[mediawiki/extensions/Math@master] Change default for wgMathLaTeXMLUrl

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

Change 586095 merged by jenkins-bot:
[integration/config@master] Reenable tests for MathSearch

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

Mentioned in SAL (#wikimedia-releng) [2020-04-06T21:23:00Z] <James_F> Zuul: Run CI for MathSearch T117659

Physikerwelt closed this task as Resolved.Apr 7 2020, 7:19 AM
Physikerwelt claimed this task.

Yes. Thank you.

	"requires": {
		"MediaWiki": ">= 1.32.0",
+		"extensions": {
+			"Math": ">= 3.0.0"
		}
	},

That is a nice two lines fix for such an old task. Congratulations @Physikerwelt !