Skip to content

Commit

Permalink
[ci] move project copy test case to release management suite
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Jun 16, 2016
1 parent ee8bd3c commit 530c909
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 107 deletions.
107 changes: 107 additions & 0 deletions src/api/test/functional/release_management_test.rb
Expand Up @@ -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
107 changes: 0 additions & 107 deletions src/api/test/functional/source_controller_test.rb
Expand Up @@ -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'
Expand Down

0 comments on commit 530c909

Please sign in to comment.