Plack:...lServer(3pm)

πŸ“¦
version 0.02 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ¦‹ Plack::Test::ExternalServer πŸ¦‹

okay bestie, real talk: this is the Plack:...lServer(3pm) page from the User Contributed Perl Documentation, and it's lowkey iconic. she's short, she's sweet, she lets you point your whole test suite at a server that's actually alive. let's get into it πŸ’–


✨ NAME ✨

Plack::Test::ExternalServer β€” Run HTTP tests on external live servers

no cap, that's the whole job. she tests live servers. periodt.


🌸 VERSION 🌸

version 0.02

tiny number, big energy. πŸ‘‘


πŸ’… SYNOPSIS πŸ’…

$ PLACK_TEST_IMPL=Plack::Test::ExternalServer \
  PLACK_TEST_EXTERNALSERVER_URI=http://myhost.example/myapp/ \
  perl my_plack_test.t

see how we just... set two env vars and go? the way that works is so satisfying. no local server spawning, no mocking, just vibes and a real URL. 🫢


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea: this module lets you run your Plack::Test tests against an external server instead of only against a local application β€” and by "only against a local application" I mean through either mocked HTTP or a locally spawned server. both of those are cute, but sometimes you wanna hit the real thing, y'know?

if you wanna know how to actually write tests that can use this module, go read Plack::Test. she's the main character here, this module is just the glow-up. ✨


🌈 ENVIRONMENT VARIABLES 🌈

  • PLACK_TEST_EXTERNALSERVER_URI β€” the value you put here gets used as the base uri for requests to the external server. that's it, that's the whole variable. she's simple and she's powerful. πŸ’œ

πŸ’– SEE ALSO πŸ’–

  • Plack::Test
  • Plack::Test::Server
  • Plack::Test::MockHTTP

the whole friend group fr fr. go say hi. πŸ¦‹


⭐ AUTHOR ⭐

Florian Ragwitz <rafl@debian.org>


🌟 CONTRIBUTOR 🌟

Karen Etheridge <ether@cpan.org>


This software is copyright (c) 2010 by Florian Ragwitz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

so like... yes, you can remix it, redistribute it, whatever β€” just keep it under the same terms as Perl 5 itself. respect the license, bestie. πŸ™ˆ

okay that's the whole page!! this was perl v5.36.0, dated 2022-11-20, served up fresh from Plack:...lServer(3pm) β€” mwah, go write some tests against a live server, you absolute legend πŸ’…πŸ’–πŸŒΈ

πŸ“¦ where this page comes from