krakend / krakend-ce

KrakenD Community Edition: High-performance, stateless, declarative, API Gateway written in Go.
https://www.krakend.io
Apache License 2.0
1.86k stars 443 forks source link

Add a command to test plugin compatibility with the krakend binary #851

Closed kpacha closed 4 months ago

kpacha commented 4 months ago
./krakend test-plugin -h
 ╓▄█                          ▄▄▌                               ╓██████▄µ  
▐███  ▄███╨▐███▄██H╗██████▄  ║██▌ ,▄███╨ ▄██████▄  ▓██▌█████▄  ███▀╙╙▀▀███╕
▐███▄███▀  ▐█████▀"╙▀▀"╙▀███ ║███▄███┘  ███▀""▀███ ████▀╙▀███H ███     ╙███
▐██████▌   ▐███⌐  ,▄████████M║██████▄  ║██████████M███▌   ███H ███     ,███
▐███╨▀███µ ▐███   ███▌  ,███M║███╙▀███  ███▄```▄▄` ███▌   ███H ███,,,╓▄███▀
▐███  ╙███▄▐███   ╙█████████M║██▌  ╙███▄`▀███████╨ ███▌   ███H █████████▀  
                     ``                     `'`                            
Version: 2.6.0

Tests that one or more plugins are loadable into KrakenD.

Usage:
  krakend test-plugin [flags] [artifacts]

Examples:
krakend test-plugin -scm ./plugins/my_plugin.so ./plugins/my_other_plugin.so

Flags:
  -c, --client     The artifact should contain a Client Plugin.
  -h, --help       help for test-plugin
  -m, --modifier   The artifact should contain a Req/Resp Modifier Plugin.
  -s, --server     The artifact should contain a Server Plugin.

Ex:

./krakend test-plugin -smc ../../luraproject/lura/transport/http/client/plugin/tests/lura-client-example.so
[KO] SERVER lura-client-example.so: The plugin does not contain a HandlerRegisterer.
[KO] MODIFIER   lura-client-example.so: The plugin does not contain a ModifierRegisterer.
[OK] CLIENT lura-client-example.so
[KO] 1 tested plugin(s) in 12.498341ms.
1 plugin(s) failed.