Commit graph

517 commits

Author SHA1 Message Date
Ed Sanders ba38b57c83 eslint: Lint Gruntile.js using server rules
Change-Id: Ic7d67098492558fdd6cec292afd22aaf8693a594
2022-02-07 16:30:24 +00:00
osamaahmed17 020b44c43a selenium: Delete invisible unicode characters
Bug: T300386
Change-Id: I7c5db54247dc5b4566996afcbfab70b5fd4696a8
2022-01-31 09:02:09 +00:00
Umherirrender 9bf6ceb738 Replace deprecated JobQueueGroup::singleton()
Change-Id: I298d8507f4ec706c235087b726b7b230ed5e9ac6
2022-01-25 22:24:53 +01:00
jenkins-bot a8af58f362 Merge "Parse section titles in notifs as if they weren't at the start of line" 2022-01-24 05:43:44 +00:00
jenkins-bot ceda28121f Merge "Adjust doc for EchoNotification::readTimestamp" 2022-01-21 08:11:26 +00:00
Bartosz Dziewoński 3493317d79 Parse section titles in notifs as if they weren't at the start of line
The section titles are wikitext extracted from inside heading markup
like `== … ==`, so start-of-line markup like `*` should not be parsed.

Bug: T299572
Change-Id: Ie3995b943e5fe20ad86041d6be755f14f32eb01e
2022-01-21 00:07:53 +01:00
Alexander Vorwerk 4c7726a9ec selenium: reenable skipping of flaky test
Bug: T299339
Change-Id: I4d0838bdd6f1d0e1e220d1d611ae3e6e5c2b80eb
2022-01-17 16:26:35 +01:00
Kosta Harlan e4803b42e3 selenium: Add missing await statements
Follows-Up: 8327d33c99e495b109d97df7b525181dfc41c18d
Bug: T293073
Change-Id: Ib1862b857955999dbe7085a247e215e31eb89cff
2022-01-17 18:05:59 +05:00
Kosta Harlan 73496ec386 selenium: Skip flaky test
Bug: T299339
Change-Id: I6ff5d9d0e90b447112f5efea1489030238b52fac
2022-01-17 13:21:35 +01:00
osamaahmed17 9903581028 selenium: Refactor Echo WebdriverIO tests from sync to async mode
WebdriverIO has dropped support of sync mode due to breaking changes in Chromium, hence all tests of Echo have been changed to async.

Bug: T293073
Change-Id: I8327d33c99e495b109d97df7b525181dfc41c18d
2022-01-17 04:32:20 +05:00
Umherirrender 8e974de839 Adjust doc for EchoNotification::readTimestamp
And simplify the null check
Fix tests to provide null and not the empty string

Change-Id: Ic0f2dc09525f1542c7e62da97ac0f3fe936ff67e
2022-01-05 20:29:03 +01:00
Umherirrender d4640b31f0 build: Update eslint-config-wikimedia to 0.21.0
This includes the update of lockFile version

Bug: T225730
Change-Id: I04f2c6ef8751b3ffff886da4b69c2ed80425de91
2021-12-21 23:08:09 +01:00
vladshapik a3c55f6272 Avoid using User::getOption() method
Replace User::getOption() with UserOptionsLookup::getOption() since this method will be hard-deprecated.

Bug: T296083
Change-Id: I0ecdc63b0344bc4c24196cc5edb3d02b6a7ed615
2021-12-10 13:37:45 +01:00
libraryupgrader 2c3d370846 build: Updating mediawiki/mediawiki-codesniffer to 38.0.0
Change-Id: I10e9f9f6ddd9539ff95636902219c0e9fa35fc0f
2021-10-24 02:46:52 +00:00
Alexander Vorwerk 449f82faa3 MediaWikiTestCase -> MediaWikiIntegrationTestCase
MediaWikiTestCase has been renamed to MediaWikiIntegrationTestCase in 1.34.

Bug: T293043
Change-Id: I68efac2c458748fa3ab16c4c652bd2c4af9cbb75
2021-10-12 00:42:10 +02:00
Matěj Suchánek 628122e155 Fix camelCase of getUserEnabledEventsBySections
Change-Id: I14b6750f7f3cc5334e3143f0e85ca033681b4e35
2021-08-20 17:03:28 +00:00
jenkins-bot 5cfc33d546 Merge "Add notifiertypes parameter to ApiEchoNotifications" 2021-08-19 05:06:57 +00:00
Matěj Suchánek 199c9084d4 Move isBundleExpandable to EchoAttributeManager
It's an attribute, so it is definitely the manager's
responsibility. Unit test case included.
(EchoDataOutputFormatter really calls for becoming a service.)

