Merge lp:~vila/uci-engine/delete-data-store into lp:uci-engine

Proposed by Vincent Ladeuil
Status: Merged
Approved by: Vincent Ladeuil
Approved revision: 868
Merged at revision: 866
Proposed branch: lp:~vila/uci-engine/delete-data-store
Merge into: lp:uci-engine
Diff against target: 100 lines (+29/-7)
5 files modified
britney_proxy/britney/process_results.py (+2/-2)
britney_proxy/britney/tests/test_process_results.py (+3/-0)
ci-utils/ci_utils/testing/fixtures.py (+2/-1)
ci-utils/ci_utils/tests/test_fixtures.py (+10/-1)
coverage-retriever/coverageretriever/tests/__init__.py (+12/-3)
To merge this branch: bzr merge lp:~vila/uci-engine/delete-data-store
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Francis Ginther Approve
Review via email: mp+239899@code.launchpad.net

Commit message

Fix test runner swift container leak for britney

Description of the change

For britney, the test runner swift container can be deleted once it has been processed.

This will keep the swift namespace clean for britney.

This may also avoid bringing swift down when I need to clean up these containers manually ;)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:866
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1637/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1637/rebuild

review: Approve (continuous-integration)
Revision history for this message
Francis Ginther (fginther) wrote :

Approve.

review: Approve
Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :
Download full text (133.3 KiB)

The attempt to merge lp:~vila/uci-engine/delete-data-store into lp:uci-engine failed. Below is the output from the failed tests.

