Bug #19030 [Opn->Csd]: running test suite modifies data/IS_postcodes.txt (for PEAR QA team)
| From: | daniel dot oconnor at gmail dot com | Date: | Sun, 25 Mar 2012 14:17:48 +0000 |
| Subject: | Bug #19030 [Opn->Csd]: running test suite modifies data/IS_postcodes.txt (for PEAR QA team) | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-8437@lists.php.net to get a copy of this message | ||
Edit report at https://pear.php.net/bugs/bug.php?id=19030&edit=1
ID: 19030
Updated by: daniel.oconnor@gmail.com
Reported By: danielc at analysisandsolutions dot com
Summary: running test suite modifies data/IS_postcodes.txt
(for PEAR QA team)
-Status: Open
+Status: Closed
Type: Bug
Package: Validate_IS
PHP Version: 5.4.0alpha1
-Assigned To:
+Assigned To: doconnor
Roadmap Versions:
New Comment:
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: doconnor
This bug has been fixed in SVN.
If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).
If this was a problem with the pear.php.net website, the change should
be live shortly.
Otherwise, the fix will appear in the package's next release.
Thank you for the report and for helping us make PEAR better.
Previous Comments:
------------------------------------------------------------------------
[2011-12-10 16:32:01] danielc
How about having the "strong" test write to a temporary file?
------------------------------------------------------------------------
[2011-12-10 16:28:14] bjori
Well.. how would you update the test to test the strong method without
doing the on-
the-fly update?
I do agree that a unittest shouldn't modify data files, but the whole
point with that
argument is to do live check and update the dataset.
------------------------------------------------------------------------
[2011-12-10 15:09:10] danielc
-Status: Feedback
+Status: Open
------------------------------------------------------------------------
[2011-12-10 15:08:43] danielc
The data is in there from the move to GitHub. But that's not the
problem.
Tthe postalCode() method has the capability to retrieve live data from
the Icelandic postal service's website. The "Test postalCode strong"
section of validate_IS.phpt uses that functionality and writing the
output to data/IS_postcodes.txt. Having the test suite modifying the
data feels very wrong to me.
First, it prevents non-root users from running the test suite on the
installed package because they won't have write privileges on the data
directory.
Second, changing the file can cause the test suite to think everything
is okay because it's giving the data it wants to find. And since the
test passes, there is no indication that the original data file needs to
be committed and put into a release for public consumption.
------------------------------------------------------------------------
[2011-12-10 13:32:20] doconnor
-Status: Open
+Status: Feedback
Thank you for taking the time to report a problem with the package.
This problem may have been already fixed by a previous change that
is in the SVN of the package. Please checking out the SVN
repository of this package and upgrade
svn checkout svn.php.net/repository/pear/packages/Validate_IS/trunk
pear upgrade package2.xml
or
pear upgrade package.xml
If you are able to reproduce the bug with the latest SVN,
please change the status back to "Open".
Again, thank you for your continued support of PEAR.
Uhm...
https://github.com/pear/Validate_IS/blob/master/data/IS_postcodes.txt#L136
looks like it's already here?
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=19030
--
Edit this bug report at https://pear.php.net/bugs/bug.php?id=19030&edit=1