-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider creating a sister module that defines a "Recorder" role for Mojo::Test #30
Comments
Also your code basically already has the recorder stuff for the useragent, it just needs switchting to a Role::Tiny, and sri sez: < kraih> then you could still use the role, nothing prevents you from making less efficient proxy helpers for testing that do use the recorder So, uh, any chance of refactoring your already working stuff into that role? :D |
A chance? There's always a chance. lol. But I'm busy enough with @DayJob,
and it's getting nice enough outside, that I don't have a lot of desire to
do that. Still, you guys have helped me out a lot over the years and I feel
like I oughtta. And it can't be *that* hard; I've written Role::Tiny roles
before. Let me think about it some. And if some bright soul wants to take a
stab at it before I get to it, I'm happy to consult.
…On Mon, Mar 22, 2021 at 4:24 PM shadowcat-mst ***@***.***> wrote:
Also your code basically already has the recorder stuff for the useragent,
it just needs switchting to a Role::Tiny, and sri sez:
< kraih> then you could still use the role, nothing prevents you from
making less efficient proxy helpers for testing that do use the recorder
< kraih> it's trivial if the recorder role exists, heck, if someone makes
the role i'll contribute the proxy helpers as a documentation example :P
So, uh, any chance of refactoring your already working stuff into that
role? :D
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#30 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABGUGGQWFM24PRLKLMZK7LTE6YRHANCNFSM4ZT44ZDA>
.
--
Kit Peters, W0KEH
GPG public key fingerpint: D4FF AA62 AFEA 83D6 CC98 ACE5 6FAE 7E74 7F56 ED1D
Hello to any and all NSA, DEA, or other government or non-government agents
reading this email. Tell me about your life; I'll tell you about mine.
|
Totally, dude, just if you can find time to do a bit of refactoring of what you already have, the author of Mojo is up for taking it from there ... and I'm interested enough to kick around and help out |
Here is a stab at it master...kiwiroy:recorder-role |
@kiwiroy That looks decent. Make it a PR? I'll want @shadowcat-mst to give it a once over as well. |
As for conversations at mojo IRC chat (Mar 22, 2021, starting at 10:35 AM GMT), Mojolicious developer (kraih) suggessted he was thinking on about writing a Mojo::UserAgent::Server module that runs the tests against the live service the first time and caches the responses in a t/fixtures/... dir
Further in the convesation mst mentioned this module (Mojo::UserAgent::Mockable), as a possible implementation.
Kraih's sugestion is that it should be a role, use could be like:
I asked at mojo chat if the proxy helpers (->proxy->get_p and post_p) could be also cached by the role. Use cases would to be able to test offline some proxied API (for instance a map API like mapbox, that is easily proxied in mojo through those helpers). kraih said he can contribute the proxy helpers as a contribution example.
Finally, and as an example of a mojo developer user's experience, one should be able to write a test that runs online with a caching flag, like
and then after that the test will be able to be run offline, (obviously w/o the env var set).
The text was updated successfully, but these errors were encountered: