jenkins-bot has submitted this change and it was merged.

Change subject: Support MediaWiki PHP tests under HHVM
......................................................................


Support MediaWiki PHP tests under HHVM

Experimental replacement of mediawiki-phpunit with two new jobs:

    mediawiki-phpunit-hhvm  (hhvm from Trusty)
    mediawiki-phpunit-zend  (PHP 5.3 from Precise)

Same for all extensions!

Depend on puppet change https://gerrit.wikimedia.org/r/178806/ to setup
hhvm on the CI slave with a reasonable configuration (already applied on
the contint slaves).

Add an assertion macro to make sure we use the proper PHP flavor. Pass
it either 'hhvm' or 'zend' and it will parse 'php --version', aborting
on mismatch.

Add a macro to delete '*.hhbc' files. They are bytecodes compiler cache
files generated by hhvm.  Set via the HHVM_REPO_CENTRAL_PATH env
variable.

Convert the 'mediawiki-phpunit' job template to vary by a new variable
'phpflavor'. The variable is used to select a proper node using a crazy
label expression. CI slaves labels have been adjusted already with
either 'phpflavor-hhvm' or 'phpflavor-zend'.

Convert the testextension jobs as well.

Do not run the hhvm MediaWiki jobs on REL1_23 and REL1_24.

Add the new jobs to the experimental pipeline of mediawiki/core so
people can manually trigger them from Gerrit by commenting:
'check experimental'.

Keep the old jobs around since they are still triggered by the test and
gate-and-submit pipelines.

Do not run the mediawiki hhvm job on REL1_23/REL1_24 branch, leaving it
open for the future REL1_25 branch though.

TODO:
* migrate the qunit jobs
* Fix hhvm test ApiFormatWddx (T75531). That is a bug upstrem which
  would be fixed with a new hhvm version scheduled to be deployed next
  week (-wm6).

Bug: T75521
Change-Id: I924a42d2001edafa5ab00623b342afd87cfa5334
---
M jjb/macro.yaml
M jjb/mediawiki-extensions.yaml
M jjb/mediawiki.yaml
M zuul/layout.yaml
4 files changed, 129 insertions(+), 2 deletions(-)

Approvals:
  Hashar: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/jjb/macro.yaml b/jjb/macro.yaml
index 2a12bbc..48241b1 100644
--- a/jjb/macro.yaml
+++ b/jjb/macro.yaml
@@ -225,6 +225,45 @@
              exit 1
          fi
 
+# Assert 'php' is phpflavor
+#
+# Parameter:
+# * phpflavor: 'hhvm' or 'zend'
+#
+- builder:
+    name: assert-phpflavor
+    builders:
+        - shell: |
+            #!/bin/bash -e -u
+            PHP_VERSION=`php --version`
+
+            case "{phpflavor}" in
+                ( 'hhvm' )
+                    MATCHER='^HipHop'
+                ;;
+                ( 'zend' )
+                    MATCHER='^Zend Engine'
+                ;;
+                ( * )
+                    echo "Invalid phpflavor '{phpflavor}' for JJB macro 
'assert-phpflavor'"
+                    echo "Must be either 'hhvm' or 'zend'"
+                    exit 1
+                ;;
+            esac
+
+            if ( echo "$PHP_VERSION" | egrep "$MATCHER" > /dev/null ); then
+                echo -e "php is {phpflavor}:\n\n$PHP_VERSION\n"
+            else
+                echo -e "Assertion error: php is not 
{phpflavor}:\n\n$PHP_VERSION\n"
+                exit 1
+            fi
+
+- builder:
+    name: 'hhvm-clear-hhbc'
+    builders:
+        - shell: |
+            rm -f *.hhbc
+
 # Assert node version matches a basic regular expressions
 #
 # Parameter:
