Re: Testing an FTP module

2006-04-03 Thread Nicholas Clark
On Mon, Apr 03, 2006 at 12:56:07AM -0400, Randy W. Sims wrote:
 Scott W Gifford wrote:
 I just uploaded to CPAN some FTP-related modules
 (Net::FTP::AutoReconnect and Net::FTP::RetrHandle).  In one of the
 unit tests, I connect to ftp.cpan.org and retreive MIRRORED.BY to make
 sure everything works OK.
 
 Just in the last little bit, though, I've noticed that a connection to
 ftp.cpan.org is timing out.
 
 So my questions are:
 
   * Is ftp.cpan.org a reliable way to access CPAN?  Is there a more
 reliable way, besides looking and MIRRORED.BY?
 
   * Is testing by connecting to CPAN an appropriate thing to do?
 
 I would guess not. Certainly not without asking permission.

In the general case, having module tests make external network connections is
a bad idea

1: You are assuming that people will be building your module on a network
   connected computer. This is never 100% true.

2: Your module's tests can fail due to external factors beyond your control,
   such as people screwing up DNS, or having other outages. Random test
   failures tends to annoy your users, and will lead to bug reports.
   The annoyance is particularly great within organisations running full build
   tests overnight, because sooner rather than later the tests will fail.

Nicholas Clark


Re: Testing an FTP module

2006-04-03 Thread Smylers
Nicholas Clark writes:

 In the general case, having module tests make external network
 connections is a bad idea

There are distributions which offer these sorts of things as optional
tests, prompting for whether they should be run or skipped.  So long as
you default to skipping them this shouldn't mess things up in automated
environments.

Smylers


Testing an FTP module

2006-04-02 Thread Scott W Gifford
I just uploaded to CPAN some FTP-related modules
(Net::FTP::AutoReconnect and Net::FTP::RetrHandle).  In one of the
unit tests, I connect to ftp.cpan.org and retreive MIRRORED.BY to make
sure everything works OK.

Just in the last little bit, though, I've noticed that a connection to
ftp.cpan.org is timing out.

So my questions are:

  * Is ftp.cpan.org a reliable way to access CPAN?  Is there a more
reliable way, besides looking and MIRRORED.BY?

  * Is testing by connecting to CPAN an appropriate thing to do?

  * If not, what's a better way to do unit tests for a network
protocol?

Thanks for any thoughts!

---ScottG.


Re: Testing an FTP module

2006-04-02 Thread Terrence Brannon
You might look at my Net::FTP::Common... there are still some places with good FTP connections.On 4/2/06, Scott W Gifford 
[EMAIL PROTECTED] wrote:I just uploaded to CPAN some FTP-related modules(Net::FTP::AutoReconnect and Net::FTP::RetrHandle).In one of the
unit tests, I connect to ftp.cpan.org and retreive MIRRORED.BY to makesure everything works OK.Just in the last little bit, though, I've noticed that a connection to
ftp.cpan.org is timing out.So my questions are:* Is ftp.cpan.org a reliable way to access CPAN?Is there a morereliable way, besides looking and 
MIRRORED.BY?* Is testing by connecting to CPAN an appropriate thing to do?* If not, what's a better way to do unit tests for a networkprotocol?Thanks for any thoughts!
---ScottG.


Re: Testing an FTP module

2006-04-02 Thread Randy W. Sims

Scott W Gifford wrote:

I just uploaded to CPAN some FTP-related modules
(Net::FTP::AutoReconnect and Net::FTP::RetrHandle).  In one of the
unit tests, I connect to ftp.cpan.org and retreive MIRRORED.BY to make
sure everything works OK.

Just in the last little bit, though, I've noticed that a connection to
ftp.cpan.org is timing out.

So my questions are:

  * Is ftp.cpan.org a reliable way to access CPAN?  Is there a more
reliable way, besides looking and MIRRORED.BY?

  * Is testing by connecting to CPAN an appropriate thing to do?


I would guess not. Certainly not without asking permission.


  * If not, what's a better way to do unit tests for a network
protocol?


Write or bundle a tiny server, or query the user to provide an ftp server?


Thanks for any thoughts!

---ScottG.



Regards,
Randy.