From 929ec72c02c7e00eaa60edc6221e056eb98e16e8 Mon Sep 17 00:00:00 2001 From: hylom Date: Thu, 27 Sep 2018 20:54:48 +0900 Subject: [PATCH] Util::DOMTestRunner: fix to avoid server running in maintainance mode --- src/newslash_web/dom_t/test.sh | 2 +- src/newslash_web/lib/Newslash/Util/DOMTestRunner.pm | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/newslash_web/dom_t/test.sh b/src/newslash_web/dom_t/test.sh index fb04123a..9f139375 100644 --- a/src/newslash_web/dom_t/test.sh +++ b/src/newslash_web/dom_t/test.sh @@ -1,2 +1,2 @@ -curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"url":"https://127.0.0.1:3000/"}' http://127.0.0.1:4000/ +curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"url":"https://127.0.0.1:3000/", "ignoreMessages": ["adsbygoogle"]}' http://127.0.0.1:4000/ diff --git a/src/newslash_web/lib/Newslash/Util/DOMTestRunner.pm b/src/newslash_web/lib/Newslash/Util/DOMTestRunner.pm index 5958847a..f11268c7 100644 --- a/src/newslash_web/lib/Newslash/Util/DOMTestRunner.pm +++ b/src/newslash_web/lib/Newslash/Util/DOMTestRunner.pm @@ -101,7 +101,7 @@ sub start_domtest_server { my $self = shift; my $nodejs_cmd = $self->{options}->{nodejs_cmd} || "nodejs"; - my $domtest_script = $self->{options}->{domtest_script} || "./t/dom_test/app.js"; + my $domtest_script = $self->{options}->{domtest_script} || "./dom_test/app.js"; my $domtest_host = $self->{options}->{domtest_host} || "127.0.0.1"; my $domtest_port = $self->{options}->{domtest_port} || "4000"; @@ -156,7 +156,13 @@ sub start_daemon { # prepare to run my $daemon = Mojo::Server::Daemon->new; - my $app = $daemon->build_app($self->{app_class}, $self->{options}); + my $opts = { subcommand => "daemon" }; + if ($self->{options}->{mode}) { + $opts->{options}->{mode} = $self->{mode}; + } + my $app = $self->{app_class}->new($opts); + $daemon->app($app); + my $listen = []; if ($self->{options}->{mojo_listen}) { -- 2.11.0