Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F16956138
mwext-mw-selenium-node-composer-jessie
zeljkofilipin (Željko Filipin)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
zeljkofilipin
Apr 13 2018, 6:26 PM
2018-04-13 18:26:54 (UTC+0)
Size
15 KB
Referenced Files
None
Subscribers
None
mwext-mw-selenium-node-composer-jessie
View Options
<?xml version="1.0" encoding="utf-8"?>
<project>
<actions/>
<description><p>Job is managed by <a href="https://www.mediawiki.org/wiki/CI/JJB">Jenkins Job Builder</a>.</p>
<!-- Managed by Jenkins Job Builder --></description>
<keepDependencies>false</keepDependencies>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<concurrentBuild>true</concurrentBuild>
<assignedNode>ci-jessie-wikimedia</assignedNode>
<canRoam>false</canRoam>
<properties>
<jenkins.model.BuildDiscarderProperty>
<strategy class="hudson.tasks.LogRotator">
<daysToKeep>15</daysToKeep>
<numToKeep>-1</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</strategy>
</jenkins.model.BuildDiscarderProperty>
<hudson.model.ParametersDefinitionProperty>
<parameterDefinitions>
<hudson.model.StringParameterDefinition>
<name>ZUUL_UUID</name>
<description>Zuul provided key to link builds with Gerrit events</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>UUID</name>
<description>Zuul provided key to link builds with Gerrit events (deprecated use ZUUL_UUID instead)</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_PIPELINE</name>
<description>Zuul pipeline triggering this job</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_URL</name>
<description>URL of Zuul's git repos accessible to workers</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_PROJECT</name>
<description>Branch name of triggering project</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_BRANCH</name>
<description>Branch name of triggering change</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_CHANGES</name>
<description>List of dependent changes to merge</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_REF</name>
<description>Reference for the merged commit(s) to use</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_COMMIT</name>
<description>The commit SHA1 at the head of ZUUL_REF</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_CHANGE_IDS</name>
<description>List of included changes</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_CHANGE</name>
<description>ID of triggering change</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_PATCHSET</name>
<description>Patchset of triggering change</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
<hudson.model.StringParameterDefinition>
<name>ZUUL_VOTING</name>
<description>Zuul considered this job voting or not</description>
<defaultValue/>
</hudson.model.StringParameterDefinition>
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<scm class="hudson.scm.NullSCM"/>
<builders>
<hudson.tasks.Shell>
<command>set -eu +x
# castor-env
# Forge castor environement
# Replace slashes with dashes:
NS_PROJECT=${ZUUL_PROJECT////-}
NS_BRANCH=${ZUUL_BRANCH////-}
# Pill up MediaWiki extensions and skins caches together
if [[ "$ZUUL_PROJECT" =~ ^mediawiki/(extensions|skins)/ ]]; then
NS_PROJECT="castor-mw-ext-and-skins"
fi
# Ex: mediawiki-core/REL1_26/tox-jessie
# Prefer TRIGGERED_JOB_NAME when it is set
NS_JOB=${TRIGGERED_JOB_NAME:-$JOB_NAME}
# Ex: mediawiki-core/REL1_26/tox-jessie
CASTOR_NAMESPACE="${NS_PROJECT}/${NS_BRANCH}/${NS_JOB}"
export CASTOR_NAMESPACE
echo "Defined: CASTOR_NAMESPACE=\"$CASTOR_NAMESPACE\""
# castor-load
# Load cache from central repository
set -u
[[ $JOB_NAME == *'docker'* ]] && is_docker=1 || is_docker=''
if [ $is_docker ]; then
# For containers we mount $WORKSPACE/cache from the host to /cache in the
# container. It is also the value of XDG_CACHE_HOME
DEST="/cache"
# cache might persist between builds on the Docker slaves
rsync_delete='--delete-delay'
else
DEST="$HOME"
# On Nodepool it is guaranteed to be empty. Deleting would wipe
# /home/jenkins/workspace!
fi
echo "Syncing..."
rsync \
--archive \
${rsync_delete:-} \
--compress \
--contimeout 3 \
rsync://castor02.integration.eqiad.wmflabs:/caches/"$CASTOR_NAMESPACE"/ "$DEST" \
|| :
echo -e "\nDone"
</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>echo $ZUUL_PROJECT > deps.txt</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>echo -e $EXT_DEPENDENCIES >> deps.txt</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>echo -e $SKIN_DEPENDENCIES > deps_skins.txt</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>zuul-cloner --version
zuul-cloner \
--color \
--verbose \
--map /srv/deployment/integration/slave-scripts/etc/zuul-clonemap.yaml \
--workspace src \
--cache-dir /srv/git \
https://gerrit.wikimedia.org/r/p \
mediawiki/core $(cat deps.txt) $(cat deps_skins.txt)
</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>find src/extensions src/skins -maxdepth 2 \
-name .gitmodules \
-execdir bash -xe -c '
git submodule foreach git clean -xdff -q
git submodule update --init --recursive
git submodule status
' \;
</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>mv deps.txt src/extensions_load.txt</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>set -u
cd "src"
[[ -f "composer.json" ]] || exit 0
composer --ansi validate --no-check-publish
</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>set -u
cd src
/srv/deployment/integration/slave-scripts/bin/mw-create-composer-local.py "extensions_load.txt" composer.local.json
</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>set -ux
cd "src"
[[ -f "composer.json" ]] || exit 0
export HTTP_PROXY_REQUEST_FULLURI=false
export HTTPS_PROXY_REQUEST_FULLURI=false
composer update --ansi --no-progress --prefer-dist --profile -v
</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>/srv/deployment/integration/slave-scripts/bin/mw-install-mysql.sh</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>/srv/deployment/integration/slave-scripts/bin/mw-apply-settings.sh</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>/srv/deployment/integration/slave-scripts/bin/mw-run-update-script.sh</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command># Load context (e.g. MW_INSTALL_PATH, MW_SERVER, MW_SCRIPT_PATH)
. /srv/deployment/integration/slave-scripts/bin/mw-set-env-localhost.sh
# Configure MediaWiki
echo -e \
"<?php\n\$wgServer = '${MW_SERVER}';\n"\
"\$wgScriptPath = '${MW_SCRIPT_PATH}';\n"\
"\$wgScript = \$wgStylePath = \$wgLogo = false;\n"\
"\$wgResourceBasePath = null;\n"\
"\$wgEnableJavaScriptTest = true;\n?>\n" >> "$MW_INSTALL_PATH/LocalSettings.php"
# The location is free or we make it free
PUBLIC_DIR="/srv/localhost-worker/$BUILD_TAG"
test ! -e "$PUBLIC_DIR" || rm "$PUBLIC_DIR";
# Publish our install in the QUnit server document root
ln -s "$MW_INSTALL_PATH" "$PUBLIC_DIR"
# Fetch headers and content preview for debugging (HTTP 500 Error, Database error, ResourceLoader etc.)
# NB: Avoid "curl: Failed writing body" error when using 'head'. Either by using 'tac|tac', or by ignoring stderr,
# or by writing to a file first and running 'head' on that.
curl --include "${MW_SERVER}${MW_SCRIPT_PATH}/index.php/Special:BlankPage" > log/curl-SpecialBlankPage.log; head -n42 log/curl-SpecialBlankPage.log
curl --include "${MW_SERVER}${MW_SCRIPT_PATH}/load.php?debug=true&modules=startup&only=scripts" > log/curl-load-startup.log; head -n42 log/curl-load-startup.log
curl --include "${MW_SERVER}${MW_SCRIPT_PATH}/index.php?title=Special:JavaScriptTest/qunit/export" > log/curl-SpecialJavaScriptTest.log; head -n11 log/curl-SpecialJavaScriptTest.log
</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>. /srv/deployment/integration/slave-scripts/bin/mw-set-env-localhost.sh
cd $MW_INSTALL_PATH
. /srv/deployment/integration/slave-scripts/bin/npm-setup.sh
rm -rf node_modules
npm install
</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command># Change to the working directory. EXT_NAME is set by Zuul parameters
# functions
if [ -f ./src/extensions/$EXT_NAME/tests/selenium/LocalSettings.php ]; then
cd ./src/extensions/$EXT_NAME/tests/selenium
. '/srv/deployment/integration/slave-scripts/bin/mw-selenium-setup.sh'
fi
</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>. /srv/deployment/integration/slave-scripts/bin/mw-set-env-localhost.sh
cd $MW_INSTALL_PATH
if [ -f ./tests/selenium/wdio.conf.js ]; then
chromedriver --url-base=/wd/hub --port=4444 &
# Make sure it is killed to prevent file descriptors leak
function kill_chromedriver() {
killall chromedriver > /dev/null
}
trap kill_chromedriver EXIT
./node_modules/.bin/grunt webdriver:test
fi
</command>
</hudson.tasks.Shell>
<hudson.tasks.Shell>
<command>set -eu
# The set of log files checked come from integration/jenkins
# mediawiki/conf.d/00_set_debug_log.php
#
# Namely:
# $wgDBerrorLog = "$wmgMwLogDir/mw-dberror.log";
# $wgDebugLogGroups['exception'] = "$wmgMwLogDir/mw-exception.log";
# $wgDebugLogGroups['error'] = "$wmgMwLogDir/mw-error.log";
#
ERROR_FILES=( mw-dberror.log mw-exception.log mw-error.log )
echo "Asserting empty files: ${ERROR_FILES[*]}"
# The minimum RELx_xxx version for which we want to run this test
REL_MAJOR=1
REL_MINOR=30
# The minimum wmf/1.x.0-wmf.xx version for which we want to run this test
WMF_MAJOR=30
WMF_MINOR=12
# A valid version is a version > wmf/1.WMF_MAJOR.0-wmf.WMF_MINOR
valid_wmf_version() {
local version major minor
version="$1"
major=${version%.*.*}
major=${major##*.}
minor=${version##*.}
if (( major == WMF_MAJOR )) && (( minor >= WMF_MINOR )); then
return 0
elif (( major > WMF_MAJOR )); then
return 0
else
return 1
fi
}
# A valid version is a version > REL{REL_MAJOR}_{REL_MINOR}
valid_rel_version() {
local version major minor
version="$1"
major=${version%%_*}
minor=${version##*_}
if (( major == REL_MAJOR )) && (( minor >= REL_MINOR )); then
return 0
elif (( major > REL_MAJOR )); then
return 0
else
return 1
fi
}
# Ensures that this is a ZUUL_BRANCH for which we want this to be a valid test
valid_version() {
local version wmf_version rel_version
version="$1"
# Master is valid
if [[ "$version" == "master" ]]; then
return 0
fi
# Is this is a wmf/something
wmf_version="${version#wmf\/}"
if (( ${#version} != ${#wmf_version} )); then
valid_wmf_version "$wmf_version" && return 0
fi
# Is this is a RELsomething
rel_version="${version#REL}"
if (( ${#version} != ${#rel_version} )); then
valid_rel_version "$rel_version" && return 0
fi
# Unidentified version: invalid
return 1
}
if ! valid_version "$ZUUL_BRANCH"; then
printf 'Test not for branch: %s\n' "$ZUUL_BRANCH"
exit 0
fi
log_files="$( cd "$WORKSPACE/log"; ls "${ERROR_FILES[@]}" 2> /dev/null || :)"
if [ ! "$log_files" ]; then
echo "No error files. GOOD"
exit 0
fi
echo "Dumping file(s) $log_files"
set +e
# Use `grep --color . file list` to ensure that file names appear next
# to log messages
(cd "$WORKSPACE/log"; grep --color . "${ERROR_FILES[@]}" 2> /dev/null)
set -e
echo -e "MediaWiki emitted some errors. Check output above."
exit 1
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<org.jenkinsci.plugins.postbuildscript.PostBuildScript>
<buildSteps>
<hudson.plugins.parameterizedtrigger.TriggerBuilder>
<configs>
<hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
<configs>
<hudson.plugins.parameterizedtrigger.CurrentBuildParameters/>
<hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
<properties>TRIGGERED_JOB_NAME=$JOB_NAME
TRIGGERED_SSH_CONNECTION=$SSH_CONNECTION
</properties>
</hudson.plugins.parameterizedtrigger.PredefinedBuildParameters>
</configs>
<projects>castor-save</projects>
<condition>ALWAYS</condition>
<triggerWithNoParameters>false</triggerWithNoParameters>
<buildAllNodesWithLabel>false</buildAllNodesWithLabel>
<block/>
</hudson.plugins.parameterizedtrigger.BlockableBuildTriggerConfig>
</configs>
</hudson.plugins.parameterizedtrigger.TriggerBuilder>
</buildSteps>
<scriptOnlyIfSuccess>true</scriptOnlyIfSuccess>
<scriptOnlyIfFailure>false</scriptOnlyIfFailure>
<markBuildUnstable>false</markBuildUnstable>
</org.jenkinsci.plugins.postbuildscript.PostBuildScript>
<hudson.tasks.ArtifactArchiver>
<artifacts>log/*</artifacts>
<latestOnly>false</latestOnly>
<defaultExcludes>true</defaultExcludes>
</hudson.tasks.ArtifactArchiver>
</publishers>
<buildWrappers>
<hudson.plugins.build__timeout.BuildTimeoutWrapper>
<timeoutMinutes>30</timeoutMinutes>
<failBuild>true</failBuild>
<writingDescription>false</writingDescription>
<timeoutPercentage>0</timeoutPercentage>
<timeoutMinutesElasticDefault>3</timeoutMinutesElasticDefault>
<timeoutType>absolute</timeoutType>
</hudson.plugins.build__timeout.BuildTimeoutWrapper>
<hudson.plugins.timestamper.TimestamperBuildWrapper/>
<hudson.plugins.ansicolor.AnsiColorBuildWrapper/>
</buildWrappers>
</project>
File Metadata
Details
Attached
Mime Type
application/xml
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5732082
Default Alt Text
mwext-mw-selenium-node-composer-jessie (15 KB)
Attached To
Mode
T191537: MediaWiki core's selenium tests flaky when run as part of mwext-mw-selenium-node-composer-jessie job
Attached
Detach File
Event Timeline
Log In to Comment