Page MenuHomePhabricator

Cannot find module nodemw
Closed, InvalidPublic

Description

Cannot find module 'nodemw' is because of T181284. I am trying to fix it, but I am having a hard time running tests locally. All tests are failing. :( Can you please make sure extensions/AdvancedSearch/tests/selenium/README.md is up to date?

Failures: 392854, 417945.

Related Objects

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
zeljkofilipin triaged this task as High priority.Mar 21 2018, 4:47 PM
zeljkofilipin moved this task from Backlog 🔙 to In Progress 🔨 on the User-zeljkofilipin board.

I do not know if line 11 is correct:

vagrant roles enable advancedsearch cirrussearch

The failures in 392854 don't seem related to nodemw module.
I personally think there's nothing incorrect or missing from extensions/AdvancedSearch/tests/selenium/README.md
Running "npm install" should take care of installing this nodemw dependency. It should be listed in package.json and present in node_modules in mediawiki core. Version of nodemw used is 0.11.0.
I realize that might not be super helpful, but it's all I can say at this point and I'm not sure how to check if this is present on the CI server.
Hopefully @thiemowmde can help further.

Change 421264 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/AdvancedSearch@master] Add local dependency on nodemw

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

Change 421270 had a related patch set uploaded (by Thiemo Kreuz (WMDE); owner: Thiemo Kreuz (WMDE)):
[mediawiki/extensions/AdvancedSearch@master] Temporarily disable two failing browser tests

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

I tried a whole bunch of things in https://gerrit.wikimedia.org/r/421264 as well as https://gerrit.wikimedia.org/r/421270. While doing so I got so many different failures, I believe we are not dealing with a single dependency issue, but with a multitude of probably unrelated issues.

  • The nodemw dependency was removed from MediaWiki core two days ago via https://gerrit.wikimedia.org/r/417848. That's the trivial reason why it can't be found any more.
  • AdvancedSearch can follow core and replace this now unsupported module with mwbot. Two tests need to be partially rewritten. We believe this is feasible. → T190426: Refactor AdvancedSearch browser tests which use nodemw module
  • The fact that core can remove a dependency that is needed by an extension is painful, but (to my knowledge) intended. Extensions should bind against a specific version of MediaWiki core, and automatically get all of core's dependencies. It's said that extensions should not bind against these dependencies again, because this will lead to unresolvable situations when dependency versions conflict. This is an unfortunate situation. The best solution I know is to make sure AdvancedSearch is part of the test that is run for every core change. → Needs a ticket.
  • It appears like AdvancedSearch can pull in the nodemw dependency via it's local package.json. The errors become different with this. However, the two tests that use nodemw still complain "Cannot find module 'nodemw'".
  • A reoccurring error in my tests is "Maximum call stack size exceeded". @Tonina_Zhelyazkova_WMDE and volunteers have been able to reproduce this, see T190494: Namespace filter missing for advanced search on beta.wmflabs. It appears this will be resolved via T189130: Allow an empty namespace bar.
  • It looks like the individual browser test cases, each starting with an it( … ), are not independent from each other. If one fails, the following in the same file fail with more and more ridiculous reasons (e.g. the most basic waitForAdvancedSearchToLoad failing). I don't know if this is an issue that's worth looking into.
  • All input fields with "pills" (ArbitraryWordInput in the AdvancedSearch codebase) make tests fail. I can't tell why this didn't happened before, but I can see why it happens now. The test simulates very fast keypresses. Each keypress triggers ArbitraryWordInput.buildTagsFromInput, which turns plain text into pills. This is done asynchronously. When you type "test test2" very fast, the pills you get are test t te tes test2. I believe this needs fixing in the implementation. → Needs a ticket.

Change 421270 abandoned by Thiemo Kreuz (WMDE):
[WIP] Temporarily disable two failing browser tests

Reason:
In I189db67 I renamed the two files, instead of deleting them.

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

zeljkofilipin removed zeljkofilipin as the assignee of this task.Mar 23 2018, 3:23 PM

@thiemowmde and @Tonina_Zhelyazkova_WMDE are working on this.

I personally think there's nothing incorrect or missing from extensions/AdvancedSearch/tests/selenium/README.md
Running "npm install" should take care of installing this nodemw dependency. It should be listed in package.json and present in node_modules in mediawiki core. Version of nodemw used is 0.11.0.

Sorry, I was not explicit enough. I was not talking about missing nodemw package. Looks like vagrant roles enable advancedsearch cirrussearch does not set up AdvancedSearch correctly. If I follow the readme to set it up:

