[SCM] ci-tooling packaging branch, master, updated. 92f4edb97d3ab78644471c762955d790094f925d

Harald Sitter apachelogger-guest at moszumanska.debian.org
Tue Oct 6 11:06:09 UTC 2015


Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=487a8a7

The following commit has been merged in the master branch:
commit 487a8a7252272427efba02accd8731fd015d6f59
Author: Harald Sitter <sitter at kde.org>
Date:   Tue Oct 6 12:42:46 2015 +0200

    make sure to fully test changelog author lines
    
    - by default fake only ubuntu as the debian fake results in invalid dch
      release values
    - refactor faking to dry the code
    - test both changelog authors in ubuntu and debian
---
 .../{test_symbols_strip => test_changelog_debian}  |  0
 .../{test_symbols_strip => test_changelog_ubuntu}  |  0
 test/test_ci_build_source.rb                       | 47 ++++++++++++++++++----
 3 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/test/data/test_ci_build_source/test_symbols_strip b/test/data/test_ci_build_source/test_changelog_debian
similarity index 100%
copy from test/data/test_ci_build_source/test_symbols_strip
copy to test/data/test_ci_build_source/test_changelog_debian
diff --git a/test/data/test_ci_build_source/test_symbols_strip b/test/data/test_ci_build_source/test_changelog_ubuntu
similarity index 100%
copy from test/data/test_ci_build_source/test_symbols_strip
copy to test/data/test_ci_build_source/test_changelog_ubuntu
diff --git a/test/test_ci_build_source.rb b/test/test_ci_build_source.rb
index 12a67f5..c33c96e 100644
--- a/test/test_ci_build_source.rb
+++ b/test/test_ci_build_source.rb
@@ -10,14 +10,23 @@ require_relative '../lib/os'
 class VCSBuilderTest < TestCase
   REF_TIME = '20150717.1756'
 
+  def fake_os(id, release, version)
+    OS.reset
+    @release = release
+    OS.instance_variable_set(:@hash, VERSION_ID: version, ID: id)
+  end
+
+  def fake_os_ubuntu
+    fake_os('ubuntu', 'vivid', '15.04')
+  end
+
+  def fake_os_debian
+    fake_os('debian', 'sid', '9')
+  end
+
   def setup
-    if OS::ID == 'debian'
-      @release = 'sid'
-      OS.instance_variable_set(:@hash, VERSION_ID: '9', ID: 'debian')
-    elsif OS::ID == 'ubuntu'
-      @release = 'vivid'
-      OS.instance_variable_set(:@hash, VERSION_ID: '15.04', ID: 'ubuntu')
-    end
+    fake_os_ubuntu
+    fake_os_debian if OS::ID == 'debian'
     alias_time
     FileUtils.cp_r(Dir.glob("#{data}/*"), Dir.pwd)
   end
@@ -109,4 +118,28 @@ class VCSBuilderTest < TestCase
     assert_not_include(files, 'test.symbols')
     assert_not_include(files, 'test.symbols.armhf')
   end
+
+  def assert_changelogid(osid, author)
+    send("fake_os_#{osid}".to_sym)
+    source = VcsSourceBuilder.new(release: @release).run
+    Dir.chdir('build') do
+      # FIXME: composition should be in source really
+      dsc = "#{source.name}_#{source.version}.dsc"
+      changelog = "#{source.name}-#{source.version}/debian/changelog"
+      assert(system('dpkg-source', '-x', dsc))
+      line = File.read(changelog).split($/).fetch(4)
+      assert_include(line, author)
+    end
+  end
+
+  def test_changelog_ubuntu
+    assert_changelogid('ubuntu',
+                       ' -- Kubuntu CI <kubuntu-ci at lists.launchpad.net>')
+  end
+
+  def test_changelog_debian
+    omit 'fakes @release as sid which dch considers an invalid value'
+    assert_changelogid('debian',
+                       ' -- Debian CI <null at debian.org>')
+  end
 end

-- 
ci-tooling packaging



More information about the pkg-kde-commits mailing list