This repository has been archived by the owner on Aug 14, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also added signal handler, support for getting latest build, switched builds.py from using urllib2 to faster ftplib.
- Loading branch information
Mark Côté
committed
Jul 19, 2012
1 parent
c66279b
commit eee9724
Showing
9 changed files
with
377 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
# You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import datetime | ||
import logging | ||
import shutil | ||
import tempfile | ||
import unittest | ||
|
||
import builds | ||
|
||
class BuildsTest(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.cache_dir = tempfile.mkdtemp() | ||
|
||
def tearDown(self): | ||
shutil.rmtree(self.cache_dir) | ||
|
||
def test_find_builds(self): | ||
"""Basic test just to ensure that we can find any builds at all, with | ||
no errors.""" | ||
bc = builds.BuildCache(self.cache_dir) | ||
now = datetime.datetime.now() | ||
yesterday = now - datetime.timedelta(days=2) | ||
buildlist = bc.find_builds(yesterday, now, 'nightly') | ||
for l in buildlist: | ||
logging.info(l) | ||
self.assertTrue(buildlist) | ||
buildlist = bc.find_builds(yesterday, now, 'tinderbox') | ||
for l in buildlist: | ||
logging.info(l) | ||
self.assertTrue(buildlist) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
[phoneworker.py] | ||
[buildcache.py] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
# Simple smoketest. Launches autophone with a fresh cache file and waits | ||
# until the user restarts a connected phone. It then runs a simple test | ||
# that just verifies that fennec can be installed and launched, and reports | ||
# the result. | ||
|
||
cleanup() { | ||
if [ $cache ] && [ -a $cache ] | ||
then | ||
rm $cache | ||
fi | ||
kill %1 | ||
sleep 1 | ||
exit | ||
} | ||
|
||
trap cleanup INT TERM EXIT | ||
cache=`mktemp` | ||
rm -f smoketest_pass smoketest_fail | ||
echo Launching autophone... | ||
python autophone.py --cache $cache -t tests/smoketest_manifest.ini & | ||
sleep 1 | ||
echo Please restart the agent/phone for smoke test... | ||
i=0 | ||
while [ $i -le 60 ] | ||
do | ||
if [ -s $cache ] | ||
then | ||
break | ||
fi | ||
sleep 5 | ||
done | ||
|
||
if [ -s $cache ] | ||
then | ||
echo Detected phone. Proceeding with test... | ||
else | ||
echo Failed to detect phone. | ||
exit 1 | ||
fi | ||
|
||
echo Triggering run... | ||
python trigger_runs.py latest | ||
echo Waiting for result... | ||
i=0 | ||
while [ $i -le 60 ] | ||
do | ||
i=$(($i+1)) | ||
if [ -a smoketest_pass ] | ||
then | ||
echo 'Smoke test passed!' | ||
break | ||
fi | ||
if [ -a smoketest_fail ] | ||
then | ||
echo 'Smoke test failed!' | ||
break | ||
fi | ||
sleep 5 | ||
done |
Oops, something went wrong.