diff --git a/jjb/mediawiki-extensions.yaml b/jjb/mediawiki-extensions.yaml
index 2b84b24..21950dc 100644
--- a/jjb/mediawiki-extensions.yaml
+++ b/jjb/mediawiki-extensions.yaml
@@ -180,6 +180,9 @@
 
 
 # Run extension tests via Zuul cloner
+#
+# Triggered for test/gate-and-submit pipeline. Will be replaced by HHVM/Zend
+# jobs as defined by the template 
'{name}-{ext-name}-testextension-{phpflavor}'.
 - job-template:
     name: '{name}-{ext-name}-testextension'
     node: hasSlaveScripts && UbuntuPrecise
@@ -201,6 +204,35 @@
         results: 'log/junit*.xml'
      - mw-teardown
 
+
+# Run extension tests via Zuul cloner
+#
+# On the experimental pipeline, use hhvm and zend. Will eventually replace the
+# '{name}-{ext-name}-testextension' job template defined above.
+- job-template:
+    name: '{name}-{ext-name}-testextension-{phpflavor}'
+    # See mediawiki.yaml mediawiki-phpunit-{phpflavor}
+    node: '(productionSlaves && UbuntuPrecise && phpflavor-zend && 
phpflavor-{phpflavor}) || (contintLabsSlave && UbuntuTrusty && phpflavor-hhvm 
&& phpflavor-{phpflavor})'
+    concurrent: true
+    properties:
+     - throttle-one-per-node
+    triggers:
+     - zuul
+    builders:
+     - assert-phpflavor:
+         phpflavor: '{phpflavor}'
+     - hhvm-clear-hhbc
+     - prepare-mediawiki:
+         ext-name: '{ext-name}'
+         dependencies: '{dependencies}'
+     - mw-run-phpunit-allexts
+    # TODO, find ways to additionaly run tests for core but
+    # without extensions tests
+    publishers:
+     - archive-log-dir
+     - junit:
+        results: 'log/junit*.xml'
+     - mw-teardown
 
 - job-template:
     name: 'mwext-GuidedTour-doc-test'
@@ -320,6 +352,10 @@
      - '{name}-{ext-name}-lint'
      - '{name}-{ext-name}-jslint'
      - '{name}-{ext-name}-testextension'
+     - '{name}-{ext-name}-testextension-{phpflavor}':
+         phpflavor:
+             - hhvm
+             - zend
      - '{name}-{ext-name}-phpcs-HEAD'
 
 - project:
diff --git a/jjb/mediawiki.yaml b/jjb/mediawiki.yaml
index d8b7fb2..1ab6548 100644
--- a/jjb/mediawiki.yaml
+++ b/jjb/mediawiki.yaml
@@ -137,6 +137,8 @@
          #!/bin/bash -e
          echo "Noop job, meant to gate jobs properly"
 
+# Triggered for test/gate-and-submit pipeline. Will be replaced by HHVM/Zend
+# jobs as defined by the template 'mediawiki-phpunit-{phpflavor}'.
 - job-template:
     name: 'mediawiki-phpunit'
     node: productionSlaves  # not on labs for now
@@ -156,9 +158,47 @@
      - archive-log-dir
      - mw-teardown
 
+# On the experimental pipeline, use hhvm and zend. Will eventually replace the
+# 'mediawiki-phpunit' job template defined above.
+- job-template:
+    name: 'mediawiki-phpunit-{phpflavor}'
+    # Select runnable node based on the phpflavor (hhvm or zend)
+    #
+    # We want to reuse the same job template for both PHP flavor:
+    # - HHVM flavor runs on Trusty CI labs slaves which have HHVM
+    # - Zend flavor runs on productionSlaves with Precise which ships Zend PHP 
5.3
+    #
+    # Doing a '&& phpflavor-{phpflavor}' is the trick to vary the label
+    # definition based on the job name.
+    #
+    # If you want to verify the slaves, head to the job configuration page,
+    # search for 'Restrict where this project can be run', below the input box
+    # is a text: Slaves in [label]: X . Clicking [label] will list nodes
+    # matching the expression.
+    node: '(productionSlaves && UbuntuPrecise && phpflavor-zend && 
phpflavor-{phpflavor}) || (contintLabsSlave && UbuntuTrusty && phpflavor-hhvm 
&& phpflavor-{phpflavor})'
+    concurrent: true
+    triggers:
+     - zuul
+    builders:
+     - assert-phpflavor:
+         phpflavor: '{phpflavor}'
+     - hhvm-clear-hhbc
+     - zuul-cloner:
+         projects: >
+             mediawiki/core
+             mediawiki/vendor
+     - mw-install-sqlite
+     - mw-apply-settings
+     - shell: "/srv/deployment/integration/slave-scripts/bin/mw-run-phpunit.sh"
+    publishers:
+     - phpunit-junit-2
+     - archive-log-dir
+     - mw-teardown
+
 # Test out our PHPUnit against various MediaWiki branches
 #
