Selenium/Node.js/mediawiki-core-qunit-selenium-jessie Jenkins job

From MediaWiki.org
Jump to navigation Jump to search

For this example, you will need internet access. At the moment, mediawiki-core-qunit-selenium-jessie Jenkins job runs in test and gate-and-submit pipelines for a few repositories. For example, it runs automatically every time you push a mediawiki/core patch to Gerrit. It also runs in experimental pipeline for a few repositories. You can also start it manually.

Mwext-mw-selenium Jenkins job.png

Advantages[edit]

  • You do not have to install anything on your machine.
  • You are probably already familiar with Gerrit and Jenkins.
  • While the tests are running, you can continue using your machine as usual, because everything is happening in Jenkins.
  • Debugging failed tests will be reasonably easy, since you will see logs and screenshots of the test run.
  • It will be reasonable fast.
    • It takes about 3 minutes for the Jenkins job to run for mediawiki/core.

Disadvantages[edit]

  • You will need internet connection while running the tests.
  • You might not be familiar with Gerrit or Jenkins, so you will have to learn how to use yet another tool.

Check if the Jenkins job is configured to run for a repository[edit]

In layout.yaml look for the Jenkins job.

Example for mediawiki/core:

- name: mediawiki/core
...
  test:
...
    - mediawiki-core-qunit-selenium-jessie

Example for mediawiki/extensions/RelatedArticles:

- name: mediawiki/extensions/RelatedArticles
...
  experimental:
    - mediawiki-core-qunit-selenium-jessie

Run the Jenkins job[edit]

If the job is in test pipeline for a repository, uploading patch to Gerrit will run the job automatically.

If the job is in experimental pipeline for a repository:

  • Upload a patch to Gerrit.
  • Reply to the commit with check experimental
  • the Jenkins job will run
  • when all Jenkins jobs configured for the repository are finished, jenkins-bot will leave a comment in Gerrit with links
  • click mediawiki-core-qunit-selenium-jessie link
  • optionally, click Full Log link at the top of the page

Example:

00:00:00.000 Started by user anonymous
00:00:00.019 Building remotely on ci-jessie-wikimedia-579547 (ci-jessie-wikimedia) in workspace /home/jenkins/workspace/mediawiki-core-selenium-jessie
...
00:02:17.496 + npm run selenium
...
00:02:47.564 ------------------------------------------------------------------
00:02:47.564 [chrome #0-0] Session ID: e6f66f171e8300fe032c86b6cbdef7be
00:02:47.564 [chrome #0-0] Spec: /home/jenkins/workspace/mediawiki-core-selenium-jessie/src/tests/selenium/specs/user.js
00:02:47.564 [chrome #0-0] Running: chrome
00:02:47.565 [chrome #0-0]
00:02:47.565 [chrome #0-0]   User
00:02:47.565 [chrome #0-0]
00:02:47.565 [chrome #0-0]   User
00:02:47.565 [chrome #0-0]       ✓ should be able to create account
00:02:47.565 [chrome #0-0]       ✓ should be able to log in
00:02:47.565 [chrome #0-0]       ✓ should be able to change preferences
00:02:47.565 [chrome #0-0]
00:02:47.565 [chrome #0-0]
00:02:47.565 [chrome #0-0] 3 passing (25s)
00:02:47.565 [chrome #0-0]
00:02:47.565 
00:03:00.803 ------------------------------------------------------------------
00:03:00.803 [chrome #0-1] Session ID: c9158352ac40f07e043cfa8633e24f5d
00:03:00.803 [chrome #0-1] Spec: /home/jenkins/workspace/mediawiki-core-selenium-jessie/src/tests/selenium/specs/page.js
00:03:00.804 [chrome #0-1] Running: chrome
00:03:00.804 [chrome #0-1]
00:03:00.804 [chrome #0-1]   Page
00:03:00.804 [chrome #0-1]
00:03:00.804 [chrome #0-1]   Page
00:03:00.804 [chrome #0-1]       ✓ should be creatable
00:03:00.804 [chrome #0-1]       ✓ should be editable
00:03:00.804 [chrome #0-1]       ✓ should have history
00:03:00.804 [chrome #0-1]
00:03:00.804 [chrome #0-1]
00:03:00.804 [chrome #0-1] 3 passing (12s)
00:03:00.804 [chrome #0-1]
00:03:00.804 
00:03:00.860 Wrote xunit report to [../log/].
00:03:00.871 Wrote xunit report to [../log/].
00:03:00.871 
00:03:00.871 
00:03:00.871 6 passing (39.70s)
00:03:00.872 
00:03:00.877 
00:03:00.877 Done.
00:03:01.158 [PostBuildScript] - Execution post build scripts.
00:03:01.160 Waiting for the completion of castor-save
00:03:01.505 castor-save #353118 completed. Result was FAILURE
00:03:01.506 Recording test results
00:03:04.542 Archiving artifacts
00:03:06.830 Finished: SUCCESS