Zfilipin has uploaded a new change for review.

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

Change subject: Simplify creating of Jenkins jobs for running browser tests 
daily
......................................................................

Simplify creating of Jenkins jobs for running browser tests daily

Bug: T128190
Change-Id: I4ccfccbe627ba80a1cf87eafc481b4c8d4d80b46
---
M jjb/browsertests.yaml
A jjb/job-templates-selenium.yaml
A jjb/macro-selenium.yaml
A jjb/selenium.yaml
4 files changed, 160 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/config 
refs/changes/36/274136/1

diff --git a/jjb/browsertests.yaml b/jjb/browsertests.yaml
index 8846852..3332480 100644
--- a/jjb/browsertests.yaml
+++ b/jjb/browsertests.yaml
@@ -160,27 +160,6 @@
         mediawiki_credentials_id: Selenium_user_monobook-at-beta.wmflabs.org
         mediawiki_url: en.wikipedia.beta.wmflabs.org
 
-
-
-# Math
-- project:
-    name: Math
-    defaults: browsertests
-    folder: tests
-    headless: 'false'
-    mediawiki_credentials_id: Selenium_user-at-beta.wmflabs.org
-    mediawiki_url: en.wikipedia.beta.wmflabs.org
-    platform: linux
-    recipients: *emails-qa
-    repository: mediawiki/extensions/Math
-
-    jobs:
-     - 'browsertests-{name}-{mediawiki_url}-{platform}-{browser}-sauce':
-        browser: chrome
-
-     - 'browsertests-{name}-{mediawiki_url}-{platform}-{browser}-sauce':
-        browser: firefox
-
 # QuickSurveys
 - project:
     name: QuickSurveys