Change-Id: If2658dd8c107246158cd93cbb233d8af62fd4424
2021-08-18 18:23:22 -07:00
Michael Holloway 5eb4c6cd1d Add notifiertypes parameter to ApiEchoNotifications
Previously, ApiEchoNotifications returned only events which were
enabled for the `web` notifier type. With this change, the notifier
type or types to consider can be specified by argument to the new
`notifiertypes` parameter.

This change is required so that the apps can request notification
content from the API for push notifications.

Bug: T287909
Change-Id: I2d1155e113f2defb0f02416a7a659c3ee162d3a6
2021-08-17 10:27:14 -04:00
Matěj Suchánek ab8ea040ca Use constant in EchoAttributeManager::getNotificationSection
And as a bonus, add a unit test case to solve the todo.

Change-Id: Ic2e13eae6583155230be6c184db4836f28378483
2021-08-11 11:27:55 +02:00
jenkins-bot 66bb02fd8b Merge "Disable EchoGetEventsForRevision hook handlers while running tests" 2021-08-04 17:42:25 +00:00
jenkins-bot ec9ea8fc81 Merge "Tweaks to EchoTalkPageFunctionalTest" 2021-08-04 16:47:55 +00:00
jenkins-bot 5566f84378 Merge "Turn push notification token list into a circular buffer." 2021-07-30 14:46:10 +00:00
Dmitry Brant 6c5a88107c Turn push notification token list into a circular buffer.
At the moment we support a maximum of 10 tokens per user for subscribing
to push notifications, stored as a basic list that runs out when the
limit is reached.  There may, however, be some edge cases where an app
registers a token and then forgets to unregister it (and repeats this 10
times), after which time it will be unable to register any new token.

This changes the token list to behave more like a circular buffer, by
simply deleting the oldest token before inserting the new one. This way
an app could register a new token even in the rare case of forgetting
the previous ten.

Change-Id: I387de63460882e4e56d1aa6db1f78d73a0495208
2021-07-29 17:22:57 -04:00
Bartosz Dziewoński ee860bc577 Disable EchoGetEventsForRevision hook handlers while running tests
Extensions using this hook (e.g. DiscussionTools) cause test failures
otherwise.

Change-Id: I21159d03eebaf46ad94f4273ba698a59b8019185
2021-07-26 13:56:44 +02:00
libraryupgrader 17a644263a build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
  The following sniffs are failing and were disabled:
  * PSR12.Functions.ReturnTypeDeclaration.SpaceBeforeReturnType

npm:
* svgo: 2.3.0 → 2.3.1
  * https://npmjs.com/advisories/1754 (CVE-2021-33587)
* postcss: 7.0.35 → 7.0.36
  * https://npmjs.com/advisories/1693 (CVE-2021-23368)
* trim-newlines: 3.0.0 → 3.0.1
  * https://npmjs.com/advisories/1753 (CVE-2021-33623)

Change-Id: Id866782d39ac02a329bd79539f2d52392fffd296
2021-07-24 01:48:06 +00:00
Bartosz Dziewoński 762a2e192a Tweaks to EchoTalkPageFunctionalTest
* Fix off-by-one counting
* Fix asserting properties on the wrong event (first one instead of
  last one), luckily they are identical

Change-Id: Ib1a02476554b29b2a1d0bfdfa89859d71d7691b1
2021-07-21 23:25:54 +02:00
jenkins-bot a6dbadb006 Merge "Avoid using User::setOption()" 2021-07-17 10:29:45 +00:00
ZabeMath 3befbe0a69 Avoid using User::setOption()
User::setOption() is deprecated and should be replaced with UserOptionsManager::setOption()

Bug: T277818
Change-Id: I001301fb95635c421a0bbb921fd909c5312dc896
2021-07-17 09:52:53 +00:00
DannyS712 0099c45e54 AttributeManager: accept UserIdentity objects
Inject a UserOptionsLookup to replace deprecated
User::getOption()

Change-Id: I177f6d3486f987073e5d745077f0abfe9ae85aca
2021-06-29 06:41:47 +00:00
DannyS712 68f7a9a985 Use WikiPage::doUserEditContent() instead of ::doEditContent()
::doUserEditContent() is available since 1.36 as a replacement
for ::doEditContent(), which has been deprecated. Extension
already requires MediaWiki 1.37+, so the method is always
available.

Bug: T255507
Change-Id: Iee5de356dbccd453a3083e0a58859b4cd83a946b
2021-06-24 05:30:07 +00:00
jenkins-bot 73c124c498 Merge "selenium: Update wdio-mediawiki" 2021-05-26 15:07:07 +00:00
Željko Filipin b6a9950642 selenium: Update wdio-mediawiki
wdio-mediawiki v1.1.1:
- Includes wdio-defaults.conf.js file that vastly simplifies wdio.conf.js.
- Replaces @wdio/spec-reporter with @wdio/dot-reporter.
- Introduces video recording.