Running cm...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
uploading webui-content.tgz to swift
Updating source dependencies...
Checking juju status
Private PPAs: disabled
Preparing local branch upload...
Uploading local branch, fingerprint cc4da5d8efeeb211bf2d08cdb6ba34b224adcf58
Building charm: lander
Building charm: wsgi-app
Building charm: rabbitmq-worker
Building charm: chroot-builder
Building charm: key-secret-subordinate
Building charm: webui
Building charm: system-image-server
Installing keys from bzr+ssh://bazaar.launchpad.net/~ci-engineering-private/+junk/ci-airline-dev-keys/
Running juju-deployer -v -c /tmp/tmpHA6iVz/deployer/branch-source-builder.yaml -c /tmp/tmpHA6iVz/deployer/britney-proxy.yaml -c /tmp/tmpHA6iVz/deployer/coverage-retriever.yaml -c /tmp/tmpHA6iVz/deployer/gatekeeper.yaml -c /tmp/tmpHA6iVz/deployer/image-builder.yaml -c /tmp/tmpHA6iVz/deployer/lander.yaml -c /tmp/tmpHA6iVz/deployer/nf-stats-service.yaml -c /tmp/tmpHA6iVz/deployer/ppa-creator.yaml -c /tmp/tmpHA6iVz/deployer/publisher.yaml -c /tmp/tmpHA6iVz/deployer/relations.yaml -c /tmp/tmpHA6iVz/deployer/test-runner.yaml -c /tmp/tmpHA6iVz/deployer/ticket-system.yaml -c /tmp/tmpHA6iVz/deployer/validator.yaml -c /tmp/tmpHA6iVz/deployer/webui.yaml ci-airline
Tests running...
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testConnectFailed ... OK (0.001 secs)
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testProcessQueue ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testRunForever ... OK (0.102 secs)
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testSent ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp.TestProgressTrigger.testProgress ... OK (0.001 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testCancel ... OK (0.106 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testNoQueue ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testNoTicket ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageCalledProcessError ... OK (0.003 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageFail ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageKilled ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageSimple ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageUnexpected ... OK (0.003 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testSaveLastRun ... OK (0.001 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestTimer.testCBRuns ... OK (0.021 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestTimer.testCanCancel ... OK (0.000 secs)
ci-utils.ci_utils.tests.test_data_store.TestDataStoreConfig.test_invalid_auth_config ... OK (0.000 secs)
ci-utils.ci_utils.tests.test_data_store.TestDataStoreConfig.test_valid_auth_config ... OK (0.000 secs)
ci-utils.ci_utils.tests.test...

Revision history for this message
Vincent Ladeuil (vila) wrote :

/me sighs

======================================================================
FAIL: tests.test_cli.CliTest.test_update_ticket_attributes
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tarmac/branch.bCZ9TI/bin/../tests/test_cli.py", line 107, in test_update_ticket_attributes
    'Updated via CLI', ticket['title'])
  File "/usr/lib/python2.7/unittest/case.py", line 515, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 508, in _baseAssertEqual
    raise self.failureException(msg)
AssertionError: 'Updated via CLI' != u'Created via CLI'
======================================================================
FAIL: tests.test_integration.IntegrationTest.test_create_ticket_via_cli
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tarmac/branch.bCZ9TI/bin/../tests/test_integration.py", line 86, in test_create_ticket_via_cli
    ticket_id = self.create_new_ticket(ticket_title, ci_url)
  File "/tmp/tarmac/branch.bCZ9TI/bin/../tests/test_integration.py", line 74, in create_new_ticket
    0, proc.returncode, '{} failed:\n{}'.format(args, out))
  File "/usr/lib/python2.7/unittest/case.py", line 515, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 508, in _baseAssertEqual
    raise self.failureException(msg)
AssertionError: ('python', '/tmp/tarmac/branch.bCZ9TI/tests/../cli/ubuntu-ci', '-u', 'http://10.0.3.47', 'create_ticket', '-t', 'Bazinga!', '-d', 'This is a cool new feature', '-b', '1234', '-o', '<email address hidden>', '-s', '/tmp/tarmac/branch.bCZ9TI/ci-utils/ci_uCompleted test command: /usr/bin/env python bin/called-by-tarmac.py

Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :
Download full text (132.8 KiB)

The attempt to merge lp:~vila/uci-engine/delete-data-store into lp:uci-engine failed. Below is the output from the failed tests.

Running cm...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
Updating source dependencies...
uploading webui-content.tgz to swift
Updating source dependencies...
Checking juju status
Private PPAs: disabled
Preparing local branch upload...
Uploading local branch, fingerprint bf5030beded28feece88a5d6ac02105c2f5beff1
Building charm: lander
Building charm: wsgi-app
Building charm: rabbitmq-worker
Building charm: chroot-builder
Building charm: key-secret-subordinate
Building charm: webui
Building charm: system-image-server
Installing keys from bzr+ssh://bazaar.launchpad.net/~ci-engineering-private/+junk/ci-airline-dev-keys/
Running juju-deployer -v -c /tmp/tmpu81q07/deployer/branch-source-builder.yaml -c /tmp/tmpu81q07/deployer/britney-proxy.yaml -c /tmp/tmpu81q07/deployer/coverage-retriever.yaml -c /tmp/tmpu81q07/deployer/gatekeeper.yaml -c /tmp/tmpu81q07/deployer/image-builder.yaml -c /tmp/tmpu81q07/deployer/lander.yaml -c /tmp/tmpu81q07/deployer/nf-stats-service.yaml -c /tmp/tmpu81q07/deployer/ppa-creator.yaml -c /tmp/tmpu81q07/deployer/publisher.yaml -c /tmp/tmpu81q07/deployer/relations.yaml -c /tmp/tmpu81q07/deployer/test-runner.yaml -c /tmp/tmpu81q07/deployer/ticket-system.yaml -c /tmp/tmpu81q07/deployer/validator.yaml -c /tmp/tmpu81q07/deployer/webui.yaml ci-airline
Tests running...
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testConnectFailed ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testProcessQueue ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testRunForever ... OK (0.102 secs)
ci-utils.ci_utils.tests.test_amqp.TestAMQP.testSent ... OK (0.003 secs)
ci-utils.ci_utils.tests.test_amqp.TestProgressTrigger.testProgress ... OK (0.001 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testCancel ... OK (0.108 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testNoQueue ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testNoTicket ... OK (0.004 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageCalledProcessError ... OK (0.003 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageFail ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageKilled ... OK (0.003 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageSimple ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testOnMessageUnexpected ... OK (0.002 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestAMQPWorker.testSaveLastRun ... OK (0.026 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestTimer.testCBRuns ... OK (0.021 secs)
ci-utils.ci_utils.tests.test_amqp_worker.TestTimer.testCanCancel ... OK (0.001 secs)
ci-utils.ci_utils.tests.test_data_store.TestDataStoreConfig.test_invalid_auth_config ... OK (0.000 secs)
ci-utils.ci_utils.tests.test_data_store.TestDataStoreConfig.test_valid_auth_config ... OK (0.000 secs)
ci-utils.ci_utils.tests.test...

Revision history for this message
Vincent Ladeuil (vila) wrote :

======================================================================
FAIL: tests.test_integration.IntegrationTest.test_create_ticket_via_cli
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tarmac/branch.uTN91j/bin/../tests/test_integration.py", line 86, in test_create_ticket_via_cli
    ticket_id = self.create_new_ticket(ticket_title, ci_url)
  File "/tmp/tarmac/branch.uTN91j/bin/../tests/test_integration.py", line 74, in create_new_ticket
    0, proc.returncode, '{} failed:\n{}'.format(args, out))
  File "/usr/lib/python2.7/unittest/case.py", line 515, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python2.7/unittest/case.py", line 508, in _baseAssertEqual
    raise self.failureException(msg)
AssertionError: ('python', '/tmp/tarmac/branch.uTN91j/tests/../cli/ubuntu-ci', '-u', 'http://10.0.3.206', 'create_ticket', '-t', 'Bazinga!', '-d', 'This is a cool new feature', '-b', '1234', '-o', '<email address hidden>', '-s', '/tmp/tarmac/branch.uTN91j/ci-utils/ci_utils/testing/data/foobar_0.1-1_source.changes') failed:
ubuntu-ci ERROR SPU remote processing error: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request <em><a href="/gk/api/v1/ticket/9f4ba188-5f55-11e4-b58c-00163e3a5b7c/sandbox/9fdebc02-5f55-11e4-aa29-00163e66539f">POST&nbsp;/gk/api/v1/ticket/9f4ba188-5f55-11e4-b58c-00163e3a5b7c/sandbox/9fdebc02-5f55-11e4-aa29-00163e66539f</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
<hr>
<address>Apache/2.2.22 (Ubuntu) Server at 10.0.3.206 Port 80</address>
</body></html>

gpg: Signature made Thu 17 Jul 2014 07:46:56 PM GMT using RSA key ID 2ABEFCDB
gpg: Good signature from "Foo Bar Test <email address hidden>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 52DC 2178 A5EC ADD2 F213 DD84 D9A2 A831 2ABE FCDB

Ran 780 tests in 509.864s
FAILED (failures=1)

Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:867
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1638/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1638/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:868
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1639/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1639/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:868
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1640/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/1640/rebuild

review: Approve (continuous-integration)
Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :
Download full text (17.7 KiB)

The attempt to merge lp:~vila/uci-engine/delete-data-store into lp:uci-engine failed. Below is the output from the failed tests.

INFO:root:Creating a virtualenv to run under...
INFO:root:Asked to set the env to the virtualenv at /dev/shm/venv-9aNl3c
ERROR:root:ci-utils setup failed (with code 1):
ERROR:root:key_read: uudecode AAAAB3NzaC1yc2EAAAABIwAAAIEApuXd4MHTfr1qLXWeClxTTQYZQblCA+nHvbjAjowkEd2Y4kpvntJOVewoSwa22zTbiYSmmssCuCkFHwcpnZBZN5qMWewjizav30WfeyLR5Kng5qucxmFAEkNJjCJiu194wRNKu0cD99Uk/6X/AfsWGLgmL5pa5UFk62aW+iZLUQ8=|1|hVPNJ4MrKnZWaf2zVrEUkfI5rl0=|GBs4hXpQrAHcZbAX7/bvyoXLwY8= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPpzu7IGUr4ISq9LwU91Nz1+K//2yA/Afy7nmiqotMPn6SKiFFE2soAQ460kfhvUxHaw27sSy7mrizZZux9ACYc=
ERROR:root: failed
ERROR:root:Branched 26 revisions.
ERROR:root:Unpacking /tmp/tarmac/branch.YjrsvN/.deps/Babel-1.3.tar.gz
ERROR:root: Running setup.py (path:/tmp/pip-32slAS-build/setup.py) egg_info for package from file:///tmp/tarmac/branch.YjrsvN/.deps/Babel-1.3.tar.gz
ERROR:root:
ERROR:root: warning: no previously-included files matching '*' found under directory 'docs/_build'
ERROR:root: warning: no previously-included files matching '*.pyc' found under directory 'tests'
ERROR:root: warning: no previously-included files matching '*.pyo' found under directory 'tests'
ERROR:root:Installing collected packages: Babel
ERROR:root: Running setup.py install for Babel
ERROR:root:
ERROR:root: warning: no previously-included files matching '*' found under directory 'docs/_build'
ERROR:root: warning: no previously-included files matching '*.pyc' found under directory 'tests'
ERROR:root: warning: no previously-included files matching '*.pyo' found under directory 'tests'
ERROR:root: Installing pybabel script to /dev/shm/venv-9aNl3c/bin
ERROR:root:Successfully installed Babel
ERROR:root:Cleaning up...
ERROR:root:Unpacking /tmp/tarmac/branch.YjrsvN/.deps/pbr-0.6.tar.gz
ERROR:root: Running setup.py (path:/tmp/pip-ExxZtO-build/setup.py) egg_info for package from file:///tmp/tarmac/branch.YjrsvN/.deps/pbr-0.6.tar.gz
ERROR:root: [pbr] Processing SOURCES.txt
ERROR:root: warning: LocalManifestMaker: standard file '-c' not found
ERROR:root:
ERROR:root: warning: no previously-included files found matching '.gitignore'
ERROR:root: warning: no previously-included files found matching '.gitreview'
ERROR:root: warning: no previously-included files matching '*.pyc' found anywhere in distribution
ERROR:root: warning: no previously-included files found matching '.gitignore'
ERROR:root: warning: no previously-included files found matching '.gitreview'
ERROR:root: warning: no previously-included files matching '*.pyc' found anywhere in distribution
ERROR:root:Installing collected packages: pbr
ERROR:root: Running setup.py install for pbr
ERROR:root: [pbr] Reusing existing SOURCES.txt
ERROR:root: error: [Errno 28] No space left on device
ERROR:root: Complete output from command /dev/shm/venv-9aNl3c/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-ExxZtO-build/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n...

Revision history for this message
Ubuntu CI Bot (uci-bot) wrote :

The attempt to merge lp:~vila/uci-engine/delete-data-store into lp:uci-engine failed. Below is the output from the failed tests.

INFO:root:Creating a virtualenv to run under...
INFO:root:Asked to set the env to the virtualenv at /dev/shm/venv-yYUWL6
INFO:root:virtualenv created in 239.93s.
INFO:root:Deploying.
key_read: uudecode AAAAB3NzaC1yc2EAAAABIwAAAIEApuXd4MHTfr1qLXWeClxTTQYZQblCA+nHvbjAjowkEd2Y4kpvntJOVewoSwa22zTbiYSmmssCuCkFHwcpnZBZN5qMWewjizav30WfeyLR5Kng5qucxmFAEkNJjCJiu194wRNKu0cD99Uk/6X/AfsWGLgmL5pa5UFk62aW+iZLUQ8=|1|hVPNJ4MrKnZWaf2zVrEUkfI5rl0=|GBs4hXpQrAHcZbAX7/bvyoXLwY8= ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPpzu7IGUr4ISq9LwU91Nz1+K//2yA/Afy7nmiqotMPn6SKiFFE2soAQ460kfhvUxHaw27sSy7mrizZZux9ACYc=
 failed
Traceback (most recent call last):
  File "bin/called-by-tarmac.py", line 140, in <module>
    sys.exit(main())
  File "bin/called-by-tarmac.py", line 132, in main
    if not bootstrap() or deploy.main() != 0:
  File "/tmp/tarmac/branch.9UxSRL/testing/../juju-deployer/deploy.py", line 991, in main
    setup()
  File "/tmp/tarmac/branch.9UxSRL/testing/../juju-deployer/deploy.py", line 951, in setup
    check_environment()
  File "/tmp/tarmac/branch.9UxSRL/testing/../juju-deployer/deploy.py", line 198, in check_environment
    os.environ[key] = _get_net_id()
  File "/tmp/tarmac/branch.9UxSRL/testing/../juju-deployer/deploy.py", line 120, in _get_net_id
    networks = neutron.list_networks()['networks']
  File "/dev/shm/venv-yYUWL6/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 111, in with_params
    ret = self.function(instance, *args, **kwargs)
  File "/dev/shm/venv-yYUWL6/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 333, in list_networks
    **_params)
  File "/dev/shm/venv-yYUWL6/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1250, in list
    for r in self._pagination(collection, path, **params):
  File "/dev/shm/venv-yYUWL6/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1263, in _pagination
    res = self.get(path, params=params)
  File "/dev/shm/venv-yYUWL6/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1236, in get
    headers=headers, params=params)
  File "/dev/shm/venv-yYUWL6/local/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1228, in retry_request
    raise exceptions.ConnectionFailed(reason=_("Maximum attempts reached"))
neutronclient.common.exceptions.ConnectionFailed: Connection to neutron failed: Maximum attempts reached

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'britney_proxy/britney/process_results.py'
2--- britney_proxy/britney/process_results.py 2014-10-14 16:23:55 +0000
3+++ britney_proxy/britney/process_results.py 2014-10-29 13:55:51 +0000
4@@ -119,8 +119,8 @@
5 # generic name here.
6 'uci-testbed')
7 self.copy_artifact('{}.log'.format(package))
8- # FIXME: We could delete the test runner swift container at that point
9- # to reduce cluttering swift -- vila 2014-10-02
10+ # The test runner swift container has been processed and can die
11+ self.tr_data_store.delete(recursive=True)
12 report_queue = request.get('report_queue', None)
13 if report_queue is not None:
14 # Publish a message to report where the results have been stored
15
16=== modified file 'britney_proxy/britney/tests/test_process_results.py'
17--- britney_proxy/britney/tests/test_process_results.py 2014-10-10 09:31:54 +0000
18+++ britney_proxy/britney/tests/test_process_results.py 2014-10-29 13:55:51 +0000
19@@ -93,3 +93,6 @@
20 britney_name = self.handler.mapper.get_artifact_name('fake.log')
21 actual_content = self.britney_data_store.get_file(britney_name)
22 self.assertEquals(fake_content, actual_content)
23+ # The test runner data store has been removed
24+ self.assertFalse(os.path.exists(self.tr_ds_path),
25+ '{} should have been deleted'.format(self.tr_ds_path))
26
27=== modified file 'ci-utils/ci_utils/testing/fixtures.py'
28--- ci-utils/ci_utils/testing/fixtures.py 2014-10-10 10:00:49 +0000
29+++ ci-utils/ci_utils/testing/fixtures.py 2014-10-29 13:55:51 +0000
30@@ -87,7 +87,8 @@
31 self.delete_file(f)
32
33 def delete(self, recursive=False):
34- self.clear()
35+ if recursive:
36+ self.clear()
37 os.rmdir(self.container_id)
38
39 def file_path(self, filename):
40
41=== modified file 'ci-utils/ci_utils/tests/test_fixtures.py'
42--- ci-utils/ci_utils/tests/test_fixtures.py 2014-10-10 10:00:49 +0000
43+++ ci-utils/ci_utils/tests/test_fixtures.py 2014-10-29 13:55:51 +0000
44@@ -85,9 +85,18 @@
45 def test_delete(self):
46 self.assertTrue(os.path.exists(self.ds_path))
47 self.ds.put_file('foo', 'foo content\n')
48- self.ds.delete()
49+ self.ds.delete(recursive=True)
50 self.assertFalse(os.path.exists(self.ds_path))
51
52+ def test_delete_not_empty(self):
53+ self.assertTrue(os.path.exists(self.ds_path))
54+ self.ds.put_file('foo', 'foo content\n')
55+ with self.assertRaises(OSError) as cm:
56+ self.ds.delete()
57+ # FIXME: Ideally the fake data store and the real one should throw the
58+ # same exception in this case, not a big deal -- vila 2014-10-29
59+ self.assertEqual(errno.ENOTEMPTY, cm.exception.args[0])
60+
61
62 class TestUsingFakeDataStore(unittest.TestCase):
63
64
65=== modified file 'coverage-retriever/coverageretriever/tests/__init__.py'
66--- coverage-retriever/coverageretriever/tests/__init__.py 2014-10-13 20:36:54 +0000
67+++ coverage-retriever/coverageretriever/tests/__init__.py 2014-10-29 13:55:51 +0000
68@@ -19,8 +19,12 @@
69
70 from mock import patch
71
72+
73+from ucitests import fixtures as uci_fixtures
74+
75+
76 from ci_utils.amqp_worker import AMQPWorker
77-from ci_utils.testing.fixtures import FakeDataStore
78+from ci_utils.testing import fixtures
79
80 vanilla_build_log = u"""
81 ===== BEGIN coverage.xml =====
82@@ -99,11 +103,16 @@
83
84 class CoverageRetrieverTestCase(unittest.TestCase):
85
86+ def setUp(self):
87+ super(CoverageRetrieverTestCase, self).setUp()
88+ # We'll use fixtures.FakeDataStore that requires disk resources
89+ uci_fixtures.set_uniq_cwd(self)
90+
91 @contextmanager
92 def patch_create_data_store(self):
93 """Patch in a FakeDataStore for testing."""
94- self.fake_data_store = FakeDataStore('fake_ticket_id')
95- self.addCleanup(self.fake_data_store.delete)
96+ self.fake_data_store = fixtures.FakeDataStore('fake_ticket_id')
97+ self.addCleanup(self.fake_data_store.delete, recursive=True)
98 with patch.object(
99 AMQPWorker,
100 '_create_data_store',

Subscribers

People subscribed via source and target branches