.github
datadog
doc
examples
foreman
src
t
Hydra
Config
Controller
Event
Helper
Plugin
Schema
View
Event.t
Math.t
PostgresListener.t
TaskDispatcher.t
evaluator
input-types
jobs
lib
queue-runner
scripts
Makefile.am
api-test.t
build-products.t
perlcritic.pl
s3-backup-test.config
s3-backup-test.pl
setup-notifications-jobset.pl
test.pl
.editorconfig
.gitignore
.perlcriticrc
.yath.rc
COPYING
INSTALL
Makefile.am
Procfile
README.md
bootstrap
configure.ac
default.nix
flake.lock
flake.nix
hydra-api.yaml
hydra-module.nix
shell.nix
version.txt
t/ had lots of directories and files mirroring src/lib/Hydra. This moves those files under t/Hydra
24 lines
516 B
Perl
24 lines
516 B
Perl
use strict;
|
|
use warnings;
|
|
use Hydra::Event;
|
|
|
|
use Test2::V0;
|
|
use Test2::Tools::Exception;
|
|
|
|
subtest "Event: new event" => sub {
|
|
my $event = Hydra::Event->new_event("build_started", "19");
|
|
is($event->{'payload'}, "19");
|
|
is($event->{'channel_name'}, "build_started");
|
|
is($event->{'event'}->{'build_id'}, 19);
|
|
};
|
|
|
|
subtest "Payload type: bogus" => sub {
|
|
like(
|
|
dies { Hydra::Event::parse_payload("bogus", "") },
|
|
qr/Invalid channel name/,
|
|
"bogus channel"
|
|
);
|
|
};
|
|
|
|
done_testing;
|