Skip to content

Commit

Permalink
[ci] fix random test case error when running entire suite
Browse files Browse the repository at this point in the history
another test case is triggering a build of BaseDistro3 package.
ensure that the submitted build result matches with current sources
  • Loading branch information
adrianschroeter authored and Karsten Keil committed Apr 6, 2016
1 parent fcdf073 commit 9ead49d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/api/test/functional/maintenance_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2288,12 +2288,22 @@ def test_copy_project_with_history_and_binaries
assert_response 403
assert_xml_tag :tag => 'status', :attributes => { code: 'project_copy_no_permission' }

# as admin
login_king

# not needed for runnning this test case alone, but another test case might have triggered
# a build job, so we need to be sure to have no reason to schedule a build
get '/build/BaseDistro3/BaseDistro3_repo/i586/pack2/_history'
xml = Xmlhash.parse(@response.body)
md5 = xml['entry']['srcmd5']
post "/source/BaseDistro3/pack2?cmd=copy&orev=#{md5}&oproject=BaseDistro3&opackage=pack2"
assert_response :success
run_scheduler('i586')

get '/build/BaseDistro3/_result'
assert_response :success
assert_xml_tag :tag => 'status', :attributes => { package: 'pack2', code: 'succeeded' }

# as admin
login_king
sleep 1 # to ensure that the timestamp becomes newer
post '/source/CopyOfBaseDistro3?cmd=copy&oproject=BaseDistro3&withhistory=1&withbinaries=1&nodelay=1'
assert_response :success
Expand Down

0 comments on commit 9ead49d

Please sign in to comment.