]> BookStack Code Mirror - bookstack/commitdiff
Fixed failing webhook test cases 3139/head
authorDan Brown <redacted>
Mon, 3 Jan 2022 19:51:13 +0000 (19:51 +0000)
committerDan Brown <redacted>
Mon, 3 Jan 2022 19:51:13 +0000 (19:51 +0000)
app/Actions/DispatchWebhookJob.php
tests/Actions/WebhookManagementTest.php

index 7cc530c1097821febbaf269737392f7613cc1c18..8f78150a991c84bf243e8e3969e753a7f120d776 100644 (file)
@@ -79,7 +79,6 @@ class DispatchWebhookJob implements ShouldQueue
                 ->withOptions(['allow_redirects' => ['strict' => true]])
                 ->timeout($this->webhook->timeout)
                 ->post($this->webhook->endpoint, $webhookData);
-
         } catch (\Exception $exception) {
             $lastError = $exception->getMessage();
             Log::error("Webhook call to endpoint {$this->webhook->endpoint} failed with error \"{$lastError}\"");
index 206913c74df191929753f5c3099ee278ae44b6f0..6eb32871411776e3ebb8f749353fa6d9929aca5d 100644 (file)
@@ -39,6 +39,7 @@ class WebhookManagementTest extends TestCase
             'endpoint' => 'https://example.com/webhook',
             'events'   => ['all'],
             'active'   => 'true',
+            'timeout'  => 4,
         ]);
 
         $resp->assertRedirect('/settings/webhooks');
@@ -51,6 +52,7 @@ class WebhookManagementTest extends TestCase
             'name'     => 'My first webhook',
             'endpoint' => 'https://example.com/webhook',
             'active'   => true,
+            'timeout'  => 4,
         ]);
 
         /** @var Webhook $webhook */
@@ -82,6 +84,7 @@ class WebhookManagementTest extends TestCase
             'endpoint' => 'https://example.com/updated-webhook',
             'events'   => [ActivityType::PAGE_CREATE, ActivityType::PAGE_UPDATE],
             'active'   => 'true',
+            'timeout'  => 5
         ]);
         $resp->assertRedirect('/settings/webhooks');
 
@@ -93,6 +96,7 @@ class WebhookManagementTest extends TestCase
             'name'     => 'My updated webhook',
             'endpoint' => 'https://example.com/updated-webhook',
             'active'   => true,
+            'timeout'  => 5,
         ]);
 
         $trackedEvents = $webhook->trackedEvents()->get();
Morty Proxy This is a proxified and sanitized view of the page, visit original site.