Merge lp:~mvo/software-center/more-dep8-again into lp:software-center

Proposed by Michael Vogt on 2012-08-28
Status: Merged
Merged at revision: 3128
Proposed branch: lp:~mvo/software-center/more-dep8-again
Merge into: lp:software-center
Diff against target: 87 lines (+29/-6)
5 files modified
debian/tests/control (+1/-1)
debian/tests/run-tests (+13/-0)
run-tests.sh (+6/-0)
tests/test_database.py (+5/-1)
tests/test_dataprovider.py (+4/-4)
To merge this branch: bzr merge lp:~mvo/software-center/more-dep8-again
Reviewer Review Type Date Requested Status
Gary Lasker (community) 2012-08-28 Approve on 2012-08-29
Review via email: mp+121608@code.launchpad.net

Description of the Change

Jibel investigated the test failures in the ADT environment here: https://plus.google.com/107403408442467283490/posts

This branch should address them and with the proxy he setup hopefully we see the tests all work now.

To post a comment you must log in.
3131. By Michael Vogt on 2012-08-28

run-tests.sh: fail early with proper message if there is no http access available

Gary Lasker (gary-lasker) wrote :

Lets merge this and hopefully we are good to go. Thanks, mvo!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/tests/control'
2--- debian/tests/control 2012-08-15 11:48:31 +0000
3+++ debian/tests/control 2012-08-28 13:19:23 +0000
4@@ -1,4 +1,4 @@
5 Tests: run-tests
6-Depends: @, xvfb, python-coverage, python-mock, python3-aptdaemon.test, python-qt4, python-unittest2, python-lxml, pep8, pyflakes, iputils-ping, language-pack-en, gawk, update-manager, gnome-menus
7+Depends: @, xvfb, python-coverage, python-mock, python3-aptdaemon.test, python-qt4, python-unittest2, python-lxml, pep8, pyflakes, iputils-ping, language-pack-en, gawk, update-manager, gnome-menus, curl
8
9
10
11=== modified file 'debian/tests/run-tests'
12--- debian/tests/run-tests 2012-08-17 13:37:45 +0000
13+++ debian/tests/run-tests 2012-08-28 13:19:23 +0000
14@@ -1,6 +1,19 @@
15 #!/bin/sh
16 set -e
17
18+# the default user in the adt env is "ubuntu"
19+USER=ubuntu
20+
21+echo "Running as uid $(id -u)"
22+
23+# we don't like running as root in the adt environment
24+if $(id $USER >/dev/null); then
25+ if [ "$(id -u)" = "0" ]; then
26+ echo "Switching to user $USER"
27+ su -lc "cd $PWD; sh $0" $USER
28+ fi
29+fi
30+
31 if ! xvfb-run ./run-tests.sh; then
32 # show all the failures for easier analyzing
33 cat ./tests/output/*.FAIL
34
35=== modified file 'run-tests.sh'
36--- run-tests.sh 2012-08-17 13:37:45 +0000
37+++ run-tests.sh 2012-08-28 13:19:23 +0000
38@@ -39,6 +39,12 @@
39 exit 1
40 fi
41
42+# check if basic http access works
43+HTTP_URL=http://software-center.ubuntu.com
44+if ! curl -s $HTTP_URL >/dev/null; then
45+ echo "NEED curl and http access to $HTTP_URL"
46+ exit 1
47+fi
48
49 # clear coverage data
50 # coverage erase will not erase the files from --parallel-mode
51
52=== modified file 'tests/test_database.py'
53--- tests/test_database.py 2012-08-23 14:37:28 +0000
54+++ tests/test_database.py 2012-08-28 13:19:23 +0000
55@@ -224,7 +224,11 @@
56 app = Application("Ubuntu Software Center Test", "software-center")
57 details = app.get_details(db)
58 self.assertNotEqual(details, None)
59- self.assertEqual(details.component, "main")
60+ # mvo: disabled, we can reenable this once there is a static
61+ # apt rootdir and we do not rely on the test system to
62+ # have software-center from the main archive and not from
63+ # e.g. a custom repo like the ADT environment
64+ #self.assertEqual(details.component, "main")
65 self.assertEqual(details.pkgname, "software-center")
66 # get the first document
67 for doc in db:
68
69=== modified file 'tests/test_dataprovider.py'
70--- tests/test_dataprovider.py 2012-07-23 11:29:32 +0000
71+++ tests/test_dataprovider.py 2012-08-28 13:19:23 +0000
72@@ -29,11 +29,11 @@
73 self.assertTrue(len(self.provider.db) > 100)
74
75 def test_get_details(self):
76- result = self.provider.GetAppDetails("", "software-center")
77+ result = self.provider.GetAppDetails("", "gedit")
78 self.assertEqual(result["component"], "main")
79- self.assertEqual(result["icon"], "softwarecenter")
80- self.assertEqual(result["name"], "software-center")
81- self.assertEqual(result["pkgname"], "software-center")
82+ self.assertEqual(result["icon"], "accessories-text-editor")
83+ self.assertEqual(result["name"], "gedit")
84+ self.assertEqual(result["pkgname"], "gedit")
85
86
87 if __name__ == "__main__":

Subscribers

People subscribed via source and target branches