Commit Graph

112 Commits

Author SHA1 Message Date
Kunal Mehta 7a53bd905c Disable PHPCS more narrowly
Change-Id: I20d8b519d5827e865ccd3adf7c2c6ba069f37afb
2018-05-03 19:00:55 -07:00
Moritz Schubotz (physikerwelt) 88546ae1ad
Move phpunit test files
* currently the phpunit tests are not triggered by jenkins
* some test can't be re-enabled possible reasons:
** the texvc and texvccheck binaries are not available from jenkins
** the binaries can not be generated
** the path to the binaries are not set up correctly

Bug: T142120
Change-Id: I0c8fe5ad652c4663eeb029781521acbf56e42bad
2018-04-22 10:09:12 +02:00
Jayprakash12345 270b942c64 Update extensions to take advantage of parser test autodiscovery
Bug: T170037
Change-Id: I2fe982bc146355d7faec03e39a2a59e9d32e22be
2018-04-13 17:37:23 +00:00
jenkins-bot 0a8608399a Merge "Fix MathFormatter failing on new SnakFormatter format MIME types" 2018-04-13 16:11:03 +00:00
Thiemo Kreuz 1f87afa8e6 Fix MathFormatter failing on new SnakFormatter format MIME types
A formatter like this is not supposed to check if the format is known
or not. The code calling these formatters can introduce new (sub) formats
any time. What a formatter like this should do then are two things:
* If it's some HTML format, always return HTML.
* If you really can't identify the format, do a sensible fallback.

This currently blocks introducing a new format in Wikibase.

Bug: T46727
Change-Id: I585069e8f2ba33ec657ca4d514c6d502fe0f5ba3
2018-04-13 14:46:58 +00:00
jenkins-bot 3291177420 Merge "Use "@license GPL-2.0-or-later" according to SPDX" 2018-04-13 14:21:44 +00:00
jenkins-bot 04e17f7e1e Merge "Remove non-helpful comments" 2018-04-13 14:09:33 +00:00
Thiemo Kreuz 945ef79559 Use "@license GPL-2.0-or-later" according to SPDX
Change-Id: I5b9ba062f51dce9fcc10f7c31f37c137176bfff3
2018-04-13 16:07:10 +02:00
Thiemo Kreuz 920ca42c59 Remove insonsistent "@ingroup Extensions" tag
This is obviously copy-pasted from somwhere else. Note that this tag
only appears in these two files. No other file does have it. It's not
useful for anything this way.

Change-Id: I7e0dcf0594fb59b396b1fd26b13383d59227b3f9
2018-04-13 15:33:41 +02:00
Thiemo Kreuz 3f0398e031 Remove non-helpful comments
Documenting protected members as protected members is not really helpful.
One can see this by looking at the code.

Same for documenting a variable named "$html…" as "HTML". This does not
add anything.

Change-Id: I72364b6857166d77b9c85aa884cd139dc163c6bb
2018-04-13 15:32:05 +02:00
libraryupgrader 5a076f94aa build: Updating mediawiki/mediawiki-codesniffer to 17.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.LicenseComment.InvalidLicenseTag

The following sniffs now pass and were enabled:
* MediaWiki.Commenting.FunctionComment.MissingParamComment

Change-Id: Ia8000677263c4150d4900526bcba1c0602664b8e
2018-03-29 03:44:44 +00:00
Umherirrender 43b187e6fd Move @covers closer to test class
Change-Id: I25987f180c134b53f7ade3e2a2225328f5b088a8
2018-03-10 12:20:29 +00:00
Moritz Schubotz d8822169ab
Mathoid CLI interface
Renders formulae via mathoid without to run mathoid as a service.
Mathoid 0.7.1 or later must be installed locally and configured to be
accessed directly from the math extension. It has been tested with the
config.dev.yaml of version 0.7.1. If mathoid is installed in
'/srv/mathoid' the following line might be added to LocalSettings.php
$wgMathoidCli = ['/srv/mathoid/cli.js', '-c', '/srv/mathoid/config.dev.yaml'];
i.e., make sure to specify the -c parameter with an absolute path.
In addition mathoid uses more memory than the the default. With
the config.dev.yaml a value of
$wgMaxShellMemory = 2097152;
has been tested to work well.

