Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-12-03 15:57:20 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-03 15:57:20 (GMT)
commit75f433cc14ab2086c5cf79b23d208809f78451be (patch)
tree99b02d5cd8f9a862fb73b42d1f59f71004264387 /commands
parentb61ccac7a65e807e89257ca3274e97a23030657c (diff)
Refactor a bit to keep devbot somewhat generic
Diffstat (limited to 'commands')
-rwxr-xr-xcommands/run17
-rwxr-xr-xcommands/test-ui16
2 files changed, 31 insertions, 2 deletions
diff --git a/commands/run b/commands/run
index bef41f2..f3a5f4a 100755
--- a/commands/run
+++ b/commands/run
@@ -1,8 +1,23 @@
#!/usr/bin/python
+import os
+import sys
+
import common
from devbot import run
+from devbot import config
common.setup()
-run.run_sugar()
+
+profile_env = os.environ.get("SUGAR_PROFILE", None)
+profile_pref = config.get_pref("PROFILE")
+
+if profile_env is not None:
+ if profile_pref is None:
+ config.set_pref("PROFILE", _get_random_id())
+ elif profile_pref == profile_env:
+ print "Cannot run two instances with the same profile."
+ sys.exit(1)
+
+run.run("sugar-runner")
diff --git a/commands/test-ui b/commands/test-ui
index 57a4d35..0570cf5 100755
--- a/commands/test-ui
+++ b/commands/test-ui
@@ -1,6 +1,7 @@
#!/usr/bin/python
import os
+import shutil
import sys
import common
@@ -9,7 +10,20 @@ from devbot import run
common.setup()
+os.environ["SUGAR_LOGGER_LEVEL"] = "debug"
+os.environ["SUGAR_PROFILE"] = "uitests"
+os.environ["GTK_MODULES"] = "gail:atk-bridge"
+
+profile_path = os.path.expanduser("~/.sugar/uitests")
+shutil.rmtree(profile_path, ignore_errors=True)
+
virtual = "SUGAR_BUILDBOT" in os.environ
test_path = os.path.join(common.tests_dir, "sugar", "shell.py")
-if not run.run_test(test_path, virtual):
+
+result = run.run_test("sugar-runner", test_path, virtual)
+
+logs_path = os.path.join(profile_path, "logs")
+run.merge_logs(logs_path, "test.log")
+
+if not result:
sys.exit(1)