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
1=== modified file 'iso_static_validation.py'
2--- iso_static_validation.py 2012-09-18 13:30:01 +0000
3+++ iso_static_validation.py 2012-09-18 16:18:34 +0000
4@@ -33,9 +33,8 @@
5 import shutil
6
7 # Defaults
8-#DEFAULT_ISOROOT = os.path.expanduser(
9-# '/var/lib/ubuntu-server-iso-testing/isos/ubuntu/')
10 DEFAULT_URL = 'http://cdimage.ubuntu.com/'
11+ARCHIVE_TEST_URL = 'http://people.canonical.com/~ubuntu-archive/testing/'
12
13 #constants
14 ONE_MB_BLOCK = 2 ** 20
15@@ -106,6 +105,9 @@
16 else:
17 self.fail("Image name be in the form of release-variant-arch.iso")
18
19+ self.probs_url = os.path.join(ARCHIVE_TEST_URL, self.st_release +
20+ '_probs.html')
21+
22 # Test if the sha check sum of the iso matches that is given in the server
23 def test_sha256_checksum(self):
24 current_iso_digest = {}
25@@ -382,11 +384,19 @@
26 logging.error("Failed to fetch URL '%s': %s .", report_url, e)
27 self.fail("Failed to fetch report.html from the server")
28
29- # check the number of failed packages
30- report_page_lines = re.findall('there were ["]?([^" >]+)',
31+ uninst_pkgs = re.findall('"?([^" >]+ )produces uninstallable binaries',
32 fh_report_page)
33- logging.debug('Check for conflicting packages in the report file')
34- self.assertEqual(['0'], report_page_lines)
35+
36+ try:
37+ fh_probs_page = urllib2.urlopen(self.probs_url).read()
38+ except urllib2.HTTPError, e:
39+ logging.error("Failed to fetch URL '%s': %s .", self.probs_url, e)
40+ self.fail("Failed to fetch problems.html from the server")
41+
42+ # If a package is listed in report.html and not in problems page
43+ # then it's a concern and needs attention
44+ for uninst_pkg in uninst_pkgs:
45+ self.assertIn(uninst_pkg.rstrip(), fh_probs_page)
46
47 # Test if the size of the image fits a 700MB disc
48 def test_size(self):

Subscribers

People subscribed via source and target branches

to all changes: