App-Prove-Plugin-Elasticsearch
view release on metacpan or search on metacpan
lib/App/Prove/Elasticsearch/Queue/Rabbit.pm view on Meta::CPAN
#Publish each plan to it's own queue, and the name of this queue that needs work to the 'queues needing work' queue
$self->{mq}->exchange_declare(
$self->{write_channel},
$self->{config}->{'queue.exchange'}, {auto_delete => 0,}
);
$self->{mq}->queue_declare(
$self->{write_channel}, $job->{queue_name},
{auto_delete => 0}
);
$self->{mq}->queue_bind(
$self->{write_channel}, $job->{queue_name},
$self->{config}->{'queue.exchange'}, $job->{queue_name}
);
#queue a test to a queue for the same version/platform/etc
@{$job->{tests}} =
&{\&{$self->{planner} . "::find_test_paths"}}(@{$job->{tests}});
#filter jobs by what is already done if this is a re-queue for optimization's sake
t/App-Prove-Elasticsearch-Queue-Rabbit.t view on Meta::CPAN
skip("XXX this test will cause the perl interpreter to fail with the message 'Use of uninitialized value in null operation", 1);
like( exception { App::Prove::Elasticsearch::Queue::Rabbit->new({}) }, qr/must be defined/, "Constructor fatal when queue.server not defined");
}
is( exception { $out = App::Prove::Elasticsearch::Queue::Rabbit->new({'queue.host' => 'zippy.test'}) }, undef, "Constructor non-fatal when queue.server defined");
# queue_jobs
local *Net::RabbitMQ::channel_open = sub {};
local *Net::RabbitMQ::exchange_declare = sub {};
local *Net::RabbitMQ::queue_declare = sub {};
local *Net::RabbitMQ::queue_bind = sub {};
local *Net::RabbitMQ::publish = sub { my (undef,undef,undef,$t) = @_; print "queued $t\n"; };
local *Net::RabbitMQ::channel_close = sub {};
local *Net::RabbitMQ::disconnect = sub {};
local *App::Prove::Elasticsearch::Queue::Default::_get_searcher = sub { return shift->{'searcher'} = 'App::Prove::Elasticsearch::Searcher::ByName' };
local *App::Prove::Elasticsearch::Planner::Default::find_test_paths = sub { return @_ };
local *App::Prove::Elasticsearch::Searcher::ByName::filter = sub {};
my $obj = bless({
config => { 'queue.exchange' => 'zippy' },
queue_name => 'eep',
( run in 0.775 second using v1.01-cache-2.11-cpan-2398b32b56e )