From 2179b4b4b01d3b24b70f1dba39e1bb3bb891dd76 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Thu, 25 Feb 2021 12:47:56 -0500 Subject: [PATCH] RunCommand: emit the `finished` field as a boolean --- src/lib/Hydra/Plugin/RunCommand.pm | 2 +- t/plugins/runcommand.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/Plugin/RunCommand.pm b/src/lib/Hydra/Plugin/RunCommand.pm index fd095222..7cfb63c5 100644 --- a/src/lib/Hydra/Plugin/RunCommand.pm +++ b/src/lib/Hydra/Plugin/RunCommand.pm @@ -62,7 +62,7 @@ sub buildFinished { my $json = { event => $event, build => $build->id, - finished => $build->get_column('finished'), + finished => $build->get_column('finished') ? JSON::true : JSON::false, timestamp => $build->get_column('timestamp'), project => $build->get_column('project'), jobset => $build->get_column('jobset'), diff --git a/t/plugins/runcommand.t b/t/plugins/runcommand.t index 1945e1dd..7f5f4cb1 100644 --- a/t/plugins/runcommand.t +++ b/t/plugins/runcommand.t @@ -53,7 +53,7 @@ subtest "Validate the top level fields match" => sub { is($dat->{build}, $newbuild->id, "The build event matches our expected ID."); is($dat->{buildStatus}, 0, "The build status matches."); is($dat->{event}, "buildFinished", "The build event matches."); - is($dat->{finished}, 1, "The build finished."); + is($dat->{finished}, JSON::true, "The build finished."); is($dat->{project}, "tests", "The project matches."); is($dat->{jobset}, "basic", "The jobset matches."); is($dat->{job}, "metrics", "The job matches.");