Merge lp:~brian.curtin/ubuntuone-dev-tools/jenkins-skipping into lp:ubuntuone-dev-tools

Proposed by Brian Curtin on 2012-05-07
Status: Merged
Approved by: Brian Curtin on 2012-05-14
Approved revision: 72
Merged at revision: 71
Proposed branch: lp:~brian.curtin/ubuntuone-dev-tools/jenkins-skipping
Merge into: lp:ubuntuone-dev-tools
Diff against target: 67 lines (+20/-3)
2 files modified
ubuntuone/devtools/testcases/__init__.py (+9/-0)
ubuntuone/devtools/tests/test_decorators.py (+11/-3)
To merge this branch: bzr merge lp:~brian.curtin/ubuntuone-dev-tools/jenkins-skipping
Reviewer Review Type Date Requested Status
Manuel de la Peña (community) Approve on 2012-05-11
Roberto Alsina (community) 2012-05-07 Approve on 2012-05-07
Review via email: mp+104950@code.launchpad.net

Commit Message

- Add a skip decorator to check if we are running on Jenkins

Description of the Change

Add skipping for Jenkins, mostly for a few Windows tests we need to skip while running on the Jenkins machine.

To post a comment you must log in.
Roberto Alsina (ralsina) :
review: Approve
review: Approve
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (22.6 KiB)

The attempt to merge lp:~brian.curtin/ubuntuone-dev-tools/jenkins-skipping into lp:ubuntuone-dev-tools failed. Below is the output from the failed tests.

ubuntuone.devtools.testing.tests.test_txwebserver
  MultipleWebServersTestCase
    test_multiple_requests ... [OK]
    test_single_request ... [OK]
twisted.trial.unittest
  TestCase
    runTest ... [OK]
ubuntuone.devtools.testing.tests.test_txwebserver
  WebServerTestCase
    test_get_iri ... [OK]
    test_get_port ... [OK]
    test_multiple_requests ... [OK]
    test_single_request ... [OK]
ubuntuone.devtools.testcases
  BaseTestCase
    runTest ... [OK]
ubuntuone.devtools.services.tests.test_squid
  EnvironTestCase
    test_delete_proxy_settings_present ... [OK]
    test_retrieve_proxy_settings ... [OK]
    test_store_settings ... [OK]
  PathsTestCase
    test_get_auth_temp_path ... [OK]
    test_get_basedir_missing ... [OK]
    test_get_basedir_present ... [OK]
    test_get_spool_temp_path_missing ... [OK]
    test_get_spool_temp_path_present ... [OK]
    test_get_squid_temp_path_missing ... [OK]
    test_get_squid_temp_path_present ... [OK]
  SquidRunnerInitTestCase
    test_htpasswd_missing ... [OK]
    test_squid_missing ... [OK]
  SquidRunnerTestCase
    test_generate_auth_file ... [OK]
    test_generate_config_file ... [OK]
    test_generate_swap ... [OK]
    test_start_error ... [OK]
ubuntuone.devtools.testcases.dbus
  DBusTestCase
    runTest ... [OK]
ubuntuone.devtools.services.tests.test_dbus
  TestWithDBus
    test_config_file_path ... [OK]
    test_dbus_session_is_running ... [OK]
ubuntuone.devtools.services.tests.test_squid_linux
  SquidLinuxTestCase
    test_format_config_path ... [OK]
    test_get_auth_process ... [OK]
    test_get_auth_process_3 ... [OK]
    test_kill_squid ... [OK]
twisted.trial.unittest
  TestCa...

72. By Brian Curtin on 2012-05-14

Fix lint - added extra blank line...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ubuntuone/devtools/testcases/__init__.py'
2--- ubuntuone/devtools/testcases/__init__.py 2012-03-30 17:44:03 +0000
3+++ ubuntuone/devtools/testcases/__init__.py 2012-05-14 14:32:19 +0000
4@@ -113,6 +113,15 @@
5 return _id
6
7
8+def skipIfJenkins(current_os, reason):
9+ """Skip test for a particular os or lists of them
10+ when running on Jenkins."""
11+ if os.getenv("JENKINS", False) and (sys.platform in current_os or
12+ sys.platform == current_os):
13+ return skipTest(reason)
14+ return _id
15+
16+
17 # pylint: enable=C0103
18
19
20
21=== modified file 'ubuntuone/devtools/tests/test_decorators.py'
22--- ubuntuone/devtools/tests/test_decorators.py 2012-03-30 17:44:03 +0000
23+++ ubuntuone/devtools/tests/test_decorators.py 2012-05-14 14:32:19 +0000
24@@ -29,6 +29,7 @@
25 # version. If you delete this exception statement from all source
26 # files in the program, then also delete it here.
27 """Test the skip decorators."""
28+import os
29 import sys
30
31 from twisted.trial.runner import LoggedSuite
32@@ -48,6 +49,9 @@
33
34 def test_skip_decorators(self):
35 """Test the decorators that skip tests."""
36+ new_getenv = lambda *args: True
37+ self.patch(os, "getenv", new_getenv)
38+
39 operations_table = (
40 (testcase.skipIf,
41 (False, "False condition"),
42@@ -58,18 +62,22 @@
43 (testcase.skipIfNotOS,
44 (sys.platform, "skipIfNot this platform"),
45 (OTHER_PLATFORM[sys.platform],
46- "skipIfNot other platform")))
47+ "skipIfNot other platform")),
48+ (testcase.skipIfJenkins,
49+ (OTHER_PLATFORM[sys.platform],
50+ "skipIfJenkins other platform"),
51+ (sys.platform, "skipIfJenkins this platform")),)
52 for deco, dont_skip, do_skip in operations_table:
53
54 class Foo(BaseTestCase):
55 """Dummy test case used for the decorators testing."""
56
57- @deco(do_skip[0], do_skip[1])
58+ @deco(*do_skip)
59 def test_skip(self):
60 """Test to skip."""
61 pass
62
63- @deco(dont_skip[0], dont_skip[1])
64+ @deco(*dont_skip)
65 def test_dont_skip(self):
66 """Test not to skip."""
67 pass

Subscribers

People subscribed via source and target branches

to all changes: