USGMELC3GV3KAOQXVKC7XLSLF5UXA7DHI77CX7STJ2BPR5MDRTFAC
34SOPSVFSYMJ4BTJBGREAU4H2LHFWI2GKTGZ6R3B4CTUITMVX35QC
LM2LEJNHWOJKU7UKU3CZU2ZHZGF25LJG4IFKQLTH2DH4VEMEVVZQC
6HMHT4IQKBXZINHFDOOILWTTPRQPUJIUCPV4UZYQZ43EZSIMAEBQC
T3OHZDYPABJBSN2G2BMQ47RL5PI5WVMAYQJVPT6TCPEFVGRLPEFQC
EKHD4I44MLSLT6TIEXGJR3BVRFPGOQQOU6J2M7DNDN5YC6EJRDEQC
OPSWSU4LKI2F6UJXL7B7MH4C3L7DVVKYW5FARAJ44XYH4WXELLCQC
LQEYBAEL73DCWQMK4PM6GOKIADZMHAL7O7KIIBNXN756CVOGOKDAC
GQGQEMMADZ2T745QY2FIWLAWRVBSNH3RZABW42WPPYLYP3LQW7JQC
JAH3UPWAVSHXIPNGL6PROQPZBYZHPJNFONWBDZX4HCX646USZXUQC
5EQYVRWECBDJORGI5DRIOUEJXSXMRCQNT2562BM4Z4U52LT7JUHAC
PXTSKX4GBDOBMI4MDO64DBIHSEVTM6IZ5O6GUFXK6UL63GHWBMBAC
FCTX433OH7QIVWHXL23DKVSUKBQSLQTRK3PFCKKSMLX6A634456QC
BLVQGJ4LITFCIR3KAUX3GWAHMYH3XXFC4BDXUSXUVEJFEJ7IMM4AC
NTEDD7T4M7XXYCWNZN57EJOEH3KI3UYMHOANV4MY2LSUPWX3JRDQC
SWXGVPJNE35OLCZD7HOZOJLZZPTWPOKQ6W56Y5EM2TZMNBZJESEQC
# Called when build $build has been queued.
sub buildQueued {
my ($self, $build) = @_;
}
# To implement behaviors in response to the following events, implement
# the function in your plugin and it will be executed by hydra-notify.
#
# See the tests in t/Event/*.t for arguments, and the documentation for
# notify events for semantics.
#
# # Called when build $build has been queued.
# sub buildQueued {
# my ($self, $build) = @_;
# }
# Called when build $build has finished. If the build failed, then
# $dependents is an array ref to a list of builds that have also
# failed as a result (i.e. because they depend on $build or a failed
# dependeny of $build).
sub buildFinished {
my ($self, $build, $dependents) = @_;
}
# # Called when build $build has finished. If the build failed, then
# # $dependents is an array ref to a list of builds that have also
# # failed as a result (i.e. because they depend on $build or a failed
# # dependeny of $build).
# sub buildFinished {
# my ($self, $build, $dependents) = @_;
# }
# Called when step $step has finished. The build log is stored in the
# file $logPath (bzip2-compressed).
sub stepFinished {
my ($self, $step, $logPath) = @_;
}
# # Called when step $step has finished. The build log is stored in the
# # file $logPath (bzip2-compressed).
# sub stepFinished {
# my ($self, $step, $logPath) = @_;
# }
subtest "interested" => sub {
my $event = Hydra::Event::BuildFinished->new(123, []);
subtest "A plugin which does not implement the API" => sub {
my $plugin = {};
my $mock = mock_obj $plugin => ();
is($event->interestedIn($plugin), 0, "The plugin is not interesting.");
};
subtest "A plugin which does implement the API" => sub {
my $plugin = {};
my $mock = mock_obj $plugin => (
add => [
"buildFinished" => sub {}
]
);
};
subtest "interested" => sub {
my $event = Hydra::Event::BuildQueued->new(123, []);
subtest "A plugin which does not implement the API" => sub {
my $plugin = {};
my $mock = mock_obj $plugin => ();
is($event->interestedIn($plugin), 0, "The plugin is not interesting.");
};
subtest "A plugin which does implement the API" => sub {
my $plugin = {};
my $mock = mock_obj $plugin => (
add => [
"buildQueued" => sub {}
]
);
is($event->interestedIn($plugin), 1, "The plugin is interesting.");
};
};
subtest "interested" => sub {
my $event = Hydra::Event::BuildStarted->new(123, []);
subtest "A plugin which does not implement the API" => sub {
my $plugin = {};
my $mock = mock_obj $plugin => ();
is($event->interestedIn($plugin), 0, "The plugin is not interesting.");
};
subtest "A plugin which does implement the API" => sub {
my $plugin = {};
my $mock = mock_obj $plugin => (
add => [
"buildStarted" => sub {}
]
);
is($event->interestedIn($plugin), 1, "The plugin is interesting.");
};
};
subtest "interested" => sub {
my $event = Hydra::Event::StepFinished->new(123, []);
subtest "A plugin which does not implement the API" => sub {
my $plugin = {};
my $mock = mock_obj $plugin => ();
is($event->interestedIn($plugin), 0, "The plugin is not interesting.");
};
subtest "A plugin which does implement the API" => sub {
my $plugin = {};
my $mock = mock_obj $plugin => (
add => [
"stepFinished" => sub {}
]
);
is($event->interestedIn($plugin), 1, "The plugin is interesting.");
};