Merge lp:~psivaa/qa-iso-static-validation-test/qa-iso-static-validation-test into lp:qa-iso-static-validation-test

Proposed by Para Siva
Status: Merged
Approved by: Para Siva
Approved revision: 18
Merged at revision: 18
Proposed branch: lp:~psivaa/qa-iso-static-validation-test/qa-iso-static-validation-test
Merge into: lp:qa-iso-static-validation-test
Diff against target: 48 lines (+16/-6)
1 file modified
iso_static_validation.py (+16/-6)
To merge this branch: bzr merge lp:~psivaa/qa-iso-static-validation-test/qa-iso-static-validation-test
Reviewer Review Type Date Requested Status
Paul Larson Approve
Para Siva Needs Resubmitting
Review via email: mp+124894@code.launchpad.net

Description of the change

Fixing the report.html file failures on server tests

To post a comment you must log in.
15. By Paul Larson

pep8 cleanup

Revision history for this message
Paul Larson (pwlars) wrote :

Interesting, do we know how the problems page gets generated? Are there ever situations where it shows up in reports.html but not in the problem page? I assumed that one pulled from the other, or at least used the same process to find these uninstallable packages.

+ fh_probs_page = urllib2.urlopen(self.probs_url).read()
What happens if this fails?

Revision history for this message
Para Siva (psivaa) wrote :

I was under the impression that both of them are generated independently. Please see below a reply from cjwatson about one of my queries about some entries in report.html.

"psivaa: yep. they're all listed on http://people.canonical.com/~ubuntu-archive/testing/quantal_probs.html, so it isn't an image build problem."

So this means there are occasions where the entries in report.html are not present in _probs.html and in that case it shows an image build issue. Hence needs reporting. But if the package is present on both reports we do not have to worry about them because the dev teams are aware of them

Re: not handling the exception for urlopen, I'll add it and resubmit.

Thanks

16. By Para Siva

report.html fix number 2 handling url open excetion

17. By Para Siva

Fixing known report.html file failures

Revision history for this message
Paul Larson (pwlars) wrote :

Good!

19 +
20 + self.probs_url = os.path.join(ARCHIVE_TEST_URL, self.st_release + '_probs.html')
21
22 + self.probs_url = os.path.join(ARCHIVE_TEST_URL, self.st_release + '_probs.html')
Duplicate line?

Some minor nitpicks:
41 + self.fail("Failed to fetch problems.html from the server")
You have an extra space after "from"

pep8 issues (easy cleanups, but since I just pushed a branch cleaning things like this, seems appropriate not to introduce more)
iso_static_validation.py:107:1: W293 blank line contains whitespace
iso_static_validation.py:108:80: E501 line too long (88 characters)
iso_static_validation.py:112:5: E301 expected 1 blank line, found 0
iso_static_validation.py:399:46: E231 missing whitespace after ','

For bonus points, it's a good habit to start coding things in a way that are python3 compliant. So things like exception handling should be, for example:
except urllib2.HTTPError as e:

If you'd like though, just fix the pep8 stuff and we can do the python3 compliance as another fix later on. It's not really a requirement right now, but would be a good idea considering the future direction of python.

review: Needs Fixing
18. By Para Siva

pep8 fixes for the report.html fix

Revision history for this message
Para Siva (psivaa) :
review: Needs Resubmitting
Revision history for this message
Paul Larson (pwlars) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'iso_static_validation.py'
--- iso_static_validation.py 2012-09-18 13:30:01 +0000
+++ iso_static_validation.py 2012-09-18 16:18:34 +0000
@@ -33,9 +33,8 @@
33import shutil33import shutil
3434
35# Defaults35# Defaults
36#DEFAULT_ISOROOT = os.path.expanduser(
37# '/var/lib/ubuntu-server-iso-testing/isos/ubuntu/')
38DEFAULT_URL = 'http://cdimage.ubuntu.com/'36DEFAULT_URL = 'http://cdimage.ubuntu.com/'
37ARCHIVE_TEST_URL = 'http://people.canonical.com/~ubuntu-archive/testing/'
3938
40#constants39#constants
41ONE_MB_BLOCK = 2 ** 2040ONE_MB_BLOCK = 2 ** 20
@@ -106,6 +105,9 @@
106 else:105 else:
107 self.fail("Image name be in the form of release-variant-arch.iso")106 self.fail("Image name be in the form of release-variant-arch.iso")
108107
108 self.probs_url = os.path.join(ARCHIVE_TEST_URL, self.st_release +
109 '_probs.html')
110
109 # Test if the sha check sum of the iso matches that is given in the server111 # Test if the sha check sum of the iso matches that is given in the server
110 def test_sha256_checksum(self):112 def test_sha256_checksum(self):
111 current_iso_digest = {}113 current_iso_digest = {}
@@ -382,11 +384,19 @@
382 logging.error("Failed to fetch URL '%s': %s .", report_url, e)384 logging.error("Failed to fetch URL '%s': %s .", report_url, e)
383 self.fail("Failed to fetch report.html from the server")385 self.fail("Failed to fetch report.html from the server")
384386
385 # check the number of failed packages387 uninst_pkgs = re.findall('"?([^" >]+ )produces uninstallable binaries',
386 report_page_lines = re.findall('there were ["]?([^" >]+)',
387 fh_report_page)388 fh_report_page)
388 logging.debug('Check for conflicting packages in the report file')389
389 self.assertEqual(['0'], report_page_lines)390 try:
391 fh_probs_page = urllib2.urlopen(self.probs_url).read()
392 except urllib2.HTTPError, e:
393 logging.error("Failed to fetch URL '%s': %s .", self.probs_url, e)
394 self.fail("Failed to fetch problems.html from the server")
395
396 # If a package is listed in report.html and not in problems page
397 # then it's a concern and needs attention
398 for uninst_pkg in uninst_pkgs:
399 self.assertIn(uninst_pkg.rstrip(), fh_probs_page)
390400
391 # Test if the size of the image fits a 700MB disc401 # Test if the size of the image fits a 700MB disc
392 def test_size(self):402 def test_size(self):

Subscribers

People subscribed via source and target branches

to all changes: