How to test http request sent from a plugin?

105 views
Skip to first unread message

r-ale...@tuta.io

unread,
Nov 3, 2017, 7:14:45 AM11/3/17
to Kong
Hello

I started to develop a plugin what results in sending a http request to an external system.
It looks like logging with 'http-log' but sends another kind of data.

'http-log' plugin have specs using 'mockbin.org' to verify the request and i tried to make similar tests.

The problem is that 'http-log' specs "Pending: at the time of this change, mockbin.com's behavior with bins seems to be broken." (comment added six months ago https://github.com/Kong/kong/commit/09bed00d473abddeb7380ee575a405fa5cb2df5f)
I tried to make a bin, configure an api and a plugin, send a request to the bin and check the bin "/log" endpoint (like the tests do) and no logs was there.

Please suggest another approach to test http requests sent from a custom plugin.

Ruwen Schwedewsky

unread,
Nov 17, 2017, 7:12:31 PM11/17/17
to kong...@googlegroups.com
Hi!

For our custom plugin development we actually run a local version of http://httpbin.org/ via docker:

docker run -d --name httpbin -p 666:8000 citizenstig/httpbin

This runs in our CI/CD environment and on our local vagrant box. Treat it kinda like a dependency like cassandra.

Relying on external services proofed to be quite a problem, because they are not as available as we want them to be.

Cheers
Ruwen
--
You received this message because you are subscribed to the Google Groups "Kong" group.
To unsubscribe from this group and stop receiving emails from it, send an email to konglayer+...@googlegroups.com.
To post to this group, send email to kong...@googlegroups.com.
Visit this group at https://groups.google.com/group/konglayer.
To view this discussion on the web visit https://groups.google.com/d/msgid/konglayer/04fd4970-1d28-417f-b721-f40eebd51954%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages