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

Change subject: mw exts now have injected settings + artifacts
......................................................................


mw exts now have injected settings + artifacts

This change the testextensions jobs to rely on the mw-apply-settings.sh
shell script instead of an inline shell. A side effect is that
extensions get mediawiki/conf.d settings applied and thus wgDebugLogFile
is set. While at it, I also added the archive-log-dir publisher to
publish the debug log files.

The qunit jobs are still using an inline shell, I have:
- added a part that initialize the debug log file being used by Apache
  (that needs to be done by the jenkins-slave user)
- removed some redundant settings since qunit job also rely on
  mw-apply-settings.sh now.
- instaured the trap hack to compress log files.
The shell inline will need to be migrated to a shell script eventually.

mediawiki-core-qunit now uses mw-apply-settings after the database
installation and before running the qunit jobs.

Change-Id: I15d516d10e804ba6f27cabb94009d0aac3a16787
---
M macro.yaml
M mediawiki-extensions.yaml
M mediawiki.yaml
3 files changed, 21 insertions(+), 21 deletions(-)

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



diff --git a/macro.yaml b/macro.yaml
index cb4cb9a..26b9463 100644
--- a/macro.yaml
+++ b/macro.yaml
@@ -106,12 +106,26 @@
         TEST_ID=`echo "$ZUUL_PROJECT/$ZUUL_COMMIT" | tr '/' '-'`
         # Configure MediaWiki
         echo -e \
-         "ini_set( 'display_errors', 1 );\n"\
-         "error_reporting( -1 );\n"\
-         "\$wgServer = 'http://localhost:9412';\n"\
+         "<?php\n\$wgServer = 'http://localhost:9412';\n"\
          "\$wgScriptPath = '/${TEST_ID}';\n"\
          "\$wgScript = \$wgStylePath = \$wgLogo = false;\n"\
          "\$wgEnableJavaScriptTest = true;\n" >> $WORKSPACE/LocalSettings.php
+
+        # HACK HACK
+        # mediawiki/conf.d/00_set_debug_log.php cant initialize the
+        # mw-debug-www.log file since it lacks jenkins-slave permissions.
+        mkdir -p "$WORKSPACE"/log
+        touch "$WORKSPACE"/log/mw-debug-www.log
+        # Make it world writable
+        chmod a+w "$WORKSPACE"/log/mw-debug-www.log
+
+        # Make sure to compress MediaWiki log dir after phpunit has ran
+        function compress_log_dir() {
+            echo "Compressing logs under $LOG_DIR"
+            gzip --verbose --best "$WORKSPACE"/log/*.log || :
+        }
+        trap compress_log_dir EXIT
+
         # The location is free or we make it free
         test ! -e /srv/localhost/qunit/$TEST_ID || rm 
/srv/localhost/qunit/$TEST_ID;
         # Publish our install in the QUnit server document root
@@ -207,24 +221,7 @@
      - mw-install-sqlite
      - mw-get-extensions:
           dependencies: '{dependencies}'
-     - shell: |
-        #!/bin/bash -xe
-        # Inject in LocalSettings.php some code...
-
-        # .. MW_INSTALL_PATH points to WORKSPACE
-        # WATCHOUT: curly braces need to be escaped, JJB pass string to 
format()
-        echo "if( ! getenv( 'MW_INSTALL_PATH' ) ) {{ putenv( 
'MW_INSTALL_PATH='. getenv( 'WORKSPACE' ) ); }}" \
-        >> "$WORKSPACE/LocalSettings.php"
-
-        # XXX: be careful, need to escape $ !!!
-        #
-        echo -e "\$wgWikimediaJenkinsCI = true;\n" \
-        >> "$WORKSPACE/LocalSettings.php"
-
-        # .. automatically load installed extensions.
-        echo "require_once( '/var/lib/jenkins/tools/extensions-loader.php' );" 
\
-        >> "$WORKSPACE/LocalSettings.php"
-
+     - mw-apply-settings
      - mw-run-update-script
 
 - builder:
diff --git a/mediawiki-extensions.yaml b/mediawiki-extensions.yaml
index a4959c9..6dc6c56 100644
--- a/mediawiki-extensions.yaml
+++ b/mediawiki-extensions.yaml
@@ -43,6 +43,8 @@
         mwbranch: 'master'
         dependencies: '{dependencies}'
      - qunit
+    publishers:
+     - archive-log-dir
 
 # Run all extension tests
 - job-template:
diff --git a/mediawiki.yaml b/mediawiki.yaml
index b3a210a..6423d55 100644
--- a/mediawiki.yaml
+++ b/mediawiki.yaml
@@ -28,6 +28,7 @@
 
     builders:
      - mw-install-sqlite
+     - mw-apply-settings
      - qunit
 
 - job-template:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I15d516d10e804ba6f27cabb94009d0aac3a16787
Gerrit-PatchSet: 2
Gerrit-Project: integration/jenkins-job-builder-config
Gerrit-Branch: master
Gerrit-Owner: Hashar <[email protected]>
Gerrit-Reviewer: Hashar <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to