From 6f78032e28cfdcc37044ee1ec1dcaf41d3ef70e5 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Thu, 14 Sep 2017 21:30:03 +0100 Subject: [PATCH] add phase to test worker --- lib/App/Netdisco/Worker/Plugin/Test/Core.pm | 31 +++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 lib/App/Netdisco/Worker/Plugin/Test/Core.pm diff --git a/lib/App/Netdisco/Worker/Plugin/Test/Core.pm b/lib/App/Netdisco/Worker/Plugin/Test/Core.pm new file mode 100644 index 00000000..28a81542 --- /dev/null +++ b/lib/App/Netdisco/Worker/Plugin/Test/Core.pm @@ -0,0 +1,31 @@ +package App::Netdisco::Worker::Plugin::Test::Core; + +use Dancer ':syntax'; +use App::Netdisco::Worker::Plugin; +use aliased 'App::Netdisco::Worker::Status'; + +register_worker({ stage => 'second' }, sub { + my ($job, $workerconf) = @_; + debug 'Test (second) ran successfully.'; + return Status->done('Test (second) ran successfully.'); +}); + +register_worker({ stage => 'check' }, sub { + my ($job, $workerconf) = @_; + debug 'Test (check) ran successfully.'; + return Status->done('Test (check) ran successfully.'); +}); + +register_worker({ stage => 'first' }, sub { + my ($job, $workerconf) = @_; + debug 'Test (first) ran successfully.'; + return Status->done('Test (first) ran successfully.'); +}); + +register_worker(sub { + my ($job, $workerconf) = @_; + debug 'Test (undefined) ran successfully.'; + return Status->done('Test (undefined) ran successfully.'); +}); + +true;