User:Armenzg:unittest script

From MozillaWiki
Jump to: navigation, search
# You will most likely change these parameters
OS='win32' # e.g. linux64
ID='1297441801'
BRANCH='mozilla-central'
# TODO $OS_ARCH should be calculated based on $OS
OS_ARCH='win32' # e.g. linux-x86_64
TYPE='' #TYPE='-debug'
LOCATION='tinderbox-builds' # e.g. 'nightly', 'tryserver-builds', 'releases'

# You most likely won't change these parameters too often
BASE='http://ftp.mozilla.org/pub/mozilla.org/firefox'
VERSION=`wget --quiet -O- http://hg.mozilla.org/${BRANCH}/raw-file/default/browser/config/version.txt` 

# Calculate following parameters based on previous values
POST_URL=${LOCATION}/${BRANCH}-${OS}${TYPE}/${ID}
# TODO if LOCATION is "nightly" then
# POST_URL=${LOCATION}/latest-${BRANCH}
URL=${BASE}/${POST_URL}
EXTENSION='zip' #TODO calculate depending on $OS
UNZIPPING_TOOL='unzip -o' #TODO linux would be 'tar -jxvf'
# symbols is specified even though I am skipping to download it
UNITTEST_PARAMS='--appname=firefox/firefox.exe --utility-path=bin --extra-profile-file=bin/plugins --symbols-path=symbols'
MOCHITEST_PARAMS='--certificate-path=certs --autorun --close-when-done --console-level=INFO'
REFTEST_PATH='reftest/tests/layout/reftests'

# Download binaries and tests
wget -N $URL/firefox-${VERSION}.en-US.${OS_ARCH}.${EXTENSION}
wget -N $URL/firefox-${VERSION}.en-US.${OS_ARCH}.tests.zip
# Unzip binaries and tests
${UNZIPPING_TOOL} firefox-${VERSION}.en-US.${OS_ARCH}.${EXTENSION}
# TODO add selective unzipping
unzip -o firefox-${VERSION}.en-US.${OS_ARCH}.tests.zip

# All known tests suites to this date
### mochitest 1 to 5 - TODO iterate
python mochitest/runtests.py ${UNITTEST_PARAMS} ${MOCHITEST_PARAMS} --total-chunks=5 --this-chunk=1 --chunk-by-dir=4

### mochitest-other (chrome, browser-chrome, a11y & ipcplugins)
python mochitest/runtests.py ${UNITTEST_PARAMS} ${MOCHITEST_PARAMS} --chrome
python mochitest/runtests.py ${UNITTEST_PARAMS} ${MOCHITEST_PARAMS} --browser-chrome
python mochitest/runtests.py ${UNITTEST_PARAMS} ${MOCHITEST_PARAMS} --a11y
python mochitest/runtests.py ${UNITTEST_PARAMS} ${MOCHITEST_PARAMS} --setpref='dom.ipc.plugins.enabled=false' --test-path='modules/plugin/test'
 
### reftests (reftest, crashtest & jsreftest)
python reftest/runreftest.py ${UNITTEST_PARAMS} ${REFTEST_PATH}/reftest.list
python reftest/runreftest.py ${UNITTEST_PARAMS} ${REFTEST_PATH}/crashtests.list
python reftest/runreftest.py ${UNITTEST_PARAMS} \
--extra-profile-file=jsreftest/tests/user.js jsreftest/tests/jstests.list
 
### xpcshell
bash -c 'if [ ! -d firefox/plugins ]; then mkdir firefox/plugins; fi && \
cp bin/xpcshell.exe firefox && cp -R bin/components/* firefox/components/ && \
cp -R bin/plugins/* firefox/plugins/ && python -u xpcshell/runxpcshelltests.py \
--symbols-path=symbols --manifest=xpcshell/tests/all-test-dirs.list firefox/xpcshell.exe'