Skip to content

Commit

Permalink
[backend] validate that empty patchinfos are failing
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianschroeter committed Mar 16, 2012
1 parent 80737fd commit d632a09
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions src/api/test/functional/maintenance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -937,10 +937,10 @@ def test_create_maintenance_project_and_release_packages
# block patchinfo build
get "/source/#{incidentProject}/patchinfo/_patchinfo"
assert_response :success
pi = REXML::Document.new( @response.body )
pi.root.add_element "stopped"
pi.elements["//stopped"].text = "The issue is not fixed for real yet"
put "/source/#{incidentProject}/patchinfo/_patchinfo", pi.to_s
pi = ActiveXML::Base.new( @response.body )
pi.add_element "stopped"
pi.stopped.text = "The issue is not fixed for real yet"
put "/source/#{incidentProject}/patchinfo/_patchinfo", pi.dump_xml
assert_response :success
# collect the job results
run_scheduler( "x86_64" )
Expand All @@ -950,9 +950,23 @@ def test_create_maintenance_project_and_release_packages
assert_response :success
assert_tag :parent => { :tag => "result", :attributes => { :repository=>"BaseDistro2.0_LinkedUpdateProject", :arch=>"i586", :state=>"published"} },
:tag => "status", :attributes => { :package=>"patchinfo", :code=>"broken" }
# un-block patchinfo build
pi.root.delete_element 'stopped'
put "/source/#{incidentProject}/patchinfo/_patchinfo", pi.to_s
# un-block patchinfo build, but filter for an empty result
pi.delete_element 'stopped'
pi.add_element 'binary'
pi.binary.text = "does not exist"
put "/source/#{incidentProject}/patchinfo/_patchinfo", pi.dump_xml
assert_response :success
# collect the job results
run_scheduler( "x86_64" )
run_scheduler( "i586" )
wait_for_publisher()
get "/build/#{incidentProject}/_result"
assert_response :success
assert_tag :parent => { :tag => "result", :attributes => { :repository=>"BaseDistro2.0_LinkedUpdateProject", :arch=>"i586", :state=>"published"} },
:tag => "status", :attributes => { :package=>"patchinfo", :code=>"failed" }
# fix it again
pi.delete_element 'binary'
put "/source/#{incidentProject}/patchinfo/_patchinfo", pi.dump_xml
assert_response :success
# collect the job results
run_scheduler( "x86_64" )
Expand Down

0 comments on commit d632a09

Please sign in to comment.