Personally I find this easier to read. It allows to maintain a compact
list of input values with the expected output.
Change-Id: Ifeb532e2b94c674b512b3c40f101977939b83cd5
We fixed this in I47b6d5b but broke it again in Ie8d8106. Let's
finally add a test for this edge-case.
Change-Id: I9a43518f9edf0fab05e76bbb02a30fefd039b77d
Some notes:
* Note that array_column() strips array keys. I checked and this is
fine here.
* Html::element() will skip attributes that are set to null or false.
Perfect fit here.
* I routinely remove comments that do notjing but repeat what the
code already says.
Change-Id: Ie7797b78f1af5d8404c9e97b333fac8c6b3ac85e
Removes functionality to
* select PNG rendering mode
* automated fallback to PNG images for SVG rendering
* PNG mode related class and tests
However, PNG images received from mathoid / restbase are still stored.
Bug: T311620
Change-Id: I595926027433182cc0396570bc3f1ce0cd2cafb3
Needed for I869af06896b9757af18488b916211c5a41a8c563, where I am
trying to change LanguageFactory in MediaWiki core not to use
MWException.
I truly feel mocked after working with this code. See if you can find
the two lines in this diff where the meaningful changes are.
Change-Id: Ifcb31dbb7113ce57526f06558cde2abedee317d7
TexUtil gets instanciated and loads a json for each node in Literal and Fun1. This is not necessary since it takes much RAM and time to load the corresponding JSON from files.
Bug: T321599
Change-Id: I91855ebc4437f075302ae13d367ca4902cc0f3ba
These tests are skipped in CI, but are ran locally.
Contains also preliminary fixes to make the assertions not crash
locally and a shellscript for downloading the json-file with tests locally.
Bug: T315223
Change-Id: If5da7e2a29d9179eabecbb4707ed244f5d445d39
For development history of this changeset see:
Id96a4b1b55e3959aab81f4ba436c5ac125f2a1bb
Bug: T312528
Change-Id: I61cfdbd63f8d50b072ada05927a134686fdd53d3
Texutil related functionalities and tests will come in other changeset.
Related code:
fb56991251/lib/nodes/
Bug: T312528
Change-Id: Iead338a31403348603442b43ae802270f6b1d675
Implement a rest API endpoint that displays the popup that is currently
only shown on a special page.
Code was revived from Idd22057a88312bf1a1cb5546d0a6edca5678d80d
Bug: T288076
Bug: T233099
Change-Id: I65fcbf25ac5818f6c649daf494c719921247e8f5
Add support for the new properties 'P9758' (symbol represents) and
'P2534' (in defining formula) for the special page that shows
in depth information about tagged formulae.
Bug: T312893
Change-Id: I39551e04487f77cca60c89e8c95293032fd5bd6a
The MathEntitySelector gets its config from wbRepo which caused a hard
dependency on the Wikibase client.
If the Wikibase client config is not available a default value (wikidata)
is used to determine the URL of the foreign repo.
As the dropdown will never do write operations, we restrict the repo
access to anonymous read only.
Bug: T313143
Change-Id: Iba33dfd32a78f4ad7c2e99a1f56218458ab884b4
MathWikibaseConfig introduced additional complexity by passing through
some services to MathWikibaseConnector.
The remaining options were just a list of properties that could also be defined as ServiceOptions.
Bug: T313646
Change-Id: Ib9083c0cb62f6d972befc7f5dc3ed47f55cf92a5
* add some basic tests
* migrate MathWikibaseConnectorTest to a unit test
Bug: T313331
Depends-On: Ic3b8d4f685d5cf648a02696284b6ee499502a12a
Change-Id: I38d6425eb5e2c52ae4362c4b8656223a8d9d90a5
* add some basic tests
* MathWikibaseConfig should also be transformed into a service in a follow
up to allow for better testing
Bug: T313331
Change-Id: Iec7446a06d9a117cdeba9d26616f4fdf8e8540ca
Running the updater twice (in test setup and in tests) confused posgres
-> Error 42P07: ERROR: relation "mathoid" already exists
Change-Id: I1113888a38a49ee79b94d83c305eb99baa75f802
Replace Content::getNativeData() calls with TextContent::getText() in Math extension.
Bug: T283679
Change-Id: Iaf3b7f82f14069374de8ede7b519d822f8d6010f
WebdriverIO has dropped support of sync mode due to breaking changes in Chromium, hence all tests have been changed to async.
Update npm packages: @wdio/*, wdio-mediawiki and webdriverio because async mode needs at least webdriverio v7.9.
Remove npm package: @wdio/sync.
Bug: T293076
Change-Id: I35b3b29c09e80306d14a12c5194efeead22a9804
Instead of modifying a page rendering hash,
use the proper mechanism of parser option
registration. The cache is still split on parser
option value. The 'math' option is lazy, since
not all pages contain 'math' tag and we want to
avoid an user preference lookup for every parse.
WARNING: this will invalidate ParserCache for
all pages that contain <math> tags, but according
to Moritz, this is about 1% of all pages, so we
should be fine.
Setting up the test is still rather hard and weird
due to very hacky rendering mode to user option
converter, and math renderer interaction with the DB.
This will be cleaned up later.
Depends-On: I92b3e18fabef4eecac2ec2a4844f1be2716e5d89
Change-Id: I3bce04684070ad306685dabbc51267def25773cd
This is doing a bulk of the job of creating a service
for working with math modes configuration. There's
still things to do, like moving math mode names,
and perhaps depending on default user options to
provide a bit more convenience, but that will be the
next step.
Change-Id: I1259a93651920f44104f2f5135e3e620c858be8d
When running tests locally I don't want to install wikibase
if I'm not working on wikibase-math integration. It's
annoying that some of the tests fail in this schenario.
Depends-On: Id996abdb353547b95d795494ba961b9a215ef2ef
Change-Id: I836c7a3bab5393b7482e985d9148226373ae0a58
Additionally - remove RestbaseInterface::checkBackend.
When HTTP requests are banned from unit tests this method
makes no sence.
MathoidCli tests were not reenabled cause it's a bit hard
to mock shell acceess. Hopefully as part of Shellbox
transition we can have MockShell trait in core and reenable
those tests
Bug: T265628
Depends-On: I350ed59af603a0504704af3265787a4be8f2dc2a
Change-Id: I294d0ed905193850dc38cb3071eb9b31c8863121
The overall aim is to make renderer and checker
proper services and stop storing each operation
state in them. This patch reduces the number of
places where we store the lastError. I've decided
to stop here in the first pass so that the patch
doesn't grow out of proportion.
Change-Id: Ice7e1f9f2f074d62ef1819355a510ce0b0335d88
Instead of having a separate method for getting the post data
in MathLateXML, we can just override getPostData method from
parent and make the makeRequest method signature much simpler.
Change-Id: I07b683856885396ff7b6b5a40df79399828c8214
This is not the job of an extension to be a load balancer.
This feature was already deprecated and is not used in WMF prod.
Change-Id: I950dbaf45bc40d9d9ed61b1c98b339d3d38326fc
JUnit reporter is required to create the XML file that Jenkins uses to
create Test Result Trend chart for selenium-daily-beta-Math
job.
Bug: T214686
Change-Id: Ic2373f3b89946cf191cfcb1dd9ed99608deb660c
* Reenable math validator tests
* Introduce $wgMathUseRestBase which defaults to true
and determines if mathoid is used via RESTbase or directly
* The effect of this change can be tested by setting $wgMathUseRestBase
to false, and then creating a new statement of a property with type math.
One should see a connection to mathoid for every new string and one should
also see the WAN cache for the check endpoint to fill up. Note that
setting WANObject cache to the database simplifies the investigation
of the WAN cache content.
Bug: T274436
Change-Id: I40109e9e09464da78bf855646fb800ee87c1ea67
* Keep status code and response in memory
* Allow external cache preloading.
This will be required for the one-stop mathoid batch rendering
* Duplicate functionality from the restBASE interface
** Error rendering
** Validity checks
** getter for validated tex
Depends-On: Ic779e671ada0d0306e0935e578b47c431abd520e
Change-Id: I066975b9ba03f5861f6c92687cba4743044ea82a
composer:
* mediawiki/mediawiki-codesniffer: 34.0.0 → 35.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPublic
* MediaWiki.Commenting.PropertyDocumentation.WrongStyle
* mediawiki/minus-x: 1.1.0 → 1.1.1
npm:
* eslint-config-wikimedia: 0.17.0 → 0.18.1
The following rules are failing and were disabled:
* no-useless-escape
Additional changes:
* Added the "composer phan" command to conveniently run phan.
Change-Id: I1c641a4945f94337ca22763920601400ee9ab691
Before the HTTP tests were blocked T265628, the Math extension did
test all examples from w:Help:TeX and additional regression test
against the configured mathoid/restbase instance. Effectively, those
tests did only verify the hashes returned from mathoid/restbase.
We now drop this kind of integration test.
Bug: T265646
Change-Id: Iffe5105457297fdc2222af9f11ff56e78c479f32
After deployment of changes for T207535 the test data does not match
longer the expected output and fails
Change-Id: I7bb83ef007a0896ae0b3673bef5c344c41c4d5a6
Expose the math checking service via the REST API.
Port the behaviour of the RESTbase check endpoint to a new endpoint
that uses the MediaWiki API.
* this endpoint does not (yet) provide actual rendering (only checking)
* consequently it does not supply the x-resource-location header
Bug: T252390
Change-Id: I28bcb9a925953062b43cd3481536784431edcd8a
Use WANObjectCache rather than genuine DB tables for greater
flexibility.
Note, this commit is the second step of Ifd89e2d9cb30fa15cc318f077b434207ed6b7214
Bug: T252390
Change-Id: Ifa7d943875f05088ef697a5a18ad292342a9b4ad
Introduce new namespace \MediaWiki\Extension\Math\ and move checking
code to this new namespace.
Note, this commit is the first step of Ifd89e2d9cb30fa15cc318f077b434207ed6b7214
Bug: T252390, T187154
Change-Id: I8c93f4b21d4a72ef2d52d4774d69e4ef55d037ec
Using assertContains() with string haystacks is deprecated and will not
be supported in PHPUnit 9. Refactor your test to use
assertStringContainsString() or assertStringContainsStringIgnoringCase()
instead.
Change-Id: Ic35f3c60a7f49dfe244b87192d7f161c117b37e1
Actual changes:
* Let the special page accept the subpage parameter, e.g.
[[Special:MathWikibase/Q6203]].
* Fix some of the message escaping issues in SpecialMathWikibase.
Messages that are just plain text and not supposed to contain any
parameters, wikitext, HTML, or something like this should be
properly escaped, either via Html::rawElement( $msg->escaped() ) or
better Html::element( $msg->plain ). The later approach is cheaper.
Other code cleanups that don't affect production:
* Reduce the amount of duplicate code in SpecialMathWikibase.
* Make use of the preg_match() return value.
* Remove default parameters from parent::__construct() call.
* Remove some auto-generated comments.
* Remove some comments that don't add new information, but just repeat
what the code already says.
* Make use of PHPUnit's assertCount().
We can split this patch into smaller patches, if you prefer. This
should especially be done if one of the changes is controversial, to
not block the other changes. Please tell me.
Change-Id: I8c20014435af3d2ac9c7381fe5fd00b9fe49b2c2
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate
Change-Id: I57bb0f5bc4167ea4b4a50d666ad95c02fcc7d8c9