Project

General

Profile

« Previous | Next » 

Revision ddfc4136

Added by Partha Aji over 8 years ago

Fixes #13284 - Enables Taskgroups for Applicablity

The regenerate applicable errata call for a repository can return
either a Task Group or a list of spawned tasks. This commit enables
the use of that.
This is an important change in pulp 2.8.
Look at
https://github.com/pulp/pulp/blob/master/docs/dev-guide/integration/rest-api/consumer/applicability.rst#generate-content-applicability-for-updated-repositories
for more info.

View differences:

test/resources/repository_test.rb
refute_empty response
end
def test_generate_applicability
def test_generate_applicability_with_spawned_tasks
criteria = {
'repo_criteria' => { 'filters' => { 'id' => { '$in' => [RepositorySupport.repo_id] } } }
}
......
task = RepositorySupport.new.wait_on_response(response)
assert 'finished', task.first['state']
end
def test_generate_applicability_with_task_group
criteria = {
'parallel' => true,
'repo_criteria' => { 'filters' => { 'id' => { '$in' => [RepositorySupport.repo_id] } } }
}
response = @resource.regenerate_applicability(criteria)
assert_equal 202, response.code
assert response.key?("group_id")
summary = RepositorySupport.new.wait_on_task_group(response)
assert summary["total"], summary['finished']
end
end
class TestRespositoryDistributor < MiniTest::Unit::TestCase

Also available in: Unified diff