cd mediawiki/vagrant
vagrant up
vagrant roles enable advancedsearch cirrussearch
vagrant provision
cd mediawiki
npm install

And then run the tests:

npm run selenium

All the tests fail. I was not even running tests that use nodemw.

[chrome #0-0] Session ID: 5f23c6b8ebdd747a43c43c47e5698b93
[chrome #0-0] Spec: /Users/z/Documents/gerrit/mediawiki/vagrant/mediawiki/extensions/AdvancedSearch/tests/selenium/specs/searchSubmit.js
[chrome #0-0] Running: chrome
[chrome #0-0]
[chrome #0-0]   Advanced Search submit
[chrome #0-0]
[chrome #0-0]   Advanced Search submit
[chrome #0-0]       1) no search preview is shown in expanded state
[chrome #0-0]       2) shows search preview in collapsed state
[chrome #0-0]       3) collapses search preview after submission
[chrome #0-0]
[chrome #0-0]
[chrome #0-0] 3 failing (33s)
[chrome #0-0]
[chrome #0-0] 1) Advanced Search submit no search preview is shown in expanded state:
[chrome #0-0] element (".mw-advancedSearch-container") still not visible after 5000ms
[chrome #0-0] Error: element (".mw-advancedSearch-container") still not visible after 5000ms
[chrome #0-0]     at elements(".mw-advancedSearch-container") - isVisible.js:54:17
[chrome #0-0]     at isVisible(".mw-advancedSearch-container") - waitForVisible.js:73:22
[chrome #0-0]
[chrome #0-0] 2) Advanced Search submit shows search preview in collapsed state:
[chrome #0-0] element (".mw-advancedSearch-container") still not visible after 5000ms
[chrome #0-0] Error: element (".mw-advancedSearch-container") still not visible after 5000ms
[chrome #0-0]     at elements(".mw-advancedSearch-container") - isVisible.js:54:17
[chrome #0-0]     at isVisible(".mw-advancedSearch-container") - waitForVisible.js:73:22
[chrome #0-0]
[chrome #0-0] 3) Advanced Search submit collapses search preview after submission:
[chrome #0-0] element (".mw-advancedSearch-container") still not visible after 5000ms
[chrome #0-0] Error: element (".mw-advancedSearch-container") still not visible after 5000ms
[chrome #0-0]     at elements(".mw-advancedSearch-container") - isVisible.js:54:17
[chrome #0-0]     at isVisible(".mw-advancedSearch-container") - waitForVisible.js:73:22
[chrome #0-0]

When I looks at screenshots, looks like search is not working.

The failures in 392854 don't seem related to nodemw module.

Correct. Looks like I have assumed the job is broken because of nodewm, I guess I did not look at the job output.

Running "npm install" should take care of installing this nodemw dependency. It should be listed in package.json and present in node_modules in mediawiki core. Version of nodemw used is 0.11.0.
I realize that might not be super helpful, but it's all I can say at this point and I'm not sure how to check if this is present on the CI server.

nodemw was a dependency of mediawiki/core. Selenium tests are executed from mediawiki/core and they automatically find tests in extensions and skins. Adding nodmw as a dependency of a extension or skin would not help.

  • The fact that core can remove a dependency that is needed by an extension is painful, but (to my knowledge) intended. Extensions should bind against a specific version of MediaWiki core, and automatically get all of core's dependencies. It's said that extensions should not bind against these dependencies again, because this will lead to unresolvable situations when dependency versions conflict. This is an unfortunate situation. The best solution I know is to make sure AdvancedSearch is part of the test that is run for every core change. → Needs a ticket.

Sorry, I was trying to get as much reviews as possible before replacing nodemw with mwbot, but looks like I have missed this problem. If you would like to be included in future reviews of Selenium framework changes, please leave a comment at T188744: Find a few people interested in reviewing Selenium patches.

  • It appears like AdvancedSearch can pull in the nodemw dependency via it's local package.json. The errors become different with this. However, the two tests that use nodemw still complain "Cannot find module 'nodemw'".

I have explained this a few minutes ago, so I'll just quote myself. 😄

nodemw was a dependency of mediawiki/core. Selenium tests are executed from mediawiki/core and they automatically find tests in extensions and skins. Adding nodmw as a dependency of a extension or skin would not help.

zeljkofilipin closed this task as Invalid.Mar 26 2018, 11:58 AM

Nothing to do in this task, this will be fixed with T190426: Refactor AdvancedSearch browser tests which use nodemw module.

Change 421264 abandoned by Thiemo Kreuz (WMDE):
Add local dependency on nodemw

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