<commit_before>use Test::Deep;
use Test::More tests => 2;
use Data::Dumper;
use Artemis::MCP::Scheduler::Algorithm::WFQ;
use Artemis::MCP::Scheduler::Queue;

my $scheduler = Artemis::MCP::Scheduler::Algorithm::WFQ->new();
isa_ok($scheduler, 'Artemis::MCP::Scheduler::Algorithm::WFQ');

$scheduler->add_queue(Artemis::MCP::Scheduler::Queue->new(name => 'A', share => 300));
$scheduler->add_queue(Artemis::MCP::Scheduler::Queue->new(name => 'B', share => 200));
$scheduler->add_queue(Artemis::MCP::Scheduler::Queue->new(name => 'C', share => 100));

my $hostname = 'bullock';

my @order;

push @order, $scheduler->get_next_job($hostname);
push @order, $scheduler->get_next_job($hostname);
push @order, $scheduler->get_next_job($hostname);
push @order, $scheduler->get_next_job($hostname);
push @order, $scheduler->get_next_job($hostname);
push @order, $scheduler->get_next_job($hostname);

my $right_order=['A','B','A','A','B','C'];
cmp_bag(\@order, $right_order, 'Scheduling');<commit_msg>MCP: unit tests now handle return value of WFQ (string vs. object) correctly<commit_after>use Test::Deep;
use Test::More tests => 2;
use Data::Dumper;
use Artemis::MCP::Scheduler::Algorithm::WFQ;
use Artemis::MCP::Scheduler::Queue;

my $scheduler = Artemis::MCP::Scheduler::Algorithm::WFQ->new();
isa_ok($scheduler, 'Artemis::MCP::Scheduler::Algorithm::WFQ');

$scheduler->add_queue(Artemis::MCP::Scheduler::Queue->new(name => 'A', share => 300));
$scheduler->add_queue(Artemis::MCP::Scheduler::Queue->new(name => 'B', share => 200));
$scheduler->add_queue(Artemis::MCP::Scheduler::Queue->new(name => 'C', share => 100));

my $hostname = 'bullock';

my @order;

push @order, $scheduler->get_next_queue();
push @order, $scheduler->get_next_queue();
push @order, $scheduler->get_next_queue();
push @order, $scheduler->get_next_queue();
push @order, $scheduler->get_next_queue();
push @order, $scheduler->get_next_queue();

my $right_order=['A','B','A','A','B','C'];
my @order_names = map { $_->name } @order;
cmp_bag(\@order_names, $right_order, 'Scheduling');
{'fraction_non_alphanumeric': 0.22043010752688172, 'fraction_numerical': 0.009775171065493646, 'mean_word_length': 9.606217616580311, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2242865', 'n_tokens_mistral': 774, 'n_tokens_neox': 743, 'n_words': 130}