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
=== modified file 'scripts/publish_to_snapshots.py'
--- scripts/publish_to_snapshots.py 2012-05-17 19:13:54 +0000
+++ scripts/publish_to_snapshots.py 2012-08-03 10:42:18 +0000
@@ -34,6 +34,7 @@
34 'ubuntu-images',34 'ubuntu-images',
35 'ubuntu-restricted',35 'ubuntu-restricted',
36 'ubuntu-sysroots',36 'ubuntu-sysroots',
37 'openembedded',
37 'binaries'38 'binaries'
38 ]39 ]
3940
@@ -64,6 +65,8 @@
64 args.job_type == "ubuntu-restricted" or65 args.job_type == "ubuntu-restricted" or
65 args.job_type == "ubuntu-sysroots"):66 args.job_type == "ubuntu-sysroots"):
66 ret_val = jobname.split('-', 2)67 ret_val = jobname.split('-', 2)
68 elif args.job_type == "openembedded":
69 ret_val = jobname.split('-', 2)
67 elif args.job_type == "prebuilt":70 elif args.job_type == "prebuilt":
68 # Return value must not be None when we want to ignore it.71 # Return value must not be None when we want to ignore it.
69 ret_val = ''72 ret_val = ''
@@ -105,6 +108,13 @@
105 [dist_name, hwpack_image, board_rootfs_name,108 [dist_name, hwpack_image, board_rootfs_name,
106 str(args.build_num)])109 str(args.build_num)])
107 target_dir_path = os.path.join(target_path, target_dir)110 target_dir_path = os.path.join(target_path, target_dir)
111 elif args.job_type == "openembedded":
112 build_dir_path = os.path.join(uploads_path,
113 args.job_type,
114 args.job_name)
115 target_dir_path = os.path.join(target_path,
116 args.job_type,
117 args.job_name)
108 elif args.job_type == "prebuilt":118 elif args.job_type == "prebuilt":
109 build_path = '%s/%d' % (args.job_name, args.build_num)119 build_path = '%s/%d' % (args.job_name, args.build_num)
110 build_dir_path = os.path.join(uploads_path, build_path)120 build_dir_path = os.path.join(uploads_path, build_path)
111121
=== modified file 'tests/test_publish_to_snapshots.py'
--- tests/test_publish_to_snapshots.py 2012-07-11 11:56:10 +0000
+++ tests/test_publish_to_snapshots.py 2012-08-03 10:42:18 +0000
@@ -66,6 +66,9 @@
66 ['-t', 'ubuntu-sysroots', '-j', 'dummy_job_name', '-n', '1'])66 ['-t', 'ubuntu-sysroots', '-j', 'dummy_job_name', '-n', '1'])
67 self.publisher.validate_args(param)67 self.publisher.validate_args(param)
68 param = self.parser.parse_args(68 param = self.parser.parse_args(
69 ['-t', 'openembedded', '-j', 'dummy_job_name', '-n', '1'])
70 self.publisher.validate_args(param)
71 param = self.parser.parse_args(
69 ['-t', 'binaries', '-j', 'dummy_job_name', '-n', '1'])72 ['-t', 'binaries', '-j', 'dummy_job_name', '-n', '1'])
70 self.publisher.validate_args(param)73 self.publisher.validate_args(param)
7174
@@ -353,6 +356,33 @@
353 stdout.seek(0)356 stdout.seek(0)
354 self.assertIn("Moved the files from", stdout.read())357 self.assertIn("Moved the files from", stdout.read())
355358
359 def test_move_artifacts_openembedded_successful_move(self):
360 orig_stdout = sys.stdout
361 stdout = sys.stdout = StringIO()
362 self.publisher = SnapshotsPublisher()
363 param = self.parser.parse_args(['-t', 'openembedded',
364 '-j', 'sources',
365 '-n', '1'])
366 self.publisher.validate_args(param)
367 build_path = os.path.join(self.uploads_path,
368 param.job_type,
369 param.job_name)
370 os.makedirs(build_path)
371 tempfile.mkstemp(dir=build_path)
372 try:
373 uploads_dir_path, target_dir_path = self.publisher.validate_paths(
374 param, self.uploads_path, self.target_path)
375 uploads_dir_path = os.path.join(self.orig_dir, uploads_dir_path)
376 target_dir_path = os.path.join(self.orig_dir, target_dir_path)
377 self.publisher.move_artifacts(param, uploads_dir_path,
378 target_dir_path)
379 finally:
380 sys.stdout = orig_stdout
381 pass
382
383 stdout.seek(0)
384 self.assertIn("Moved the files from", stdout.read())
385
356 def test_move_artifacts_binaries_successful_move(self):386 def test_move_artifacts_binaries_successful_move(self):
357 orig_stdout = sys.stdout387 orig_stdout = sys.stdout
358 stdout = sys.stdout = StringIO()388 stdout = sys.stdout = StringIO()

Subscribers

People subscribed via source and target branches