Commit graph

11 commits

Author SHA1 Message Date
Timo Tijhof
215c1f8ecc tests: Use a fancy generator provider in ReleaseNotesTest
Follows-up ffc23ee333.

Change-Id: I99bf0d7115f6d2a84eb499d104d9cd227331c20f
2019-07-02 19:49:43 +01:00
Antoine Musso
ffc23ee333 test: refactor/speed up release note file test
The test ReleaseNotesTest:testReleaseNotesFilesExistAndAreNotMalformed
takes 4 seconds on my machine. That is due to assertLessThanOrEqual
being invoked for each lines of various files at the root of the
repository. HISTORY has more than 20000 lines and assert functions are
rather slow.

Refactor the test:
* extract the logic to verify the file length of various files to a
  standalone test and with a dataprovider.
* flip the boolean logic ensuring whether the file exists. When it does
  not, PHP emit a warning which breaks the test anyway.
* Check the line lenght and collect errors in an array, then for each
  file run a single assertion to ensure the array of errors is empty.
  That effectively get rid of assertLessThanOrEqual overhead.
* Use assertSame() to show the full faulty line. assertEqual() shorten
  the arrays content.

Running tests went from 4 seconds to 700 ms on my machine.

Bug: T227067
Change-Id: I9bbbc6647ba9732b462e331e4b6d4acffe35e7cd
2019-07-02 12:12:19 +02:00
Legoktm
4e35134f7a Revert "Separate MediaWiki unit and integration tests"
This reverts commit 0a2b996278.

Reason for revert: Broke postgres tests.

Change-Id: I27d8e0c807ad5f0748b9611a4f3df84cc213fbe1
2019-06-13 23:00:08 +00:00
Máté Szabó
0a2b996278 Separate MediaWiki unit and integration tests
This changeset implements T89432 and related tickets and is based on exploration
done at the Prague Hackathon. The goal is to identify tests in MediaWiki core
that can be run without having to install & configure MediaWiki and its dependencies,
and provide a way to execute these tests via the standard phpunit entry point,
allowing for faster development and integration with existing tooling like IDEs.

The initial set of tests that met these criteria were identified using the work Amir did in
I88822667693d9e00ac3d4639c87bc24e5083e5e8. These tests were then moved into a new subdirectory
under phpunit/ and organized into a separate test suite. The environment for this suite
is set up via a PHPUnit bootstrap file without a custom entry point.

You can execute these tests by running:
$ vendor/bin/phpunit -d memory_limit=512M -c tests/phpunit/unit-tests.xml

Bug: T89432
Bug: T87781
Bug: T84948
Change-Id: Iad01033a0548afd4d2a6f2c1ef6fcc9debf72c0d
2019-06-13 22:56:31 +02:00
Reedy
bd292da07f Check line length of HISTORY
Slight modifications, almost all for URLs.

Change-Id: I612852e9a677a6a14fd48e2ccd7fcb998da9152a
2019-04-02 13:10:34 -07:00
Reedy
f3b090c31f Fix off by 1 error when displaying the number of a line with an error
Change-Id: I876ba04f6903127a9d5adedfe0a5e2598a90068c
2019-03-24 20:57:31 +00:00
Reedy
31c94f5227 Use foreach for readability
Change-Id: Ia4701bc50d8c57b9dcafe2da3bb399d59f4c8d0e
2019-03-24 20:14:07 +00:00
Thiemo Kreuz
b0615e1249 Remove empty and unnecessary /* @{{ … */ comments
This was the only comment I could find that uses two curly brackets
for some reason. There are a few more with one curly bracket.

Change-Id: Iaed631916064e6be4895edd4c7a3d7de491e16c2
2019-03-15 14:59:19 +01:00
James D. Forrester
a47aec961e INSTALL, UPGRADE: Re-wrap to 80 chars and enforce
Change-Id: Idabcc4db7a0b25448e7ad30641763e2b3e1a3160
2018-10-16 19:45:25 -07:00
Timo Tijhof
506c2f4d57 RELEASE-NOTES: Use New/Changed/Removed pattern for Configuration section
This was already used for external libraries. This commit
changes the order to be consistently 'New/Changed/Removed',
and adopts the pattern for configuration changes as well.

For improved scannability, the bullet points now start with
the name of the configuration setting(s), followed by a sentence,
with an optional ticket in brackets after the sentence(s).

* A number of bullet points under "Configuration changes" were
  in fact, not configuration changes. These have been moved to
  "New features" or "Other changes" for now.

* Add mention of the relevant configuration variable to some
  of the release notes: $wgTidyDriver, `watchlistdays`,
  $wgGroupPermissions, $wgGroupPermissions.

Also fix ReleaseNotesTest to count characters, not bytes,
this was causing it to count – as two, and € as three.

Change-Id: Ie89dac6408f8a8dafbf59efe73a11f4d282c0c6b
2018-09-01 19:59:30 +00:00
James D. Forrester
1b5ed07827 tests: Add a doc test for release notes' existence and line length
Change-Id: I502bedc0221e52b78b15b1749918500842533e7c
2018-07-13 17:10:03 -07:00