Change-Id: I0600f056d21927963267cf979d342e313419e9fa
2018-02-21 20:29:20 +01:00
Moritz Schubotz (physikerwelt) 26e9f00c2a
Fix broken links in phpunit covers annotations
Phpunit now checks if the coverage annotations are reasonable.

This fix corrects unresolvable references in phpunit covers annotations.

Change-Id: I7eba10bd7dc445b175df750465bb80bd5ef0f4c6
2018-02-05 16:24:46 +01:00
Umherirrender 13d43ec6be Rename files to match classes
Change-Id: Iecf3ea2d0e7ec3dc0f743a3d1a8d85463939d19d
2017-12-10 12:42:41 +01:00
libraryupgrader bc0b7ee838 build: Updating mediawiki/mediawiki-codesniffer to 0.12.0
The following sniffs are failing and were disabled:
* MediaWiki.Files.ClassMatchesFilename.NotMatch
* MediaWiki.Files.ClassMatchesFilename.WrongCase
* MediaWiki.Files.OneClassPerFile.MultipleFound

Change-Id: Ia2c06ebe33acefdf03625d86d98bf0dbaf826c4c
2017-09-01 04:53:09 +00:00
Kunal Mehta df1689c717 build: Updating mediawiki/mediawiki-codesniffer to 0.11.0
Change-Id: I8ce8155621fbfc5cb3dcf5dafbfa89796d0c1f11
2017-08-10 23:57:43 -04:00
Umherirrender 2bbb86b868 Improve some parameter docs
Change-Id: If7d52d77935b7dd6cddd583b9a6215735fa8b91e
2017-08-09 22:56:19 +02:00
Thiemo Mättig bdeec56d1f Fix and add missing documentation and fix minor code smell issues
Change-Id: Ifa2f8a47fbd0bdd20334f59dd06a21339b9a4292
2017-07-10 11:40:12 +02:00
Kunal Mehta fbd17b4fef build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.DuplicateReturn
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Commenting.FunctionComment.ParamNameNoMatch
* MediaWiki.Commenting.FunctionComment.WrongStyle
* MediaWiki.FunctionComment.Missing.Protected
* MediaWiki.FunctionComment.Missing.Public
* MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment

Change-Id: I46c900a5652a6560d18be6cd67badc37ed7f8d97
2017-06-21 00:59:25 +00:00
Moritz Schubotz f5fdda0ba1 Improve error reporting
Display error message in the UI,
if the check command passes,
but the mml/svg/complete endpoints returns an valid json error.

Bug: T143225
Change-Id: I50776926e42f75a2c1e30fc9afe08baae3fcdbd1
2016-08-17 21:15:02 +02:00
Željko Filipin 61abb07b5d Fix Watir::Wait::TimeoutError in Selenium tests
Bug: T137711
Change-Id: I9aeb9d4c38bff31bdc2f248b74b6797a4e518f3d
2016-06-13 17:03:40 +02:00
Željko Filipin c4636667d4 Fix Cucumber scenario that is broken in daily Jenkins jobs
"Welcome to Wikipedia" popup broke the scenario.

Bug: T94150
Change-Id: I5d3b41b8f3060f6edc41a5afe2c992fc6faca4e7
2016-05-16 18:11:59 +02:00
Željko Filipin d2ff0ef699 Fixed broken Selenium test
The test is broken on beta cluster because the formula is rendered as
meta tag. It is rendered at img tag on my mediawiki-vagrant virtual
machine. The test now works on both environments.

