[SCM] ci-tooling packaging branch, master, updated. 460147c822261dc410d8f147c575ae9ef8d838de
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Wed Oct 28 11:47:24 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=45486b7
The following commit has been merged in the master branch:
commit 45486b735f7830a65ba110dc5fe123d07c470712
Author: Harald Sitter <sitter at kde.org>
Date: Wed Oct 28 12:45:32 2015 +0100
implement new static_ci project type to unblock tarball CI
this project type defines repos and tarballs to build and sets upstream_scm
with an SCM typed tarball
---
lib/projects.rb | 18 +++++++++++++++++-
test/data/test_projects/test_static_ci/invalid.json | 14 ++++++++++++++
test/data/test_projects/test_static_ci/projects.json | 14 ++++++++++++++
test/test_projects.rb | 18 ++++++++++++++++++
4 files changed, 63 insertions(+), 1 deletion(-)
diff --git a/lib/projects.rb b/lib/projects.rb
index 3245b6a..8a0536f 100644
--- a/lib/projects.rb
+++ b/lib/projects.rb
@@ -20,7 +20,9 @@ class Project
# Super component (e.g. plasma)
attr_reader :component
# Scm instance describing the upstream SCM associated with this project.
- attr_reader :upstream_scm
+ # FIXME: should this really be writable? need this for projects to force
+ # a different scm which is slightly meh
+ attr_accessor :upstream_scm
# Array of binary packages (debs) provided by this project
attr_reader :provided_binaries
@@ -215,6 +217,20 @@ class ProjectFactory
end
end
end
+ when 'static_ci'
+ value.each do |static_ci|
+ unless static_ci['type'] == 'git.debian.org'
+ fail "Unknown type #{static_ci['type']}"
+ end
+ repos = static_ci['repos'].collect { |e| p OpenStruct.new(e) }
+ repos.each do |repo|
+ component = repo.path.split('/')[0..-2].join('/')
+ name = repo.path.split('/')[-1]
+ pro = Project.new(name, component, branch: repo.branch)
+ pro.upstream_scm = CI::SCM.new('tarball', repo.tarball)
+ ret << pro
+ end
+ end
else
fail "ProjectFactory encountered an unknown configuration key: #{key}"
end
diff --git a/test/data/test_projects/test_static_ci/invalid.json b/test/data/test_projects/test_static_ci/invalid.json
new file mode 100644
index 0000000..ae35106
--- /dev/null
+++ b/test/data/test_projects/test_static_ci/invalid.json
@@ -0,0 +1,14 @@
+{
+ "static_ci": [
+ {
+ "type": "git.kde.org",
+ "repos": [
+ {
+ "path": "qt/qtx11extras",
+ "branch": "experimental",
+ "tarball": "http://abc.tar.xz"
+ }
+ ]
+ }
+ ]
+}
diff --git a/test/data/test_projects/test_static_ci/projects.json b/test/data/test_projects/test_static_ci/projects.json
new file mode 100644
index 0000000..ed33d57
--- /dev/null
+++ b/test/data/test_projects/test_static_ci/projects.json
@@ -0,0 +1,14 @@
+{
+ "static_ci": [
+ {
+ "type": "git.debian.org",
+ "repos": [
+ {
+ "path": "qt/qtx11extras",
+ "branch": "experimental",
+ "tarball": "http://abc.tar.xz"
+ }
+ ]
+ }
+ ]
+}
diff --git a/test/test_projects.rb b/test/test_projects.rb
index 95095dd..7e8675a 100644
--- a/test/test_projects.rb
+++ b/test/test_projects.rb
@@ -174,4 +174,22 @@ class ProjectTest < TestCase
assert_not_include(output, 'link2')
assert_not_include(output, 'file1')
end
+
+ def test_static_ci
+ assert_raise RuntimeError do
+ Projects.new(type: 'unstable', projects_file: data('invalid.json'))
+ end
+
+ projects = Projects.new(type: 'unstable',
+ projects_file: data('projects.json'))
+ assert_equal(1, projects.size)
+ pro = projects[0]
+ assert_equal('qtx11extras', pro.name)
+ assert_equal('qt', pro.component)
+ assert_equal('git', pro.packaging_scm_scm.type)
+ assert_equal('git.debian.org:/git/pkg-kde/qt/qtx11extras', pro.packaging_scm_scm.url)
+ assert_equal('experimental', pro.packaging_scm_scm.branch)
+ assert_equal('tarball', pro.upstream_scm.type)
+ assert_equal('http://abc.tar.xz', pro.upstream_scm.url)
+ end
end
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list