From 530c9097a243672a792b259ce70513916d9035d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 16 Jun 2016 08:58:12 +0200 Subject: [PATCH] [ci] move project copy test case to release management suite --- .../functional/release_management_test.rb | 107 ++++++++++++++++++ .../test/functional/source_controller_test.rb | 107 ------------------ 2 files changed, 107 insertions(+), 107 deletions(-) diff --git a/src/api/test/functional/release_management_test.rb b/src/api/test/functional/release_management_test.rb index 41843a4ea99..428adf53ce6 100644 --- a/src/api/test/functional/release_management_test.rb +++ b/src/api/test/functional/release_management_test.rb @@ -152,4 +152,111 @@ def test_release_project delete "/source/TEST:BaseDistro" assert_response :success end + + def test_copy_project_withbinaries + login_king + + # prerequisite: there should be 4 binaries in source project i586 arch + get '/build/home:Iggy/10.2/i586/TestPack' + assert_xml_tag :tag => 'binarylist', :children => { :count => 4 } + + # prerequisite: no binaries in source project for x86_64 arch + get '/build/home:Iggy/10.2/x86_64/TestPack' + assert_xml_tag :tag => 'binarylist', :children => { :count => 0 } + + run_scheduler('i586') + run_scheduler('x86_64') + inject_build_job( 'home:Iggy', 'TestPack', '10.2', 'i586') + inject_build_job( 'home:Iggy', 'TestPack', '10.2', 'x86_64') + run_scheduler('i586') + run_scheduler('x86_64') + run_publisher + + # our source project is not building + get '/build/home:Iggy/_result' + assert_xml_tag :parent => { + :tag => 'result', :attributes => { + :project => 'home:Iggy', + :repository => '10.2', + :arch => 'i586', + :code => 'published', + :state => 'published' } }, + :tag => 'status', :attributes => { + :package => 'TestPack', + :code => 'succeeded' } + assert_xml_tag :parent => { + :tag => 'result', :attributes => { + :project => 'home:Iggy', + :repository => '10.2', + :arch => 'x86_64', + :code => 'published', + :state => 'published' } }, + :tag => 'status', :attributes => { + :package => 'TestPack', + :code => 'succeeded' } + + + # copy project with binaries + post '/source/IggyHomeCopy?cmd=copy&oproject=home:Iggy&noservice=1&withbinaries=1&nodelay=1' + assert_response :success + + # let scheduler process events... + run_scheduler('i586') + run_scheduler('x86_64') + run_publisher + + # get copy project meta and verify copied repositories + get '/source/IggyHomeCopy/_meta' + assert_response :success + + assert_xml_tag :parent => { :tag => 'project', :attributes => { :name => 'IggyHomeCopy' } }, + :tag => 'repository', :attributes => { :name => '10.2' } + + assert_xml_tag :parent => { :tag => 'repository', :attributes => { :name => '10.2' } }, + :tag => 'path', :attributes => { :project => 'BaseDistro', :repository => 'BaseDistro_repo' } + + assert_xml_tag :parent => { :tag => 'repository', :attributes => { :name => '10.2' } }, + :tag => 'arch', :content => 'i586' + + assert_xml_tag :parent => { :tag => 'repository', :attributes => { :name => '10.2' } }, + :tag => 'arch', :content => 'x86_64' + + # check build results are copied correctly + get '/build/IggyHomeCopy/_result' + assert_xml_tag :parent => { + :tag => 'result', :attributes => { + :project => 'IggyHomeCopy', + :repository => '10.2', + :arch => 'i586', + :code => 'published', + :state => 'published' } }, + :tag => 'status', :attributes => { + :package => 'TestPack', + :code => 'succeeded' } + + assert_xml_tag :parent => { + :tag => 'result', :attributes => { + :project => 'IggyHomeCopy', + :repository => '10.2', + :arch => 'x86_64', + :code => 'published', + :state => 'published' } }, + :tag => 'status', :attributes => { + :package => 'TestPack', + :code => 'succeeded' } + + # check that the same binaries are copied + get '/build/home:Iggy/10.2/i586/TestPack' + assert_xml_tag :tag => 'binarylist', :children => { :count => 4 } + get '/build/IggyHomeCopy/10.2/i586/TestPack' + assert_xml_tag :tag => 'binarylist', :children => { :count => 4 } + get '/build/home:Iggy/10.2/x86_64/TestPack' + assert_xml_tag :tag => 'binarylist', :children => { :count => 5 } + get '/build/IggyHomeCopy/10.2/x86_64/TestPack' + assert_xml_tag :tag => 'binarylist', :children => { :count => 5 } + + # cleanup + delete '/source/IggyHomeCopy' + assert_response :success + end end diff --git a/src/api/test/functional/source_controller_test.rb b/src/api/test/functional/source_controller_test.rb index 73a1e671ade..6022f495225 100644 --- a/src/api/test/functional/source_controller_test.rb +++ b/src/api/test/functional/source_controller_test.rb @@ -2760,113 +2760,6 @@ def test_copy_project assert_response :success end - def test_copy_project_withbinaries - login_king - - # prerequisite: there should be 4 binaries in source project i586 arch - get '/build/home:Iggy/10.2/i586/TestPack' - assert_xml_tag :tag => 'binarylist', :children => { :count => 4 } - - # prerequisite: no binaries in source project for x86_64 arch - get '/build/home:Iggy/10.2/x86_64/TestPack' - assert_xml_tag :tag => 'binarylist', :children => { :count => 0 } - - run_scheduler('i586') - run_scheduler('x86_64') - inject_build_job( 'home:Iggy', 'TestPack', '10.2', 'i586') - inject_build_job( 'home:Iggy', 'TestPack', '10.2', 'x86_64') - run_scheduler('i586') - run_scheduler('x86_64') - run_publisher - - # our source project is not building - get '/build/home:Iggy/_result' - assert_xml_tag :parent => { - :tag => 'result', :attributes => { - :project => 'home:Iggy', - :repository => '10.2', - :arch => 'i586', - :code => 'published', - :state => 'published' } }, - :tag => 'status', :attributes => { - :package => 'TestPack', - :code => 'succeeded' } - assert_xml_tag :parent => { - :tag => 'result', :attributes => { - :project => 'home:Iggy', - :repository => '10.2', - :arch => 'x86_64', - :code => 'published', - :state => 'published' } }, - :tag => 'status', :attributes => { - :package => 'TestPack', - :code => 'succeeded' } - - - # copy project with binaries - post '/source/IggyHomeCopy?cmd=copy&oproject=home:Iggy&noservice=1&withbinaries=1&nodelay=1' - assert_response :success - - # let scheduler process events... - run_scheduler('i586') - run_scheduler('x86_64') - run_publisher - - # get copy project meta and verify copied repositories - get '/source/IggyHomeCopy/_meta' - assert_response :success - - assert_xml_tag :parent => { :tag => 'project', :attributes => { :name => 'IggyHomeCopy' } }, - :tag => 'repository', :attributes => { :name => '10.2' } - - assert_xml_tag :parent => { :tag => 'repository', :attributes => { :name => '10.2' } }, - :tag => 'path', :attributes => { :project => 'BaseDistro', :repository => 'BaseDistro_repo' } - - assert_xml_tag :parent => { :tag => 'repository', :attributes => { :name => '10.2' } }, - :tag => 'arch', :content => 'i586' - - assert_xml_tag :parent => { :tag => 'repository', :attributes => { :name => '10.2' } }, - :tag => 'arch', :content => 'x86_64' - - # check build results are copied correctly - get '/build/IggyHomeCopy/_result' - assert_xml_tag :parent => { - :tag => 'result', :attributes => { - :project => 'IggyHomeCopy', - :repository => '10.2', - :arch => 'i586', - :code => 'published', - :state => 'published' } }, - :tag => 'status', :attributes => { - :package => 'TestPack', - :code => 'succeeded' } - - assert_xml_tag :parent => { - :tag => 'result', :attributes => { - :project => 'IggyHomeCopy', - :repository => '10.2', - :arch => 'x86_64', - :code => 'published', - :state => 'published' } }, - :tag => 'status', :attributes => { - :package => 'TestPack', - :code => 'succeeded' } - - # check that the same binaries are copied - get '/build/home:Iggy/10.2/i586/TestPack' - assert_xml_tag :tag => 'binarylist', :children => { :count => 4 } - get '/build/IggyHomeCopy/10.2/i586/TestPack' - assert_xml_tag :tag => 'binarylist', :children => { :count => 4 } - get '/build/home:Iggy/10.2/x86_64/TestPack' - assert_xml_tag :tag => 'binarylist', :children => { :count => 5 } - get '/build/IggyHomeCopy/10.2/x86_64/TestPack' - assert_xml_tag :tag => 'binarylist', :children => { :count => 5 } - - # cleanup - delete '/source/IggyHomeCopy' - assert_response :success - end - def test_source_commits login_tom post '/source/home:Iggy/TestPack', :cmd => 'commitfilelist'