Bug: T128190
Change-Id: I458d618af24533d104fcac25a8d8c6468b14605a
2016-04-26 19:07:49 +02:00
jenkins-bot 462178f320 Merge "Migration of browsertests* Jenkins jobs to selenium* jobs" 2016-04-25 17:05:39 +00:00
Željko Filipin 7bc7a0cabf Migration of browsertests* Jenkins jobs to selenium* jobs
selenium* jobs are a new way of running Ruby based Selenium tests. The
jobs are triggered daily.

Bug: T128190
Change-Id: Ide349ea15e0c38ff9f61d348abd61cd2349a83f6
2016-04-25 18:31:00 +02:00
physikerwelt 6b984122a1 Ensure use of ; to seperate svg styles
It was reported that under certain circumstances a semicolon was
missing from the SVG style.

Bug: T132563
Change-Id: I148433657848fdc74889fcaf6d883078c46a4006
2016-04-21 08:55:21 +00:00
physikerwelt 6f7bcaf2c6 Update to mediawiki-codesniffer 0.6.0
Change-Id: I2a1a74c771bc00f6c1569568dfcf474f06714426
2016-04-19 17:07:21 -04:00
physikerwelt 6699724d65 Convert all array() syntax to []
Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Change-Id: I1d2604e3f246ede58ff8245ba2b940f258d2d80c
2016-04-13 10:18:23 -04:00
physikerwelt 31cd0d611a Insert MathML content after tidy
* BeforeTidy caused problems when math tags were used
  within links.

Bug: T130508
Change-Id: Icb9b88a7552d14231f96cbfd2b3cf3fa7e29276d
2016-03-24 13:31:15 +00:00
daniel 7018e85b7d Show TeX in wikibase diffs.
Diffs should show the rendered output as well as the TeX source,
so changes that do not affect the output noticably can still be
assessed by looking at the diff.

Bug: T125712
Change-Id: I098d30ea3158ec34723bfca313cf2bcc4cbc591f
2016-02-25 12:59:12 +01:00
Željko Filipin a4948c208a Fixed failing Selenium test
When user is logged in, visual editor is the default editor. When user
is not logged in, source editor is the default editor. When the test
does not log in, everything works just fine.

Bug: T126463
Change-Id: I1f15000a275657c0a92172781f57c5d1db537dcc
2016-02-22 09:51:24 +00:00
physikerwelt 9e605e09cd Render all math tags in parallel
Bug: T125543
Change-Id: Ia2febf2c0309e5de514445ad2aad58b7e5ce6837
2016-02-18 02:25:38 +00:00
Željko Filipin 11825b9c17 Fixed broken Selenium test
The problems was that visual editor is the default editor at
en.wikipedia.beta.wmflabs.org, and the test was expecting source editor.

The test now works also locally, using mediawiki-vagrant.

Removed headers from some files. We no longer use those headers.

Removed cucumber tags we no longer use, mostly internet explorer.

Added missing dependency (rake) to gemfile.

Bug: T126463
Change-Id: Ia5809f40719a2fe0c6c94338072a38765fa5c87b
2016-02-15 12:50:48 +00:00
physikerwelt 5f16307582 RDF Formatter for Math data type
Bug: T126349
Change-Id: I15fbeec282868b4267a3e3d15740f2c3ff37ea48
2016-02-12 20:38:27 +00:00
Thiemo Mättig 129f0e4bcc Add more complete PHPDoc tags to all tests
... and remove some actual copy-paste mistakes.

Change-Id: Id2fd83edff774a7f07b0f5436cefe2bf5c0a63f0
2016-02-12 17:57:37 +01:00
physikerwelt 47f530b355 Support for chemical formulae
* Add support for LaTeX package mhchem.
* Add hook <ce>
* Add format <math chem>

See bug description for the details.