diff --git a/jjb/job-templates-selenium.yaml b/jjb/job-templates-selenium.yaml
new file mode 100644
index 0000000..1e23e71
--- /dev/null
+++ b/jjb/job-templates-selenium.yaml
@@ -0,0 +1,125 @@
+# default
+
+- job-template:
+    name: 'selenium-{name}'
+    defaults: selenium
+
+- job-template:
+    name: 'selenium-{name}-matrix'
+    defaults: browsertests
+    project-type: matrix
+    parameters:
+     - string:
+        name: MEDIAWIKI_API_UPLOAD_URL
+        default: https://commons.wikimedia.org/w/api.php
+        description: "Upload API URL for uploading screenshots"
+     - string:
+        name: lang_list
+        default: "af ar ast br bs ce cs de el en es et fa fi fr gl he hi hr 
hsb hu hy id ilo it ja ka kn ko krc lb mk ms nb nl om pl ps pt ro ru sco sl sr 
sv tr uk vi yue zh-hans zh-hant"
+        description: "Languages (space separated)"
+    execution-strategy:
+      sequential: true
+    axes:
+     - axis:
+        type: label-expression
+        name: label
+        values:
+         - contintLabsSlave && UbuntuTrusty
+     - axis:
+        type: dynamic
+        name: LANGUAGE_SCREENSHOT_CODE
+        values:
+         - lang_list
+
+    triggers:
+      - timed: "@yearly" # This job should be executed only manually. Setting 
it to trigger yearly is a workaround.
+
+- defaults:
+    name: selenium
+    node: contintLabsSlave && UbuntuTrusty
+    browsertest_job_timeout: 180
+    repository_host: 'gerrit.wikimedia.org/r'
+
+    logrotate:
+        daysToKeep: 31  # ~ 2 * 2 weeks sprints
+
+    scm:
+      - git:
+          url: https://{repository_host}/{repository}
+          branches:
+            - master
+          wipe-workspace: false  # keep the workspace...
+          clean:
+              after: true        # ... and use git clean instead
+          prune: true            # prune remote obsoletes branches
+          submodule:
+              recursive: true
+
+    triggers:
+      - timed: "@daily"
+
+    builders:
+      - shell: mkdir -p "$WORKSPACE/log/junit"
+      - selenium-builder
+
+    publishers:
+      - junit:
+          results: 'log/junit/*.xml'
+
+      - email-ext:
+          recipients: '{recipients}'
+          body: '${{SCRIPT, template="wikimedia.template"}}'
+
+      - browsertests-irc
+
+      - claim-build
+
+      - performance:
+          failed-threshold: -1
+          unstable-threshold: -1
+          report:
+           - junit: log/junit/*.xml
+
+      - archive:
+          artifacts: 'log/*.log, log/junit/*.xml, log/report.html, log/*.png'
+
+      - postbuildscript:
+          builders:
+           - shell: |
+               set +e
+               set +x
+               echo "Removing potential png screenshots under /log/"
+               rm -v -f log/*.png || :
+               echo "Done"
+          # Postbuild options are confusing, setting both to false ensures the 
script always runs.
+          onsuccess: False
+          onfailure: False
+
+    wrappers:
+      - ansicolor
+      - timeout:
+          timeout: '{browsertest_job_timeout}'
+      - timestamps
+      # Wiki usernames and passwords are hold in Jenkins credentials store
+      # 
https://integration.wikimedia.org/ci/credential-store/domain/browsertests/
+      - credentials-binding:
+          - username-password:
+              credential-id: '{mediawiki_credentials_id}'
+              # FIXME JJB does not support splitted user/pass variables 
although the plugin does.
+              # 
http://ci.openstack.org/jenkins-job-builder/wrappers.html#wrappers.credentials-binding
+              # Pass both in a single variable, separated by ':'
+              variable: MEDIAWIKI_CREDENTIALS
+          # For GettingStarted T91220
+          - text:
+              credential-id: 'mediawiki_captcha_password'
+              # Feeds into registration_page.rb in GettingStarted; allows
+              # account creation during browser test
+              variable: MEDIAWIKI_CAPTCHA_BYPASS_PASSWORD
+          # For browsertests-Wikidata* jobs, T89343
+          - text:
+              credential-id: wikibase_repo_password
+              variable: WB_REPO_PASSWORD
+          # For all browsertests*sauce jobs, T89342
+          - text:
+              credential-id: sauce_ondemand_access_key
+              variable: SAUCE_ONDEMAND_ACCESS_KEY
diff --git a/jjb/macro-selenium.yaml b/jjb/macro-selenium.yaml
new file mode 100644
index 0000000..36c2f13
--- /dev/null
+++ b/jjb/macro-selenium.yaml
@@ -0,0 +1,18 @@
+- builder:
+    name: selenium-builder
+    builders:
+      - shell: |
+          # T128190
+          git fetch https://gerrit.wikimedia.org/r/mediawiki/extensions/Math 
refs/changes/09/273909/7 && git checkout FETCH_HEAD
+          # T128190
+          # install dependencies
+          export GEM_HOME="$HOME/.gem/2.0.0"
+          mkdir -p vendor
+          gem2.0 install --env-shebang -i vendor bundler --no-ri --no-rdoc
+          export GEM_PATH="`pwd`/vendor"
+          "$WORKSPACE"/vendor/bin/bundle install --verbose
+          
+          # run the tests
+          export SAUCE_ONDEMAND_USERNAME=wikimedia-jenkins
+          export MEDIAWIKI_ENVIRONMENT=$jenkins
+          "$WORKSPACE"/vendor/bin/bundle exec rake selenium
diff --git a/jjb/selenium.yaml b/jjb/selenium.yaml
new file mode 100644
index 0000000..e9548ed
--- /dev/null
+++ b/jjb/selenium.yaml
@@ -0,0 +1,17 @@
+# YAML structure to define email recipients aliases
+- notification-emails:
+    name: selenium-emails # a 'name' is required by JJB.
+    lists:
+     - qa: &emails-qa
+        qa-ale...@lists.wikimedia.org
+
+# Math
+- project:
+    name: Math
+    defaults: selenium
+    mediawiki_credentials_id: Selenium_user-at-beta.wmflabs.org
+    recipients: *emails-qa
+    repository: mediawiki/extensions/Math
+
+    jobs:
+     - 'selenium-{name}'

-- 
To view, visit https://gerrit.wikimedia.org/r/274136
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ccfccbe627ba80a1cf87eafc481b4c8d4d80b46
Gerrit-PatchSet: 1
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Zfilipin <zfili...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to