hydra-notify: move BuildStarted processing to an Event

This commit is contained in:
Graham Christensen
2021-08-12 09:56:42 -04:00
committed by Your Name
parent 10e85e3422
commit 4fdb20d3bd
4 changed files with 102 additions and 42 deletions

View File

@ -1,7 +1,6 @@
use strict;
use Hydra::Event;
use Hydra::Event::BuildFinished;
use Hydra::Event::BuildStarted;
use Hydra::Event::StepFinished;
use Test2::V0;
@ -14,29 +13,6 @@ subtest "Event: new event" => sub {
is($event->{'event'}->{'build_id'}, 19);
};
subtest "Payload type: build_started" => sub {
like(
dies { Hydra::Event::parse_payload("build_started", "") },
qr/one argument/,
"empty payload"
);
like(
dies { Hydra::Event::parse_payload("build_started", "abc123\tabc123") },
qr/only one argument/,
"two arguments"
);
like(
dies { Hydra::Event::parse_payload("build_started", "abc123") },
qr/should be an integer/,
"not an integer"
);
is(
Hydra::Event::parse_payload("build_started", "19"),
Hydra::Event::BuildStarted->new(19),
"Valid parse"
);
};
subtest "Payload type: step_finished" => sub {
like(