Re: Network connection

[email protected] (Chad Granum) Sun, 12 Nov 2017 07:46:55 -0800
Newsgroups perl.cpan.workers
Message-ID <CAJFr3kuURgLjazyGuvEiqqXSti9rUXm6o2_nNhFdTXQmf5XErg@mail.gmail.com>
--001a1137b67a450e27055dcb1061
Content-Type: text/plain; charset="UTF-8"

Kent, (or anyone really)

Can you point to any documentation that covers these env vars, and the best
practices you layed out? I have never even heard of the NO_NETWORK_TESTING
var, and considering what modules I maibtain that is worrysome.

I am not asking out of doubt, I want to educate myself, and make these vars
clearly documented along with when to use them in Test-Simple and related
modules.

-Chad

On Nov 12, 2017 7:42 AM, "Kent Fredric" <[email protected]> wrote:

> On 13 November 2017 at 03:59, James E Keenan <[email protected]> wrote:
> > Is there any code which is considered "best practice" for "skip_all
> unless I
> > have an Internet connection"?
> >
> > For the first time I want to write a library whose tests will benefit
> from
> > connection to an FTP server.  If there is some code that I could just
> drop
> > in for situations where the test suite is run offline, that would be
> > helpful.
> >
> > Thank you very much.
> > Jim Keenan
>
> There's a defacto ENV var, which if set, one should do no kind of
> network activity:
>
> NO_NETWORK_TESTING
>
> After taking that in consideration, whether you do any subsequent
> network IO depends on the nature of what you're building.
>
> Ideally, you should aim to be maximally capable of testing your
> library in the absence of a network connection, and have safe-guards
> in place that determine if the network-environment is satisfactory (
> eg: first by checking for the aforementioned ENV var, and then doing
> basic TCP probes ), and then making the tests execution determinate on
> that being satisfactory.
>
> But if Internet access is a quintessential element of whatever you're
> designing, then you should try more eagerly to run network tests.
>
> At least, that's the recommended flow for "end users"
>
> When considering maintainers and AUTOMATED_TESTING, one should be even
> more eager to execute tests, because for these targets, a spurious
> test failure is has fewer negative consequences, and you want to
> actively see any anomalies in the tests.
>
> So for the AUTOMATED_TESTING/AUTHOR_TESTING/RELEASE_TESTING targets,
> one should aim to run network IO tests in all circumstances other than
> an explicit NO_NETWORK_TESTING circumstance.
>
> --
> Kent
>
> KENTNL - https://metacpan.org/author/KENTNL
>

--001a1137b67a450e27055dcb1061
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto">Kent, (or anyone really)<div dir=3D"auto"><br></div><div =
dir=3D"auto">Can you point to any documentation that covers these env vars,=
 and the best practices you layed out? I have never even heard of the NO_NE=
TWORK_TESTING var, and considering what modules I maibtain that is worrysom=
e.</div><div dir=3D"auto"><br></div><div dir=3D"auto">I am not asking out o=
f doubt, I want to educate myself, and make these vars clearly documented a=
long with when to use them in Test-Simple and related modules.</div><div di=
r=3D"auto"><br></div><div dir=3D"auto">-Chad</div></div><div class=3D"gmail=
_extra"><br><div class=3D"gmail_quote">On Nov 12, 2017 7:42 AM, &quot;Kent =
Fredric&quot; &lt;<a href=3D"mailto:[email protected]">kentfredric@gmai=
l.com</a>&gt; wrote:<br type=3D"attribution"><blockquote class=3D"gmail_quo=
te" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"=
>On 13 November 2017 at 03:59, James E Keenan &lt;<a href=3D"mailto:jkeenan=
@pobox.com">[email protected]</a>&gt; wrote:<br>
&gt; Is there any code which is considered &quot;best practice&quot; for &q=
uot;skip_all unless I<br>
&gt; have an Internet connection&quot;?<br>
&gt;<br>
&gt; For the first time I want to write a library whose tests will benefit =
from<br>
&gt; connection to an FTP server.=C2=A0 If there is some code that I could =
just drop<br>
&gt; in for situations where the test suite is run offline, that would be<b=
r>
&gt; helpful.<br>
&gt;<br>
&gt; Thank you very much.<br>
&gt; Jim Keenan<br>
<br>
There&#39;s a defacto ENV var, which if set, one should do no kind of<br>
network activity:<br>
<br>
NO_NETWORK_TESTING<br>
<br>
After taking that in consideration, whether you do any subsequent<br>
network IO depends on the nature of what you&#39;re building.<br>
<br>
Ideally, you should aim to be maximally capable of testing your<br>
library in the absence of a network connection, and have safe-guards<br>
in place that determine if the network-environment is satisfactory (<br>
eg: first by checking for the aforementioned ENV var, and then doing<br>
basic TCP probes ), and then making the tests execution determinate on<br>
that being satisfactory.<br>
<br>
But if Internet access is a quintessential element of whatever you&#39;re<b=
r>
designing, then you should try more eagerly to run network tests.<br>
<br>
At least, that&#39;s the recommended flow for &quot;end users&quot;<br>
<br>
When considering maintainers and AUTOMATED_TESTING, one should be even<br>
more eager to execute tests, because for these targets, a spurious<br>
test failure is has fewer negative consequences, and you want to<br>
actively see any anomalies in the tests.<br>
<br>
So for the AUTOMATED_TESTING/AUTHOR_<wbr>TESTING/RELEASE_TESTING targets,<b=
r>
one should aim to run network IO tests in all circumstances other than<br>
an explicit NO_NETWORK_TESTING circumstance.<br>
<br>
--<br>
Kent<br>
<br>
KENTNL - <a href=3D"https://metacpan.org/author/KENTNL" rel=3D"noreferrer" =
target=3D"_blank">https://metacpan.org/author/<wbr>KENTNL</a><br>
</blockquote></div></div>

--001a1137b67a450e27055dcb1061--