Bug: T98306
Change-Id: I2ab80834edc5d071618bc52f133cfb2b7ece5016
2016-02-07 18:55:58 +00:00
Thiemo Mättig 8b8d91a771 Clean up Wikibase related code
This fixes some warnings in my PHPStorm, gets rid
of duplicate code, inlines constants that do not
make the code easier to read, and more.

Change-Id: I02f446491509043f5d3e51e26e932f76c9ecb6cf
2016-01-25 16:22:07 +00:00
lyrianos93 946a18d14c Implement datatype 'Math' for Wikidata
This change implements all components to use the datatype 'Math' in Wikidata.
Because 'String 'is used as value type, only the Formatter and Validator are needed to be implemended.

The components are:
* hooks
* Formatter class
* Validator class
* Test cases

Bug: T67397
Change-Id: Ic64fd6c8560f48052e2db24ae1f013d48a82b5e9
2016-01-11 22:29:29 +00:00
Željko Filipin 30fd1cb9b3 Update mediawiki_selenium Ruby gem to the latest version
Bug: T114241
Change-Id: I81a6727fba46a0c9a628c0718e6159cfc8846c22
2015-12-17 12:58:34 +01:00
jenkins-bot dd06d7ed94 Merge "browser test: fix logic to find edit action" 2015-12-15 09:22:44 +00:00
Marko Obrovac c3ebc54994 Minor: rename checkTex() to checkTeX()
Change-Id: I9b1860562b2f4f2112b68c0c3d6f0390f0405fbe
2015-12-14 23:58:08 +01:00
Antoine Musso 0cebe64840 browser test: fix logic to find edit action
The simple math test failed to find the edit link on a non existent
page. It was looking for the text 'Create source' from Vector which is
now simply 'Create'.

Change the PageObject selector to use a CSS selector, more robust to
text changes.

Change-Id: Ifcbd07da8e343b5697fcff6af6ffac90ff4d6420
2015-12-14 21:24:13 +01:00
physikerwelt 897afa480b Use RestBase to check input tex rather than texvccheck
* This will increase the performance of tex rendering for all
 rendering modes since no shell access is required anymore.

 Merge with caution. If the connection to restbase fails, rendering
 of new formulae will be completely disabled i.e. broken.

Change-Id: I1982612e8c6a356e3dbdf447724ac82e5968cc77
2015-12-03 09:03:43 +00:00
physikerwelt f63eaeac23 Restbase based texvc input check
This change only connects the restbase and the mathinput interfaces
but does not change any functionality.

Change-Id: I3a23e5008c26c5f14ad842dcb5d22906a8aff33c
2015-12-03 08:56:47 +00:00
physikerwelt c66a85f143 Fix error in checking logic
Tex validation should be skipped if checking is disabled.
Consequently if 'disable tex filter' is set to 'never' it's a double
negation and tex should always be checked.
If 'disable tex filter' is set to always, never check tex.

Change-Id: Ic6fda8016838eae03a0ed36e3d8d4f35423ba8b1
2015-12-03 08:30:24 +01:00
physikerwelt 6ef2e56439 Add Restbase interface
* Add a simple interface to Restbase that currently
  does not do anything.

Change-Id: I4c2ef329b3954fd35276a5e270d0dc3fcacabf7b
2015-12-01 21:10:09 +00:00
paladox df8ad1c799 Add php code sniffer to composer
Add support for php code sniffer

Change-Id: I7dcdd88be4f1f8219f71ab770979284761e09bae
2015-09-23 10:46:14 +01:00
Željko Filipin 646fc8e94b Fixed Style/StringLiterals RuboCop offense
Bug: T111184
Change-Id: Ia51f271b5e06d7bbd9896634b832003d57c30900
2015-09-22 10:18:13 -07:00
Željko Filipin 2bda4398f4 Fixed Style/SpaceInsideHashLiteralBraces RuboCop offense
Bug: T111184
Change-Id: I77573a78136dc9a8fd6f8b7364e23c8bf6db5e7f
2015-09-22 10:18:13 -07:00