Merge lp:~vila/uci-engine/stores-with-path into lp:uci-engine

Proposed by Vincent Ladeuil
Status: Needs review
Proposed branch: lp:~vila/uci-engine/stores-with-path
Merge into: lp:uci-engine
Diff against target: 65 lines (+2/-25)
3 files modified
britney_proxy/britney/process_results.py (+1/-5)
ci-utils/ci_utils/data_store.py (+1/-2)
ci-utils/ci_utils/tests/test_data_store.py (+0/-18)
To merge this branch: bzr merge lp:~vila/uci-engine/stores-with-path
Reviewer Review Type Date Requested Status
Evan (community) Needs Information
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+241960@code.launchpad.net

Commit message

Allow data stores to use full paths

Description of the change

Allowing more than basename for artifacts became simpler since we removed 'cli' which was the only code relying on the data store to shorten the paths. The other users handle that themselves.

I've kept the BritneyDataStore as-is for now so we don't lose track of the associated FIXME.

This is a pre-requisite to store test runner artifacts under <package>/<arch> which is a pre-requisite for storing multiple test runs inside the same swift container and also needed for uci-britney.

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

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

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

review: Needs Fixing (continuous-integration)
lp:~vila/uci-engine/stores-with-path updated
898. By Vincent Ladeuil

Fix pyflakes issue.

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

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

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

review: Approve (continuous-integration)
Revision history for this message
Evan (ev) :
review: Needs Information
Revision history for this message
Vincent Ladeuil (vila) wrote :

> Why keep this at all?

From the cover letter: I've kept the BritneyDataStore as-is for now so we don't lose track of the associated FIXME.

And keep the MP small.

The BritneyDataStore will need to be revisited so I prefer to keep the existing references in place instead of replacing them with DataStore. They are equivalent right now but they are not used in the same way (the engine use a swift container for a single ticket, britney uses a swift container for all test results), so I expect this difference to be carried by BritneyDataStore when the time comes.

Unmerged revisions

898. By Vincent Ladeuil

Fix pyflakes issue.

897. By Vincent Ladeuil

Now that the 'cli' is gone, nobody requires artifact paths to be reduced to their basename. The corresponding tests are not required anymore either.

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-30 17:30:49 +0000
3+++ britney_proxy/britney/process_results.py 2014-11-17 16:13:58 +0000
4@@ -51,11 +51,7 @@
5 # container. This won't scale but we'll revisit the layout when we get a better
6 # understanding of the britney needs (and numbers !) -- vila 2014-10-03
7 class BritneyDataStore(data_store.DataStore):
8-
9- def file_name(self, filename):
10- # Allow paths to be used as object names in the container by overriding
11- # the filtering in the base class.
12- return filename
13+ pass
14
15
16 class BritneyResultHandler(object):
17
18=== modified file 'ci-utils/ci_utils/data_store.py'
19--- ci-utils/ci_utils/data_store.py 2014-10-07 10:04:01 +0000
20+++ ci-utils/ci_utils/data_store.py 2014-11-17 16:13:58 +0000
21@@ -14,7 +14,6 @@
22 # along with this program. If not, see <http://www.gnu.org/licenses/>.
23
24 import logging
25-import os
26
27 from swiftclient import client
28 from swiftclient.client import ClientException
29@@ -162,7 +161,7 @@
30 :param filename: The file name used to build the object name inside the
31 container.
32 """
33- return os.path.basename(filename)
34+ return filename
35
36 def file_path(self, filename):
37 name = self.file_name(filename)
38
39=== modified file 'ci-utils/ci_utils/tests/test_data_store.py'
40--- ci-utils/ci_utils/tests/test_data_store.py 2014-10-07 10:04:01 +0000
41+++ ci-utils/ci_utils/tests/test_data_store.py 2014-11-17 16:13:58 +0000
42@@ -35,23 +35,5 @@
43 data_store.DataStore.validate_auth_config({})
44
45
46-class TestDataStoreFileName(unittest.TestCase):
47-
48- def setUp(self):
49- super(TestDataStoreFileName, self).setUp()
50- # We won't use any method that requires the auth config so we don't
51- # provide any.
52- self.ds = data_store.DataStore('foo', None)
53-
54- def test_abspath(self):
55- self.assertEquals('foo', self.ds.file_name('/baz/bar/foo'))
56-
57- def test_relpath(self):
58- self.assertEquals('foo', self.ds.file_name('../baz/bar/foo'))
59-
60- def test_basename(self):
61- self.assertEquals('foo', self.ds.file_name('foo'))
62-
63-
64 if __name__ == "__main__":
65 unittest.main()

Subscribers

People subscribed via source and target branches