-# Essentially a copy paste of mediawiki-phpunit
+# Essentially a copy paste of mediawiki-phpunit-{phpflavor}
+# FIXME: support HHVM
 - job-template:
     name: 'integration-phpunit-mediawiki-{mwbranch}'
     node: productionSlaves  # not on labs for now
@@ -263,6 +303,9 @@
 
 - project:
     name: mediawiki-core
+    phpflavor:
+        - hhvm
+        - zend
     jobs:
       - '{name}-phplint'
       - mediawiki-gate
@@ -273,7 +316,7 @@
          bundlecommand:
           - rubocop
       - '{name}-ruby1.9.3lint'
-      - mediawiki-phpunit
+      - 'mediawiki-phpunit-{phpflavor}'
 
 # For regression testing:
 
diff --git a/zuul/layout.yaml b/zuul/layout.yaml
index 376ece3..02299f5 100644
--- a/zuul/layout.yaml
+++ b/zuul/layout.yaml
@@ -379,6 +379,10 @@
     files:
      - '^.*\.(php|php5|phtml|inc)$'
 
+  - name: ^(mwext|mediawiki).*-hhvm$
+    # Release branches do not support hhvm. Hopefully REL1_25 will.
+    branch: (?!REL1_23|REL1_24)
+
   - name: mwext-MobileFrontend-phpcs-HEAD
     voting: true
   - name: mwext-TemplateData-phpcs-HEAD
@@ -1742,6 +1746,7 @@
      - php-composer-validate
     experimental:
       - mediawiki-core-extensions-integration
+      - 'mwext-{name}-testextension-hhvm'
 
   # Template for MediaWiki extensions.
   # Triggers qunit jobs
@@ -1929,6 +1934,8 @@
     experimental:
       - mediawiki-core-extensions-integration
       - mediawiki-language-extension-bundle-integration
+      - mediawiki-phpunit-hhvm
+      - mediawiki-phpunit-zend
     postmerge:
       - mediawiki-core-jsduck-publish
       - mediawiki-core-regression-master
@@ -3211,6 +3218,7 @@
      - php-composer-validate
     experimental:
       - mediawiki-core-extensions-integration
+      - mwext-Flow-testextension-hhvm
 
   - name: mediawiki/extensions/FormPreloadPostCache
     template:
@@ -3473,6 +3481,7 @@
       - php-composer-validate
     experimental:
       - mediawiki-core-extensions-integration
+      - mwext-MobileFrontend-testextension-hhvm
 
   - name: mediawiki/extensions/MobileApp
     template:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I924a42d2001edafa5ab00623b342afd87cfa5334
Gerrit-PatchSet: 7
Gerrit-Project: integration/config
Gerrit-Branch: master
Gerrit-Owner: Hashar <has...@free.fr>
Gerrit-Reviewer: 20after4 <mmod...@wikimedia.org>
Gerrit-Reviewer: Hashar <has...@free.fr>
Gerrit-Reviewer: Krinkle <krinklem...@gmail.com>
Gerrit-Reviewer: Zfilipin <zfili...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to