Bug: T283597
Bug: T276503
Change-Id: Ic80f90dbbd5604dc3c9afe3303862edbf46b1cd2
2021-05-26 13:36:53 +00:00
jenkins-bot c9839d897b Merge "selenium: Update README.md file" 2021-05-26 10:01:08 +00:00
anjali041 0001ee4dc3 selenium: Update README.md file
Bug: T282237
Change-Id: I87018d39e9a9d6fb101ad5e1f7c4f13f8200611e
2021-05-25 16:03:45 +00:00
Umherirrender 9ccc7af208 Remove PHP 5.3 $this closure workaround
Change-Id: I84024efc7bb27292bcfb7dd5c586b094828c5d0a
2021-05-15 01:58:55 +02:00
James D. Forrester 4dd2a651e1 phpcs: Auto-fix MediaWiki.Usage.StaticClosure.StaticClosure
Change-Id: I6a02902ffaa8a9b497d60b573a0b8e3dbc207ee5
2021-05-04 09:06:42 -07:00
libraryupgrader b3f948c59c build: Updating composer dependencies
* mediawiki/mediawiki-codesniffer: 35.0.0 → 36.0.0
* php-parallel-lint/php-parallel-lint: 1.2.0 → 1.3.0

Change-Id: I4b2fb7f46b6c0a5c33a6ad25f085de8ae13eb084
2021-05-04 09:05:15 -07:00
Željko Filipin 5d49c02f9f selenium: Add JUnit reporter
JUnit reporter is required to create the XML file that Jenkins uses to
create Test Result Trend chart for selenium-daily-beta-Echo
job.

Bug: T214686
Change-Id: I2dd3787ebfb20f6fee841d264de98bcd1da4b34e
2021-04-29 15:39:36 +02:00
jenkins-bot f43699503b Merge "Use ApiTestBase::doRequestWithToken" 2021-04-29 12:26:18 +00:00
Petr Pchelko 4750dbe3de Use ApiTestBase::doRequestWithToken
The old ApiTestCase::getTokenList relied on CSRF
token API deprecated in 1.26. Many years have passed,
it's time to swtich to new mechanisms.

Needed-By: I58aedec6942ac5d3c21574cb0072f00ef365098c
Change-Id: Iafe7a48eb0cdf8c2f1ec7fdee232c3f394fa15a3
2021-04-20 13:53:16 -07:00
Željko Filipin 64f1486d67 selenium: Delete tests disabled for more than 1 year
The entire mention.js file was disabled by Kosta Harlan
2 years ago in efd7594.

Bug: T280652
Change-Id: Id2c0bc8e73a58738d422df2abd9c9157f426ab15
2021-04-20 13:25:22 +00:00
jenkins-bot cd663b0fac Merge "TalkPageFunctionalTest: Only count our own events" 2021-03-09 09:01:34 +00:00
jenkins-bot 29cd094a6c Merge "Do not directly construct UserrightsPage in tests" 2021-03-05 10:11:57 +00:00
Petr Pchelko f4ea1fd8d7 Do not directly construct UserrightsPage in tests
Directly constructing SpecialPages is bad, they're not @newable
and core can change constructor signatures without deprecation
and break the tests.

Change-Id: Ifc82d29a00d3fd136c44e0699e6bbfa11b8cf2a6
2021-03-04 15:17:11 -07:00
Bartosz Dziewoński 7dbc4f6ce8 TalkPageFunctionalTest: Only count our own events
We're working on code in DiscussionTools that generates Echo events for
adding talk page comments (I7e0996843cdd70141e19d5c7ce66122204efa1b7),
and it was causing this test to fail.

Change-Id: I3099473a3113962911b9c77ede290142857a51b2
2021-03-04 16:29:57 +00:00
Jeena Huneidi 008ad5afe1 Remove deprecated User method getGroups
Replaces the deprecated user method getGroups with
UserGroupManager->getUserGroups.

Bug: T275148
Change-Id: Ie6215886c911382008b667e8e5b3298facfcd6a2
2021-02-26 21:47:58 -08:00
Jeena Huneidi 596729d852 Make AttributeManager a service
Adds AttributeManager to EchoServices so that dependencies of
AttributeManager can be injected.

Bug: T275148
Change-Id: I4fa5084d72914d16b6d218e7dd3521f5a1919b80
2021-02-26 12:58:23 -08:00
jenkins-bot fd61cf3082 Merge "Replace use of newMutableRevisionFromArray within new MutableRevisionRecord" 2021-02-03 22:52:56 +00:00
jenkins-bot a517f9ed2a Merge "Use monitored getTestUser() in tests if possible" 2021-02-03 14:37:30 +00:00