Merge lp:~fboudra/linaro-license-protection/openembedded-support-lp1032134 into lp:~linaro-automation/linaro-license-protection/trunk

Proposed by Fathi Boudra
Status: Merged
Merged at revision: 95
Proposed branch: lp:~fboudra/linaro-license-protection/openembedded-support-lp1032134
Merge into: lp:~linaro-automation/linaro-license-protection/trunk
Diff against target: 82 lines (+40/-0)
2 files modified
scripts/publish_to_snapshots.py (+10/-0)
tests/test_publish_to_snapshots.py (+30/-0)
To merge this branch: bzr merge lp:~fboudra/linaro-license-protection/openembedded-support-lp1032134
Reviewer Review Type Date Requested Status
Georgy Redkozubov Approve
Review via email: mp+118060@code.launchpad.net

Commit message

Add openembedded job type to publish sources and sstate-cache (LP: #1032134)

Description of the change

Add openembedded job type to publish sources and sstate-cache (LP: #1032134)

To post a comment you must log in.
Revision history for this message
Georgy Redkozubov (gesha) wrote :

Looks good.
If Marcin agreed on Ubuntu-like path go ahead and merge it, otherwise pls fix it.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/publish_to_snapshots.py'
2--- scripts/publish_to_snapshots.py 2012-05-17 19:13:54 +0000
3+++ scripts/publish_to_snapshots.py 2012-08-03 10:42:18 +0000
4@@ -34,6 +34,7 @@
5 'ubuntu-images',
6 'ubuntu-restricted',
7 'ubuntu-sysroots',
8+ 'openembedded',
9 'binaries'
10 ]
11
12@@ -64,6 +65,8 @@
13 args.job_type == "ubuntu-restricted" or
14 args.job_type == "ubuntu-sysroots"):
15 ret_val = jobname.split('-', 2)
16+ elif args.job_type == "openembedded":
17+ ret_val = jobname.split('-', 2)
18 elif args.job_type == "prebuilt":
19 # Return value must not be None when we want to ignore it.
20 ret_val = ''
21@@ -105,6 +108,13 @@
22 [dist_name, hwpack_image, board_rootfs_name,
23 str(args.build_num)])
24 target_dir_path = os.path.join(target_path, target_dir)
25+ elif args.job_type == "openembedded":
26+ build_dir_path = os.path.join(uploads_path,
27+ args.job_type,
28+ args.job_name)
29+ target_dir_path = os.path.join(target_path,
30+ args.job_type,
31+ args.job_name)
32 elif args.job_type == "prebuilt":
33 build_path = '%s/%d' % (args.job_name, args.build_num)
34 build_dir_path = os.path.join(uploads_path, build_path)
35
36=== modified file 'tests/test_publish_to_snapshots.py'
37--- tests/test_publish_to_snapshots.py 2012-07-11 11:56:10 +0000
38+++ tests/test_publish_to_snapshots.py 2012-08-03 10:42:18 +0000
39@@ -66,6 +66,9 @@
40 ['-t', 'ubuntu-sysroots', '-j', 'dummy_job_name', '-n', '1'])
41 self.publisher.validate_args(param)
42 param = self.parser.parse_args(
43+ ['-t', 'openembedded', '-j', 'dummy_job_name', '-n', '1'])
44+ self.publisher.validate_args(param)
45+ param = self.parser.parse_args(
46 ['-t', 'binaries', '-j', 'dummy_job_name', '-n', '1'])
47 self.publisher.validate_args(param)
48
49@@ -353,6 +356,33 @@
50 stdout.seek(0)
51 self.assertIn("Moved the files from", stdout.read())
52
53+ def test_move_artifacts_openembedded_successful_move(self):
54+ orig_stdout = sys.stdout
55+ stdout = sys.stdout = StringIO()
56+ self.publisher = SnapshotsPublisher()
57+ param = self.parser.parse_args(['-t', 'openembedded',
58+ '-j', 'sources',
59+ '-n', '1'])
60+ self.publisher.validate_args(param)
61+ build_path = os.path.join(self.uploads_path,
62+ param.job_type,
63+ param.job_name)
64+ os.makedirs(build_path)
65+ tempfile.mkstemp(dir=build_path)
66+ try:
67+ uploads_dir_path, target_dir_path = self.publisher.validate_paths(
68+ param, self.uploads_path, self.target_path)
69+ uploads_dir_path = os.path.join(self.orig_dir, uploads_dir_path)
70+ target_dir_path = os.path.join(self.orig_dir, target_dir_path)
71+ self.publisher.move_artifacts(param, uploads_dir_path,
72+ target_dir_path)
73+ finally:
74+ sys.stdout = orig_stdout
75+ pass
76+
77+ stdout.seek(0)
78+ self.assertIn("Moved the files from", stdout.read())
79+
80 def test_move_artifacts_binaries_successful_move(self):
81 orig_stdout = sys.stdout
82 stdout = sys.stdout = StringIO()

Subscribers

People subscribed via source and target branches