~launchpad-pqm/launchpad/devel

2168 by Canonical.com Patch Queue Manager
[r=BjornT] More gina improvements.
1
Gina Test
2
---------
3
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
4
This file is a simple test for gina. It uses a test archive (kept in
8294.6.8 by Julian Edwards
Section and component are now moved, and gina imports fixed.
5
lp.soyuz.scripts.tests.archive_for_gina) and runs gina in
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
6
quiet mode over it.
7
1716.1.230 by Christian Reis
Fix the binary package and build verification queries to be unique in a distribution and archtag. Ensure a build does not hold two packages with the same name. Cleanups to the testcase.
8
Get the current counts of stuff in the database:
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
9
14538.1.2 by Curtis Hovey
Moved account and email address to lp.services.identity.
10
    >>> from lp.services.identity.model.emailaddress import EmailAddress
13850.2.22 by Jeroen Vermeulen
Doctest still thought Gina produces Pending pubs.
11
    >>> from lp.soyuz.interfaces.publishing import active_publishing_status
11869.8.3 by Jonathan Lange
Fix failing imports from most of the tests. Also clean up flakes.
12
    >>> from lp.soyuz.model.publishing import (
7659.7.1 by Julian Edwards
Remove secure publishing records.
13
    ...     BinaryPackagePublishingHistory,
11869.8.3 by Jonathan Lange
Fix failing imports from most of the tests. Also clean up flakes.
14
    ...     SourcePackagePublishingHistory)
8971.22.2 by Guilherme Salgado
Fix a bunch of tests to import registry model classes from lp.registry.model instead of from canonical.launchpad.database
15
    >>> from lp.registry.model.person import Person, WikiName
8971.22.5 by Guilherme Salgado
Fix a couple more tests
16
    >>> from lp.registry.model.teammembership import TeamParticipation
9113.7.7 by Jonathan Lange
Update all the rest of the imports of PackagePublishingPocket.
17
    >>> from lp.registry.interfaces.pocket import (
5821.5.36 by James Henstridge
* Fix doc/gina.txt test.
18
    ...     PackagePublishingPocket)
11869.8.3 by Jonathan Lange
Fix failing imports from most of the tests. Also clean up flakes.
19
    >>> from lp.soyuz.model.binarypackagebuild import BinaryPackageBuild
20
    >>> from lp.soyuz.model.binarypackagerelease import BinaryPackageRelease
21
    >>> from lp.soyuz.model.sourcepackagerelease import SourcePackageRelease
7659.7.1 by Julian Edwards
Remove secure publishing records.
22
    >>> SSPPH = SourcePackagePublishingHistory
23
    >>> SBPPH = BinaryPackagePublishingHistory
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
24
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
25
    >>> orig_spr_count = SourcePackageRelease.select().count()
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
26
    >>> orig_sspph_count = SSPPH.select().count()
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
27
    >>> orig_person_count = Person.select().count()
28
    >>> orig_tp_count = TeamParticipation.select().count()
29
    >>> orig_email_count = EmailAddress.select().count()
30
    >>> orig_wiki_count = WikiName.select().count()
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
31
    >>> orig_bpr_count = BinaryPackageRelease.select().count()
10667.2.9 by Michael Nelson
Fixed failing tests.
32
    >>> orig_build_count = BinaryPackageBuild.select().count()
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
33
    >>> orig_sbpph_count = SBPPH.select().count()
5821.10.4 by Celso Providelo
fixing gina tests.
34
    >>> orig_sspph_main_count = SSPPH.selectBy(
35
    ...     componentID=1, pocket=PackagePublishingPocket.RELEASE).count()
2168 by Canonical.com Patch Queue Manager
[r=BjornT] More gina improvements.
36
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
37
Create a distribution release and an arch release for breezy:
38
11869.8.3 by Jonathan Lange
Fix failing imports from most of the tests. Also clean up flakes.
39
    >>> from lp.soyuz.model.distroarchseries import DistroArchSeries
40
    >>> from lp.soyuz.model.processor import ProcessorFamily
13130.1.6 by Curtis Hovey
Move ILaunchpadCelebrity to lp.app.
41
    >>> from lp.app.interfaces.launchpad import ILaunchpadCelebrities
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
42
    >>> celebs = getUtility(ILaunchpadCelebrities)
43
    >>> ubuntu = celebs.ubuntu
5821.10.4 by Celso Providelo
fixing gina tests.
44
    >>> hoary = ubuntu.getSeries("hoary")
6974.1.10 by Edwin Grubbs
Fixed tests.
45
46
    # Only the distro owner and admins can create a new series.
7778.5.2 by Guilherme Salgado
Fix a few tests that were attempting to login as a team.
47
    >>> login_person(ubuntu.owner.activemembers[0])
6974.1.10 by Edwin Grubbs
Fixed tests.
48
    >>> breezy = ubuntu.newSeries(
49
    ...     "breezy", "Breezy Badger", "My title",
6527.11.9 by Celso Providelo
applying review comments, r=sinzui.
50
    ...     "My summary", "My description", "5.10",
51
    ...     hoary, celebs.launchpad_developers)
6974.1.10 by Edwin Grubbs
Fixed tests.
52
    >>> login(ANONYMOUS)
53
12652.1.1 by Steve Kowalik
Allow gina to query and add DSDJs, and test that in her horrid doctest.
54
    # Enable the Derived Series feature flag, to make sure gina likes it.
55
    >>> from lp.services.features.testing import FeatureFixture
56
    >>> from lp.soyuz.model.distroseriesdifferencejob import (
57
    ...     FEATURE_FLAG_ENABLE_MODULE,
58
    ...     )
59
    >>> fixture = FeatureFixture({FEATURE_FLAG_ENABLE_MODULE: u'on'})
60
    >>> fixture.setUp()
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
61
    >>> pf = ProcessorFamily.selectOneBy(name="x86")
4285.2.1 by Mark Shuttleworth
Massive renaming of distrorelease to distroseries
62
    >>> breezy_i386 = DistroArchSeries(distroseries=breezy,
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
63
    ...                         processorfamily=pf,
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
64
    ...                         architecturetag="i386", official=True,
65
    ...                         owner=celebs.launchpad_developers)
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
66
    >>> import transaction
67
    >>> transaction.commit()
68
1716.1.230 by Christian Reis
Fix the binary package and build verification queries to be unique in a distribution and archtag. Ensure a build does not hold two packages with the same name. Cleanups to the testcase.
69
Now, lets run gina on hoary and breezy. This test imports a few
70
packages successfully (at least partially):
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
71
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
72
   * archive-copier, a source package which generates one udeb
73
     in debian-installer. Its maintainer has a name which contains a ","
10512.5.1 by Steve Kowalik
Brutally hack gina to process multiple sources of the same name.
74
   * archive-copier, again, with a different version number to see that
75
     both versions get correctly imported.
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
76
   * db1-compat, source package what generates 1 binary package. The same
1716.2.1 by Christian Reis
Add a backports pocket and add a staging target for it for hoary, with test. Change the publishing done in Gina to use the data that was read from the tagfile, not what was in the source package release; this caused, for instance, unchanged packages that moved between sections in different releases to always be published in the initial section. Solves this for section and component as well. The constructors in the *PackageData classes now guarantees that these are set during the constructor phase, since the rest of the lifecycle is truncated when doing a preimport*check.
77
     version was included in both hoary and breezy, but its source
78
     package's section and its binary package's priority were changed in
79
     breezy.
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
80
   * gcc-defaults, a source package that generates 8 binary packages with
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
81
     differing versions.
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
82
   * x11proto-damage, a package which is only present in breezy
83
   * libcap, a source package which generates 3 binary packages, and
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
84
     whose version number contains an epoch. It is not in the Breezy
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
85
     Sources list, but some binaries are in the Packages file. However, these
86
     binaries are unchaged in Breezy.
87
   * ubuntu-meta, a source package that generates 3 binary packages in
6527.11.8 by Celso Providelo
fixing linting problems.
88
     Hoary and 5 in breezy. However, its breezy version is /not/ listed in the
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
89
     Sources list, so the binary packages will need to discover it.
90
   * ed, a source package what generates one binary package and
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
91
     misses a section entry in Sources. The same version exists in
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
92
     breezy, this time with a defined section. Its hoary binary package
93
     lacks a Priority.
1716.1.230 by Christian Reis
Fix the binary package and build verification queries to be unique in a distribution and archtag. Ensure a build does not hold two packages with the same name. Cleanups to the testcase.
94
   * python-sqllite, an arch-independent source package that generates
95
     one binary package. Its breezy packages are missing from the archive.
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
96
   * python-pam, an arch-independent source package that generates one
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
97
     binary package, whose changelog contains a busted urgency. Its hoary
1716.1.230 by Christian Reis
Fix the binary package and build verification queries to be unique in a distribution and archtag. Ensure a build does not hold two packages with the same name. Cleanups to the testcase.
98
     binary package contains lacks a Section. Its breezy packages are missing
99
     from the archive.
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
100
   * mkvmlinuz, a source package that generates one binary package,
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
101
     but which is missing a version field in its Sources file.
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
102
     Its breezy package has a version but is missing copyright and changelog.
1716.1.240 by Christian Reis
Fix an embarrassing issue when parsing changelogs of files whose names started with a number, add XXX and update test
103
   * 3dchess, a source package that generates a binary package.
1716.1.241 by Christian Reis
Add support for locating license files that are prefixed with the binary package name (and add a package to test the feature with). Clean up changelog handling of package and version. Deal with the fact that selectOne* can raise an exception when encountering database corruption. Explicitly set SourcePackageRelease.format, and reorder the SPR attributes to check we are indeed sending in everything we should. Added a test for an invalid version. Refactor dsc and license handling so we don't do any more than we should in each of the calls to read_*.
104
   * 9wm, a source package that generates a binary package, and whose
105
     changelog file name starts with the binary package name.
1716.1.242 by Christian Reis
Adding a test for shlibs parsing. Also simplifies the code in handlers slightly (no real change). Adding some XXXs where I've discovered them
106
   * rioutil, a source package that generates a binary package, and
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
107
     whose source contains a shlibs file. Its current binary package is
108
     actually an evil bin-only-NMU!
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
109
1716.2.14 by Christian Reis
Cope better with source packages whose DSC refers to files not in the pool
110
And two completely broken packages:
1716.1.230 by Christian Reis
Fix the binary package and build verification queries to be unique in a distribution and archtag. Ensure a build does not hold two packages with the same name. Cleanups to the testcase.
111
112
   * util-linux, a source package that is missing from the pool. It
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
113
     generates 4 binary packages, all missing. It's correctly listed in
114
     Sources and Packages, though.
1716.1.230 by Christian Reis
Fix the binary package and build verification queries to be unique in a distribution and archtag. Ensure a build does not hold two packages with the same name. Cleanups to the testcase.
115
1716.2.14 by Christian Reis
Cope better with source packages whose DSC refers to files not in the pool
116
   * clearlooks, a source package with no binaries listed, and which has
117
     a DSC file that refers to an inexistant tar.gz.
118
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
119
Let's set up the filesystem:
120
121
    >>> import subprocess, sys, os
122
    >>> try:
123
    ...     os.unlink("/var/lock/launchpad-gina.lock")
124
    ... except OSError:
125
    ...     pass
126
    >>> try:
127
    ...     os.remove('/tmp/gina_test_archive')
128
    ... except OSError:
129
    ...     pass
8294.6.5 by Julian Edwards
Fix a bunch of circular imports, but there's still one I can't find.
130
    >>> relative_path = ('lib/lp/soyuz/scripts/tests/gina_test_archive')
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
131
    >>> path = os.path.join(os.getcwd(), relative_path)
132
    >>> os.symlink(path, '/tmp/gina_test_archive')
133
134
And give her a spin:
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
135
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
136
    >>> gina_proc = [sys.executable, 'scripts/gina.py', '-q',
137
    ...              'hoary', 'breezy']
2168 by Canonical.com Patch Queue Manager
[r=BjornT] More gina improvements.
138
    >>> proc = subprocess.Popen(gina_proc, stderr=subprocess.PIPE)
139
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
140
Check STDERR for the errors we expected:
141
2168 by Canonical.com Patch Queue Manager
[r=BjornT] More gina improvements.
142
    >>> print proc.stderr.read()
1716.2.14 by Christian Reis
Cope better with source packages whose DSC refers to files not in the pool
143
    ERROR   Error processing package files for clearlooks
11680.5.8 by Jelmer Vernooij
Fix soyuz tests.
144
     -> http://...Error 2 unpacking source)
1716.1.234 by Christian Reis
Add fixes for three issues: MissingRequiredAttributes was failing a check, coping with absent Format correctly, and dealing with a null ChangeLog in different situations.
145
    WARNING Invalid format in db1-compat, assumed '1.0'
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
146
    WARNING Source package ed lacks section, assumed 'misc'
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
147
    ERROR   Unable to create SourcePackageData for mkvmlinuz
148
     -> http://...version: None)
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
149
    WARNING Invalid urgency in python-pam, None, assumed 'low'
150
    ERROR   Error processing package files for util-linux
1716.1.239 by Christian Reis
Really fix get_dsc_path to properly grok archive paths (and sanitize callsites and a certain place where we were generating a filename without the string pool attached to it). Remove PackageFileProcessError, which was dead anyway, and update for it. Rename anything that was an archive_root to the right term. All tests now pass
151
     -> http://...dsc not in archive)
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
152
    ERROR   Error processing package files for bsdutils
153
     -> http://...deb not found)
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
154
    WARNING Binary package ed lacks valid priority, assumed 'extra'
1716.1.241 by Christian Reis
Add support for locating license files that are prefixed with the binary package name (and add a package to test the feature with). Clean up changelog handling of package and version. Deal with the fact that selectOne* can raise an exception when encountering database corruption. Explicitly set SourcePackageRelease.format, and reorder the SPR attributes to check we are indeed sending in everything we should. Added a test for an invalid version. Refactor dsc and license handling so we don't do any more than we should in each of the calls to read_*.
155
    ERROR   Unable to create BinaryPackageData for mount
156
     -> http://...invalid version...)
1716.1.239 by Christian Reis
Really fix get_dsc_path to properly grok archive paths (and sanitize callsites and a certain place where we were generating a filename without the string pool attached to it). Remove PackageFileProcessError, which was dead anyway, and update for it. Rename anything that was an archive_root to the right term. All tests now pass
157
    WARNING Binary package python-pam lacks a section, assumed 'misc'
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
158
    ERROR   Error processing package files for python2.4-pam
159
     -> http://...deb not found)
160
    ERROR   Error processing package files for python2.4-sqlite
161
     -> http://...deb not found)
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
162
    WARNING No source package rioutil (1.4.4-1.0.1) listed for rioutil (1.4.4-1.0.1), scrubbing archive...
163
    WARNING Nope, couldn't find it. Could it be a bin-only-NMU? Checking...
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
164
    ERROR   Error processing package files for util-linux
165
     -> http://...deb not found)
1716.1.234 by Christian Reis
Add fixes for three issues: MissingRequiredAttributes was failing a check, coping with absent Format correctly, and dealing with a null ChangeLog in different situations.
166
    ERROR   Unable to create BinaryPackageData for util-linux-locales
167
     -> http://...installed_size'])
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
168
    ERROR   Invalid Sources stanza in /tmp/tmp...
169
     -> http://...bogus\n')
170
    WARNING No changelog file found for mkvmlinuz in mkvmlinuz-14ubuntu1
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
171
    WARNING No copyright file found for mkvmlinuz in mkvmlinuz-14ubuntu1
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
172
    WARNING Invalid urgency in mkvmlinuz, None, assumed 'low'
173
    ERROR   Error processing package files for python-sqlite
1716.1.239 by Christian Reis
Really fix get_dsc_path to properly grok archive paths (and sanitize callsites and a certain place where we were generating a filename without the string pool attached to it). Remove PackageFileProcessError, which was dead anyway, and update for it. Rename anything that was an archive_root to the right term. All tests now pass
174
     -> http://...dsc not in archive)
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
175
    ERROR   Error processing package files for util-linux
1716.1.239 by Christian Reis
Really fix get_dsc_path to properly grok archive paths (and sanitize callsites and a certain place where we were generating a filename without the string pool attached to it). Remove PackageFileProcessError, which was dead anyway, and update for it. Rename anything that was an archive_root to the right term. All tests now pass
176
     -> http://...dsc not in archive)
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
177
    ERROR   Error processing package files for python-sqlite
178
     -> http://...deb not found)
1716.1.245 by Christian Reis
Add a test for the situation where we're importing a binary package that depends on a source package that is not in the Sources file but /is/ present in the archive, and warn about when this happens. Handle it properly by remembering which component we found that file in
179
    WARNING No source package ubuntu-meta (0.80) listed for ubuntu-base (0.80), scrubbing archive...
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
180
    <BLANKLINE>
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
181
182
The exit status must be 0, for success:
183
2168 by Canonical.com Patch Queue Manager
[r=BjornT] More gina improvements.
184
    >>> proc.wait()
185
    0
3024.1.11 by Christian Reis
Add support to Gina for doing publisher overrides when it encounters newer indices with updated information, corresponding to a post-initial-publication change in the archive (such as changing components)
186
    >>> transaction.commit()
12652.1.1 by Steve Kowalik
Allow gina to query and add DSDJs, and test that in her horrid doctest.
187
    >>> fixture.cleanUp()
2168 by Canonical.com Patch Queue Manager
[r=BjornT] More gina improvements.
188
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
189
190
Testing Source Package Results
191
..............................
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
192
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
193
We should have more source packages in the database:
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
194
1716.1.221 by Christian Reis
Merge from RF (4 conflicts on the moving of trees)
195
    >>> existing = 9
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
196
    >>> hc = 13 - 2   # 2 packages fail
197
    >>> bc = 9 - 3 - 2 + 1  # 3 packages are the same as in hoary, 2 fail,
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
198
    ... #one that is imported forcefully (ubuntu-meta)
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
199
    >>> hc + bc
1716.1.242 by Christian Reis
Adding a test for shlibs parsing. Also simplifies the code in handlers slightly (no real change). Adding some XXXs where I've discovered them
200
    16
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
201
    >>> count = SourcePackageRelease.select().count()
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
202
    >>> count - orig_spr_count
7675.432.1 by William Grant
Make gina use determine_source_file_type, and verify that it imports 3.0 (quilt) sources.
203
    17
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
204
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
205
Check that x11proto-damage has its Build-Depends-Indep value correctly set:
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
206
8971.22.2 by Guilherme Salgado
Fix a bunch of tests to import registry model classes from lp.registry.model instead of from canonical.launchpad.database
207
    >>> from lp.registry.model.sourcepackagename import SourcePackageName
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
208
    >>> n = SourcePackageName.selectOneBy(name="x11proto-damage")
209
    >>> x11p = SourcePackageRelease.selectOneBy(sourcepackagenameID=n.id,
210
    ...                                         version="6.8.99.7-2")
4456.5.5 by Celso Providelo
Fixing gina to insert SPR.copyright.
211
1716.1.230 by Christian Reis
Fix the binary package and build verification queries to be unique in a distribution and archtag. Ensure a build does not hold two packages with the same name. Cleanups to the testcase.
212
    >>> print x11p.builddependsindep
213
    debhelper (>= 4.0.0)
4456.5.5 by Celso Providelo
Fixing gina to insert SPR.copyright.
214
215
Check if the changelog message was stored correcly:
216
13555.3.1 by Julian Edwards
When a doctest is checking output format, it really needs a
217
    >>> print x11p.changelog_entry #doctest: -NORMALIZE_WHITESPACE
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
218
    x11proto-damage (6.8.99.7-2) breezy; urgency=low
219
    <BLANKLINE>
220
    <BLANKLINE>
221
      * Add dependency on x11proto-fixes-dev.
222
    <BLANKLINE>
223
     -- Daniel Stone <daniel.stone@ubuntu.com>  Mon, 11 Jul 2005 19:11:11 +1000
4456.5.5 by Celso Providelo
Fixing gina to insert SPR.copyright.
224
11692.6.2 by Curtis Hovey
Use deglober to fixing simple glob imports in doctests.
225
    >>> from lp.registry.interfaces.sourcepackage import SourcePackageUrgency
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
226
    >>> x11p.urgency == SourcePackageUrgency.LOW
227
    True
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
228
11956.1.1 by Steve Kowalik
Set the full changelog in the SourcePackageData object, and move the existing
229
Check that the changelog was uploaded to the librarian correctly:
230
11956.1.2 by Steve Kowalik
Compare the text of the changelog, rather than the sha1
231
    >>> print x11p.changelog.read()
232
    x11proto-damage (6.8.99.7-2) breezy; urgency=low
233
    <BLANKLINE>
234
      * Add dependency on x11proto-fixes-dev.
235
    <BLANKLINE>
236
     -- Daniel Stone <daniel.stone@ubuntu.com>  Mon, 11 Jul 2005 19:11:11 +1000
237
    <BLANKLINE>
238
    x11proto-damage (6.8.99.7-1) breezy; urgency=low
239
    <BLANKLINE>
240
      * First x11proto-damage release.
241
    <BLANKLINE>
242
     -- Daniel Stone <daniel.stone@ubuntu.com>  Mon, 16 May 2005 22:10:17 +1000
11956.1.1 by Steve Kowalik
Set the full changelog in the SourcePackageData object, and move the existing
243
4456.5.5 by Celso Providelo
Fixing gina to insert SPR.copyright.
244
Same for the copyright:
245
246
    >>> print x11p.copyright
247
    $Id: COPYING,v 1.2 2003/11/05 05:39:58 keithp Exp $
248
    <BLANKLINE>
249
    Copyright ... 2003 Keith Packard
250
    ...
251
    PERFORMANCE OF THIS SOFTWARE.
252
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
253
Check that the dsc on the libcap package is correct, and that we
254
only imported one:
255
256
    >>> n = SourcePackageName.selectOneBy(name="libcap")
257
    >>> cap = SourcePackageRelease.selectOneBy(sourcepackagenameID=n.id)
258
    >>> print cap.dsc
259
    -----BEGIN PGP SIGNED MESSAGE-----
260
    Hash: SHA1
261
    <BLANKLINE>
262
    Format: 1.0
263
    Source: libcap
264
    Version: 1:1.10-14
265
    Binary: libcap-dev, libcap-bin, libcap1
266
    Maintainer: Michael Vogt <mvo@debian.org>
267
    Architecture: any
268
    Standards-Version: 3.6.1
269
    Build-Depends: debhelper
270
    Files:
271
     291be97b78789f331499a0ab22d9d563 28495 libcap_1.10.orig.tar.gz
272
     b867a0c1db9e8ff568415bbcd1fa65dc 12928 libcap_1.10-14.diff.gz
273
    <BLANKLINE>
274
    -----BEGIN PGP SIGNATURE-----
275
    Version: GnuPG v1.2.4 (GNU/Linux)
276
    <BLANKLINE>
277
    iD8DBQFAfGV8liSD4VZixzQRAlHoAJ4hD8yDp/VIJUcdQLLr9KH/XQSczQCfQH/D
278
    FVJMGmGr+2YLZfF+oRUKcug=
279
    =bw+A
280
    -----END PGP SIGNATURE-----
1716.1.229 by Christian Reis
Move encoding of person's displayname into packages. Add tests for version numbers for gcc-defaults, clean up code slightly. What remains: validating ensureBuild and _getBinary, and testing with multiple components, pockets and architectures
281
    >>> print cap.maintainer.displayname
282
    Michael Vogt
283
284
Test ubuntu-meta in breezy, which was forcefully imported.
285
286
    >>> n = SourcePackageName.selectOneBy(name="ubuntu-meta")
287
    >>> um = SourcePackageRelease.selectOneBy(sourcepackagenameID=n.id,
288
    ...         version="0.80")
289
    >>> print um.section.name, um.architecturehintlist, \
5121.2.15 by Stuart Bishop
uploaddistroseries -> upload_distroseries
290
    ...         um.upload_distroseries.name
1716.1.229 by Christian Reis
Move encoding of person's displayname into packages. Add tests for version numbers for gcc-defaults, clean up code slightly. What remains: validating ensureBuild and _getBinary, and testing with multiple components, pockets and architectures
291
    base any breezy
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
292
293
And check that its files actually ended up in the librarian (these sha1sums
294
were calculated directly on the files):
295
11869.8.3 by Jonathan Lange
Fix failing imports from most of the tests. Also clean up flakes.
296
    >>> from lp.soyuz.model.files import SourcePackageReleaseFile
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
297
    >>> files = SourcePackageReleaseFile.selectBy(
298
    ...     sourcepackagereleaseID=cap.id, orderBy="libraryfile")
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
299
    >>> for f in files:
300
    ...     print f.libraryfile.content.sha1
301
    107d5478e72385f714523bad5359efedb5dcc8b2
302
    0083da007d44c02fd861c1d21579f716490cab02
303
    e6661aec051ccb201061839d275f2282968d8b93
304
305
Check that the section on the python-pam package is correct, and that we
306
only imported one:
307
308
    >>> n = SourcePackageName.selectOneBy(name="python-pam")
309
    >>> pp = SourcePackageRelease.selectOneBy(sourcepackagenameID=n.id)
310
    >>> print pp.component.name
311
    main
312
313
In the hoary Sources, its section is listed as underworld/python. Ensure
314
this is cut up correctly:
315
316
    >>> print pp.section.name
317
    python
318
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
319
Make sure that we only imported one db1-compat source package.
320
321
    >>> n = SourcePackageName.selectOneBy(name="db1-compat")
322
    >>> db1 = SourcePackageRelease.selectOneBy(sourcepackagenameID=n.id)
1716.2.1 by Christian Reis
Add a backports pocket and add a staging target for it for hoary, with test. Change the publishing done in Gina to use the data that was read from the tagfile, not what was in the source package release; this caused, for instance, unchanged packages that moved between sections in different releases to always be published in the initial section. Solves this for section and component as well. The constructors in the *PackageData classes now guarantees that these are set during the constructor phase, since the rest of the lifecycle is truncated when doing a preimport*check.
323
    >>> print db1.section.name
324
    libs
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
325
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
326
327
Testing Source Package Publishing
328
.................................
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
329
1716.2.1 by Christian Reis
Add a backports pocket and add a staging target for it for hoary, with test. Change the publishing done in Gina to use the data that was read from the tagfile, not what was in the source package release; this caused, for instance, unchanged packages that moved between sections in different releases to always be published in the initial section. Solves this for section and component as well. The constructors in the *PackageData classes now guarantees that these are set during the constructor phase, since the rest of the lifecycle is truncated when doing a preimport*check.
330
We check that the source package publishing override facility works:
331
1716.2.15 by Christian Reis
Be less braindead about binary package publishing. We were only creating
332
    >>> for pub in SSPPH.selectBy(
5121.2.8 by Stuart Bishop
Renaming in doctests
333
    ...     sourcepackagereleaseID=db1.id, orderBy='distroseries'):
4753.4.7 by Julian Edwards
Apply jamesh review comments
334
    ...     print "%s %s %s" % (
335
    ...         pub.distroseries.name, pub.section.name,
336
    ...         pub.archive.purpose.name)
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
337
    hoary libs PRIMARY
338
    breezy oldlibs PRIMARY
1716.2.1 by Christian Reis
Add a backports pocket and add a staging target for it for hoary, with test. Change the publishing done in Gina to use the data that was read from the tagfile, not what was in the source package release; this caused, for instance, unchanged packages that moved between sections in different releases to always be published in the initial section. Solves this for section and component as well. The constructors in the *PackageData classes now guarantees that these are set during the constructor phase, since the rest of the lifecycle is truncated when doing a preimport*check.
339
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
340
We should have one entry for each package listed in Sources that was
341
successfully processed.
342
343
    - We had 2 errors (out of 10 Sources stanzas) in hoary: mkvmlinuz and
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
344
      util-linux.
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
345
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
346
    - We had 2 errors (out of 10 Sources stanzas) in breezy: python-sqllite
347
      and util-linux (again, poor thing).
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
348
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
349
    >>> print SSPPH.select().count() - orig_sspph_count
10512.5.1 by Steve Kowalik
Brutally hack gina to process multiple sources of the same name.
350
    21
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
351
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
352
    >>> new_count = SSPPH.selectBy(
5821.5.36 by James Henstridge
* Fix doc/gina.txt test.
353
    ...     componentID=1,
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
354
    ...     pocket=PackagePublishingPocket.RELEASE).count()
355
    >>> print new_count - orig_sspph_main_count
10512.5.1 by Steve Kowalik
Brutally hack gina to process multiple sources of the same name.
356
    21
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
357
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
358
359
Testing Binary Package Results
360
..............................
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
361
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
362
We have 26 binary packages in hoary. The 4 packages for util-linux fail, and 1
363
package fails for each of python-sqlite and python-pam. We should publish one
364
entry for each package listed in Releases.
365
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
366
We have 23 binary packages in breezy. db1-compat, ed, the 3 libcap packages
367
and python-pam is unchanged.  python-sqlite fails. The 5 ubuntu-meta packages
368
work.
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
369
370
    >>> BinaryPackageRelease.select().count() - orig_bpr_count
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
371
    40
10667.2.9 by Michael Nelson
Fixed failing tests.
372
    >>> BinaryPackageBuild.select().count() - orig_build_count
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
373
    13
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
374
    >>> SBPPH.select().count() - orig_sbpph_count
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
375
    46
1716.1.242 by Christian Reis
Adding a test for shlibs parsing. Also simplifies the code in handlers slightly (no real change). Adding some XXXs where I've discovered them
376
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
377
Check that the shlibs parsing and bin-only-NMU version handling works as
378
expected:
1716.1.242 by Christian Reis
Adding a test for shlibs parsing. Also simplifies the code in handlers slightly (no real change). Adding some XXXs where I've discovered them
379
11869.8.3 by Jonathan Lange
Fix failing imports from most of the tests. Also clean up flakes.
380
    >>> from lp.soyuz.model.binarypackagename import BinaryPackageName
1716.1.242 by Christian Reis
Adding a test for shlibs parsing. Also simplifies the code in handlers slightly (no real change). Adding some XXXs where I've discovered them
381
    >>> n = BinaryPackageName.selectOneBy(name="rioutil")
382
    >>> rio = BinaryPackageRelease.selectOneBy(binarypackagenameID=n.id)
383
    >>> print rio.shlibdeps
384
    librioutil 1 rioutil
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
385
    >>> print rio.version
386
    1.4.4-1.0.1
7675.687.99 by Michael Nelson
gina.txt
387
    >>> print rio.build.source_package_release.version
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
388
    1.4.4-1
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
389
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
390
Test all the data got to the ed BPR intact, and that the missing
391
priority was correctly munged to "extra":
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
392
393
    >>> n = BinaryPackageName.selectOneBy(name="ed")
394
    >>> ed = BinaryPackageRelease.selectOneBy(binarypackagenameID=n.id)
395
    >>> print ed.version
396
    0.2-20
397
    >>> print ed.build.processor.name
398
    386
7675.687.99 by Michael Nelson
gina.txt
399
    >>> print ed.build.status
10699.2.1 by Aaron Bentley
Revert BuildStatus titles
400
    Successfully built
7675.687.99 by Michael Nelson
gina.txt
401
    >>> print ed.build.distro_arch_series.processorfamily.name
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
402
    x86
7675.687.99 by Michael Nelson
gina.txt
403
    >>> print ed.build.distro_arch_series.architecturetag
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
404
    i386
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
405
    >>> print ed.priority
3864.2.14 by Tim Penhey
Fixing broken tests or ensuring use of quote or sqlvalues.
406
    Extra
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
407
    >>> print ed.section.name
408
    editors
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
409
    >>> print ed.summary
410
    The classic unix line editor.
411
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
412
We now check if the Breezy publication record has the correct priority:
413
414
    >>> ed_pub = SBPPH.selectOneBy(binarypackagereleaseID=ed.id,
4285.2.1 by Mark Shuttleworth
Massive renaming of distrorelease to distroseries
415
    ...                            distroarchseriesID=breezy_i386.id)
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
416
    >>> print ed_pub.priority
3864.2.14 by Tim Penhey
Fixing broken tests or ensuring use of quote or sqlvalues.
417
    Standard
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
418
1716.1.229 by Christian Reis
Move encoding of person's displayname into packages. Add tests for version numbers for gcc-defaults, clean up code slightly. What remains: validating ensureBuild and _getBinary, and testing with multiple components, pockets and architectures
419
Check binary package libgjc-dev in Breezy. Its version number must differ from
420
its source version number.
421
422
    >>> n = BinaryPackageName.selectOneBy(name="libgcj-dev")
423
    >>> lib = BinaryPackageRelease.selectOneBy(binarypackagenameID=n.id,
424
    ...         version="4:4.0.1-3")
425
    >>> print lib.version
426
    4:4.0.1-3
7675.687.99 by Michael Nelson
gina.txt
427
    >>> print lib.build.source_package_release.version
1716.1.229 by Christian Reis
Move encoding of person's displayname into packages. Add tests for version numbers for gcc-defaults, clean up code slightly. What remains: validating ensureBuild and _getBinary, and testing with multiple components, pockets and architectures
428
    1.28
7675.687.99 by Michael Nelson
gina.txt
429
    >>> print lib.build.source_package_release.maintainer.displayname
1716.1.229 by Christian Reis
Move encoding of person's displayname into packages. Add tests for version numbers for gcc-defaults, clean up code slightly. What remains: validating ensureBuild and _getBinary, and testing with multiple components, pockets and architectures
430
    Debian GCC maintainers
431
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
432
Check if the udeb was properly parsed and identified:
433
434
    >>> n = BinaryPackageName.selectOneBy(name="archive-copier")
435
    >>> ac = BinaryPackageRelease.selectOneBy(binarypackagenameID=n.id,
436
    ...         version="0.1.5")
437
    >>> print ac.version
438
    0.1.5
439
    >>> print ac.priority
3864.2.14 by Tim Penhey
Fixing broken tests or ensuring use of quote or sqlvalues.
440
    Standard
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
441
    >>> print ac.section.name
442
    debian-installer
7675.687.99 by Michael Nelson
gina.txt
443
    >>> print ac.build.source_package_release.version
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
444
    0.1.5
7675.687.99 by Michael Nelson
gina.txt
445
    >>> print ac.build.source_package_release.maintainer.name
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
446
    cjwatson
447
    >>> print ac.build.processor.name
448
    386
449
1716.2.1 by Christian Reis
Add a backports pocket and add a staging target for it for hoary, with test. Change the publishing done in Gina to use the data that was read from the tagfile, not what was in the source package release; this caused, for instance, unchanged packages that moved between sections in different releases to always be published in the initial section. Solves this for section and component as well. The constructors in the *PackageData classes now guarantees that these are set during the constructor phase, since the rest of the lifecycle is truncated when doing a preimport*check.
450
We check that the binary package publishing override facility works:
451
452
    >>> n = BinaryPackageName.selectOneBy(name="libdb1-compat")
453
    >>> db1 = BinaryPackageRelease.selectOneBy(binarypackagenameID=n.id,
454
    ...         version="2.1.3-7")
7659.7.1 by Julian Edwards
Remove secure publishing records.
455
    >>> for pub in BinaryPackagePublishingHistory.selectBy(
5121.2.8 by Stuart Bishop
Renaming in doctests
456
    ...     binarypackagereleaseID=db1.id, orderBy='distroarchseries'):
4753.4.7 by Julian Edwards
Apply jamesh review comments
457
    ...     print "%s %s %s" % (
458
    ...         pub.distroarchseries.distroseries.name, pub.priority,
459
    ...         pub.archive.purpose.name)
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
460
    hoary Required PRIMARY
461
    breezy Optional PRIMARY
1716.2.1 by Christian Reis
Add a backports pocket and add a staging target for it for hoary, with test. Change the publishing done in Gina to use the data that was read from the tagfile, not what was in the source package release; this caused, for instance, unchanged packages that moved between sections in different releases to always be published in the initial section. Solves this for section and component as well. The constructors in the *PackageData classes now guarantees that these are set during the constructor phase, since the rest of the lifecycle is truncated when doing a preimport*check.
462
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
463
XXX: test package with invalid source version
1716.1.229 by Christian Reis
Move encoding of person's displayname into packages. Add tests for version numbers for gcc-defaults, clean up code slightly. What remains: validating ensureBuild and _getBinary, and testing with multiple components, pockets and architectures
464
XXX: test package with maintainer with non-ascii name
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
465
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
466
467
Testing People Created
468
......................
469
470
Ensure only one Kamion was created (he's an uploader on multiple packages),
471
and that we imported exactly 9 people (13 packages with 3 being uploaded by
472
Kamion, 2 being uploaded by mdz and 2 by doko).
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
473
474
    >>> from sqlobject import LIKE
7675.166.308 by Stuart Bishop
DB Unicode fixes
475
    >>> p = Person.selectOne(LIKE(Person.q.name, u"cjwatson%"))
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
476
    >>> print p.name
477
    cjwatson
478
    >>> print Person.select().count() - orig_person_count
7675.432.1 by William Grant
Make gina use determine_source_file_type, and verify that it imports 3.0 (quilt) sources.
479
    13
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
480
    >>> print TeamParticipation.select().count() - orig_tp_count
7675.432.1 by William Grant
Make gina use determine_source_file_type, and verify that it imports 3.0 (quilt) sources.
481
    13
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
482
    >>> print EmailAddress.select().count() - orig_email_count
7675.432.1 by William Grant
Make gina use determine_source_file_type, and verify that it imports 3.0 (quilt) sources.
483
    13
1716.1.222 by Christian Reis
One more round of Gina goodness. Add tests for the number of people created, for the release files in the librarian, and the size of the publishing history. Verify source files are not in the librarian before uploading them. Changed Colin's entries in Sources to reuse his email address (so we check email address matching works. The usual lintage, renames, XXXs and cleanups. Added libcap to be able to test a package with a version number with an epoch. Implemented a librarian file checker (based on the sha1 of a file).
484
3691.164.16 by Guilherme Salgado
Lots of fixes and tests suggested by Bjorn
485
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
486
Re-run Gina
487
...........
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
488
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
489
The second run of gina uses a test archive that is a copy of the first
490
one, but with updated Packages and Sources files for breezy that do
491
three important changes, implemented as publishing entries (or
492
overrides):
493
494
    - Binary package ed changed priority from 30 to 10 (extra) in i386
495
    - Source package x11proto-damage changed section from "x11" to "net"
3024.1.13 by Christian Reis
Add a test for moving components around in the archive -- the final part of this gina change that was untested (blame Matt and Les Miserables)
496
    - Source package archive-copier has been moved from component "main"
497
      to "universe".
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
498
499
Link to the "later" archive:
500
501
    >>> os.remove('/tmp/gina_test_archive')
8294.6.5 by Julian Edwards
Fix a bunch of circular imports, but there's still one I can't find.
502
    >>> relative_path = ('lib/lp/soyuz/scripts/'
6973.2.5 by Julian Edwards
Move script tests from ftests to tests.
503
    ...                  'tests/gina_test_archive_2nd_run')
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
504
    >>> path = os.path.join(os.getcwd(), relative_path)
505
    >>> os.symlink(path, '/tmp/gina_test_archive')
506
507
We do a re-run over the same components. We should get ERRORs indicating
508
packages that failed to import the last time. Overrides should also have
509
been updated for packages in breezy which have changed since the last
510
run.
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
511
512
    >>> gina_proc = [sys.executable, 'scripts/gina.py', '-q',
513
    ...              'hoary', 'breezy']
514
    >>> proc = subprocess.Popen(gina_proc, stderr=subprocess.PIPE)
515
    >>> print proc.stderr.read()
1716.2.14 by Christian Reis
Cope better with source packages whose DSC refers to files not in the pool
516
    ERROR   Error processing package files for clearlooks
11680.5.9 by Jelmer Vernooij
Fix gina test.
517
     -> http://...Error 2 unpacking source)
1716.2.1 by Christian Reis
Add a backports pocket and add a staging target for it for hoary, with test. Change the publishing done in Gina to use the data that was read from the tagfile, not what was in the source package release; this caused, for instance, unchanged packages that moved between sections in different releases to always be published in the initial section. Solves this for section and component as well. The constructors in the *PackageData classes now guarantees that these are set during the constructor phase, since the rest of the lifecycle is truncated when doing a preimport*check.
518
    WARNING Source package ed lacks section, assumed 'misc'
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
519
    ERROR   Unable to create SourcePackageData for mkvmlinuz
520
     -> http://...version: None)
521
    ERROR   Error processing package files for util-linux
1716.1.239 by Christian Reis
Really fix get_dsc_path to properly grok archive paths (and sanitize callsites and a certain place where we were generating a filename without the string pool attached to it). Remove PackageFileProcessError, which was dead anyway, and update for it. Rename anything that was an archive_root to the right term. All tests now pass
522
     -> http://...dsc not in archive)
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
523
    ERROR   Error processing package files for bsdutils
524
     -> http://...deb not found)
1716.2.1 by Christian Reis
Add a backports pocket and add a staging target for it for hoary, with test. Change the publishing done in Gina to use the data that was read from the tagfile, not what was in the source package release; this caused, for instance, unchanged packages that moved between sections in different releases to always be published in the initial section. Solves this for section and component as well. The constructors in the *PackageData classes now guarantees that these are set during the constructor phase, since the rest of the lifecycle is truncated when doing a preimport*check.
525
    WARNING Binary package ed lacks valid priority, assumed 'extra'
1716.1.241 by Christian Reis
Add support for locating license files that are prefixed with the binary package name (and add a package to test the feature with). Clean up changelog handling of package and version. Deal with the fact that selectOne* can raise an exception when encountering database corruption. Explicitly set SourcePackageRelease.format, and reorder the SPR attributes to check we are indeed sending in everything we should. Added a test for an invalid version. Refactor dsc and license handling so we don't do any more than we should in each of the calls to read_*.
526
    ERROR   Unable to create BinaryPackageData for mount
527
     -> http://...invalid version...)
1716.2.1 by Christian Reis
Add a backports pocket and add a staging target for it for hoary, with test. Change the publishing done in Gina to use the data that was read from the tagfile, not what was in the source package release; this caused, for instance, unchanged packages that moved between sections in different releases to always be published in the initial section. Solves this for section and component as well. The constructors in the *PackageData classes now guarantees that these are set during the constructor phase, since the rest of the lifecycle is truncated when doing a preimport*check.
528
    WARNING Binary package python-pam lacks a section, assumed 'misc'
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
529
    ERROR   Error processing package files for python2.4-pam
530
     -> http://...deb not found)
531
    ERROR   Error processing package files for python2.4-sqlite
532
     -> http://...deb not found)
533
    ERROR   Error processing package files for util-linux
534
     -> http://...deb not found)
1716.1.234 by Christian Reis
Add fixes for three issues: MissingRequiredAttributes was failing a check, coping with absent Format correctly, and dealing with a null ChangeLog in different situations.
535
    ERROR   Unable to create BinaryPackageData for util-linux-locales
536
     -> http://...installed_size'])
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
537
    ERROR   Invalid Sources stanza in /tmp/tmp...
538
     -> http://...bogus\n')
539
    ERROR   Error processing package files for python-sqlite
1716.1.239 by Christian Reis
Really fix get_dsc_path to properly grok archive paths (and sanitize callsites and a certain place where we were generating a filename without the string pool attached to it). Remove PackageFileProcessError, which was dead anyway, and update for it. Rename anything that was an archive_root to the right term. All tests now pass
540
     -> http://...dsc not in archive)
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
541
    ERROR   Error processing package files for util-linux
1716.1.239 by Christian Reis
Really fix get_dsc_path to properly grok archive paths (and sanitize callsites and a certain place where we were generating a filename without the string pool attached to it). Remove PackageFileProcessError, which was dead anyway, and update for it. Rename anything that was an archive_root to the right term. All tests now pass
542
     -> http://...dsc not in archive)
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
543
    ERROR   Error processing package files for python-sqlite
544
     -> http://...deb not found)
1716.1.225 by Christian Reis
First part of really testing binary packages. Add 14 binary package entries for hoary main. Change the librarian check to be a function so it can be unified between sources and binaries. Bulletproof the test to run under weird filesystem conditions. Make the config a bit less daft. Deal better with corrupt packages files (and entries). Fetch the licence for binary packages properly (the hard way). Clean up the creation of BinaryPackageData. Removed the catch-all except:s which only make my life harder (for now, at least).
545
    <BLANKLINE>
546
    >>> proc.wait()
547
    0
3024.1.11 by Christian Reis
Add support to Gina for doing publisher overrides when it encounters newer indices with updated information, corresponding to a post-initial-publication change in the archive (such as changing components)
548
    >>> transaction.commit()
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
549
3024.1.11 by Christian Reis
Add support to Gina for doing publisher overrides when it encounters newer indices with updated information, corresponding to a post-initial-publication change in the archive (such as changing components)
550
Nothing should happen to most of our data -- no counts should have
551
changed, etc.
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
552
553
    >>> SourcePackageRelease.select().count() - orig_spr_count
7675.432.1 by William Grant
Make gina use determine_source_file_type, and verify that it imports 3.0 (quilt) sources.
554
    17
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
555
    >>> print Person.select().count() - orig_person_count
7675.432.1 by William Grant
Make gina use determine_source_file_type, and verify that it imports 3.0 (quilt) sources.
556
    13
6527.11.8 by Celso Providelo
fixing linting problems.
557
    >>> print TeamParticipation.select().count() - orig_tp_count
7675.432.1 by William Grant
Make gina use determine_source_file_type, and verify that it imports 3.0 (quilt) sources.
558
    13
1716.1.223 by Christian Reis
Checkpoint gina: the sourcepackage side is implemented and well-tested, over two releases, and over two runs of gina
559
    >>> print EmailAddress.select().count() - orig_email_count
7675.432.1 by William Grant
Make gina use determine_source_file_type, and verify that it imports 3.0 (quilt) sources.
560
    13
1716.1.227 by Christian Reis
Order packages by name when processing them, to obtain stable test output. Add a host of binary packages to hoary to ensure I have enough to test with. Check before importing binary packages that they already exist (as we do for source packages) to optimize processing time and output. Reorganize tests to be a bit more self-contained.
561
    >>> BinaryPackageRelease.select().count() - orig_bpr_count
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
562
    40
10667.2.9 by Michael Nelson
Fixed failing tests.
563
    >>> BinaryPackageBuild.select().count() - orig_build_count
1716.1.252 by Christian Reis
Do proper handling of bin-only-NMUs and D-I packages, with tests. Cache the content of copyright files to avoid unpacking source packages for each binary package. To do this, I added a udeb entry for archive-copier and made rioutil produce a bin-only-NMU. Added caching infrastructure to packages.py:read_dsc, and simplified the way licences were grabbed. In handlers, added some regexps and a loop to find source packages for bin-only-NMUs, and modified licence handling to take into account the cache. Tests pass. These were to my understanding the final bits in Gina that needed to be tested (and fixed).
564
    13
3024.1.11 by Christian Reis
Add support to Gina for doing publisher overrides when it encounters newer indices with updated information, corresponding to a post-initial-publication change in the archive (such as changing components)
565
566
But the overrides do generate extra publishing entries:
567
1716.1.228 by Christian Reis
Check binary publishing history. Add binary packages for hoary. Attempt to clean up tempfiles created by the packages-map-creator. Use section from binary package, because it's missing from the DSC. Ensure finding source packages in the archive works.
568
    >>> SBPPH.select().count() - orig_sbpph_count
3024.1.11 by Christian Reis
Add support to Gina for doing publisher overrides when it encounters newer indices with updated information, corresponding to a post-initial-publication change in the archive (such as changing components)
569
    47
570
    >>> print SSPPH.select().count() - orig_sspph_count
10512.5.1 by Steve Kowalik
Brutally hack gina to process multiple sources of the same name.
571
    23
3024.1.11 by Christian Reis
Add support to Gina for doing publisher overrides when it encounters newer indices with updated information, corresponding to a post-initial-publication change in the archive (such as changing components)
572
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
573
Check that the overrides we did were correctly issued. We can't use
574
selectOneBy because, of course, there may be multiple rows published for that
575
package -- that's what overrides actually do.
3024.1.11 by Christian Reis
Add support to Gina for doing publisher overrides when it encounters newer indices with updated information, corresponding to a post-initial-publication change in the archive (such as changing components)
576
3864.2.14 by Tim Penhey
Fixing broken tests or ensuring use of quote or sqlvalues.
577
    >>> from canonical.database.sqlbase import sqlvalues
13850.2.22 by Jeroen Vermeulen
Doctest still thought Gina produces Pending pubs.
578
    >>> x11_pub = SSPPH.select("""
579
    ...     sourcepackagerelease = %s AND
580
    ...     distroseries = %s AND
581
    ...     status in %s
582
    ...     """ % sqlvalues(
583
    ...         x11p, breezy, active_publishing_status),
584
    ...     orderBy=["-datecreated"])[0]
3024.1.11 by Christian Reis
Add support to Gina for doing publisher overrides when it encounters newer indices with updated information, corresponding to a post-initial-publication change in the archive (such as changing components)
585
    >>> print x11_pub.section.name
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
586
    net
13850.2.22 by Jeroen Vermeulen
Doctest still thought Gina produces Pending pubs.
587
    >>> ed_pub = SBPPH.select("""
588
    ...     binarypackagerelease = %s AND
589
    ...     distroarchseries = %s AND
590
    ...     status in %s
591
    ...     """ % sqlvalues(
592
    ...         ed, breezy_i386, active_publishing_status),
593
    ...     orderBy=["-datecreated"])[0]
3024.1.11 by Christian Reis
Add support to Gina for doing publisher overrides when it encounters newer indices with updated information, corresponding to a post-initial-publication change in the archive (such as changing components)
594
    >>> print ed_pub.priority
3864.2.14 by Tim Penhey
Fixing broken tests or ensuring use of quote or sqlvalues.
595
    Extra
3024.1.13 by Christian Reis
Add a test for moving components around in the archive -- the final part of this gina change that was untested (blame Matt and Les Miserables)
596
    >>> n = SourcePackageName.selectOneBy(name="archive-copier")
597
    >>> ac = SourcePackageRelease.selectOneBy(sourcepackagenameID=n.id,
598
    ...         version="0.3.6")
13850.2.22 by Jeroen Vermeulen
Doctest still thought Gina produces Pending pubs.
599
    >>> ac_pub = SSPPH.select("""
600
    ...     sourcepackagerelease = %s AND
601
    ...     distroseries = %s AND
602
    ...     status in %s
603
    ...     """ % sqlvalues(
604
    ...         ac, breezy, active_publishing_status),
605
    ...     orderBy=["-datecreated"])[0]
3024.1.13 by Christian Reis
Add a test for moving components around in the archive -- the final part of this gina change that was untested (blame Matt and Les Miserables)
606
    >>> print ac_pub.component.name
607
    universe
3024.1.10 by Christian Reis
Add a failing test for Gina so that we know it copes with doing overrides
608
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
609
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
610
Partner archive import
611
......................
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
612
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
613
Importing the partner archive requires overriding the component to
614
"partner", which also makes the archive on any publishing records the
615
partner archive.
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
616
4753.4.9 by Julian Edwards
Apply kiko review comments.
617
First get a set of existing publishings for both source and binary:
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
618
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
619
    >>> comm_archive = ubuntu.getArchiveByComponent('partner')
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
620
    >>> hoary = ubuntu['hoary']
621
    >>> hoary_i386 = hoary['i386']
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
622
    >>> partner_source_set = set(
5121.2.8 by Stuart Bishop
Renaming in doctests
623
    ...     SSPPH.select("distroseries = %s" % sqlvalues(hoary)))
4753.4.8 by Julian Edwards
Apply kiko review comments.
624
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
625
    >>> partner_binary_set = set(
5121.2.8 by Stuart Bishop
Renaming in doctests
626
    ...     SBPPH.select("distroarchseries = %s" % sqlvalues(hoary_i386)))
4753.4.8 by Julian Edwards
Apply kiko review comments.
627
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
628
Now run gina to import packages and convert them to partner:
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
629
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
630
    >>> gina_proc = [sys.executable, 'scripts/gina.py', '-q', 'partner']
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
631
    >>> proc = subprocess.Popen(gina_proc, stderr=subprocess.PIPE)
632
    >>> proc.wait()
633
    0
634
    >>> transaction.commit()
635
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
636
There will now be a number of publishings in the partner archive:
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
637
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
638
    >>> partner_source_set_after = set(
5121.2.8 by Stuart Bishop
Renaming in doctests
639
    ...     SSPPH.select("distroseries = %s" % sqlvalues(hoary)))
4753.4.8 by Julian Edwards
Apply kiko review comments.
640
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
641
    >>> partner_binary_set_after = set(
5121.2.8 by Stuart Bishop
Renaming in doctests
642
    ...     SBPPH.select("distroarchseries = %s" % sqlvalues(hoary_i386)))
4753.4.8 by Julian Edwards
Apply kiko review comments.
643
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
644
    >>> source_difference = partner_source_set_after - partner_source_set
4753.4.9 by Julian Edwards
Apply kiko review comments.
645
    >>> len(source_difference)
10512.5.1 by Steve Kowalik
Brutally hack gina to process multiple sources of the same name.
646
    12
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
647
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
648
    >>> binary_difference = partner_binary_set_after - partner_binary_set
4753.4.9 by Julian Edwards
Apply kiko review comments.
649
    >>> len(binary_difference)
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
650
    24
651
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
652
All the publishings will also have the 'partner' component and the
653
partner archive:
4753.4.9 by Julian Edwards
Apply kiko review comments.
654
655
    >>> print set(sspph.component.name for sspph in source_difference)
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
656
    set([u'partner'])
4753.4.9 by Julian Edwards
Apply kiko review comments.
657
658
    >>> print set(sbpph.component.name for sbpph in binary_difference)
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
659
    set([u'partner'])
4753.4.9 by Julian Edwards
Apply kiko review comments.
660
661
    >>> print set(sspph.archive.purpose.name for sspph in source_difference)
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
662
    set(['PARTNER'])
4753.4.9 by Julian Edwards
Apply kiko review comments.
663
664
    >>> print set(sbpph.archive.purpose.name for sbpph in binary_difference)
4810.9.1 by Julian Edwards
All occurrences of commercial, Commercial or COMMERCIAL are now partner,
665
    set(['PARTNER'])
4753.4.1 by Julian Edwards
Allow gina to override the component (and thus the archive) when importing
666
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
667
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
668
Source-only imports
669
...................
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
670
671
Gina has a 'source-only' configuration option which allows it to
672
import only sources from the configured archive.
673
674
That's how we intend to start importing all debian source releases to
6527.11.9 by Celso Providelo
applying review comments, r=sinzui.
675
the launchpad system. This way we would have precise records of
676
"Ubuntu-Debian" packages relationships and expose this information,
677
not only in Soyuz (package managing) but also in Bugs and Blueprints,
678
for instance.
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
679
680
We will restore the initial 'gina_test_archive' because it contains a
681
entry for a suite called 'testing' which contains only the source
682
indexes from the 'hoary' suite.
683
684
    >>> os.remove('/tmp/gina_test_archive')
8294.6.5 by Julian Edwards
Fix a bunch of circular imports, but there's still one I can't find.
685
    >>> relative_path = ('lib/lp/soyuz/scripts/tests/gina_test_archive')
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
686
    >>> path = os.path.join(os.getcwd(), relative_path)
687
    >>> os.symlink(path, '/tmp/gina_test_archive')
688
689
We will also create the target distroseries for the imported
690
sources. We will import them into Debian/Lenny distroseries as
691
specified in the testing configuration.
692
7675.110.3 by Curtis Hovey
Ran the migration script to move registry code to lp.registry.
693
    >>> from lp.registry.interfaces.distribution import (
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
694
    ...     IDistributionSet)
695
    >>> debian = getUtility(IDistributionSet).getByName('debian')
6974.1.10 by Edwin Grubbs
Fixed tests.
696
697
    # Only the distro owner and admins can create a new series.
9105.3.2 by Brad Crittenden
Changed mark@hbd.com to mark@example.com. Tests that used base64 encoding for basic auth credentials were changed to use plaintext.
698
    >>> login('mark@example.com')
6974.1.10 by Edwin Grubbs
Fixed tests.
699
    >>> lenny = debian.newSeries(
700
    ...     "lenny", "lenny", "Lenny",
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
701
    ...     "---", "!!!", "8.06",
702
    ...     hoary, celebs.launchpad_developers)
6974.1.10 by Edwin Grubbs
Fixed tests.
703
    >>> login(ANONYMOUS)
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
704
705
Note that we will create a Lenny/i386 port (DistroArchSeries) to check
6527.11.9 by Celso Providelo
applying review comments, r=sinzui.
706
if no binaries get imported by mistake. However this is not required
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
707
in production, i.e., just creating 'lenny' should suffice for the
708
source-only import to happen.
709
710
    >>> pf = ProcessorFamily.selectOneBy(name="x86")
711
    >>> lenny_i386 = DistroArchSeries(
712
    ...     distroseries=lenny, processorfamily=pf,
713
    ...     architecturetag="i386", official=True,
714
    ...     owner=celebs.launchpad_developers)
715
716
We will also store the number of binaries already published in debian
717
PRIMARY archive, so we can check later it was unaffected by the
718
import.
719
720
    >>> debian_binaries = SBPPH.selectBy(archive=debian.main_archive)
721
    >>> number_of_debian_binaries = debian_binaries.count()
722
723
Commit the changes and run the importer script.
724
725
    >>> transaction.commit()
726
727
    >>> gina_proc = [
728
    ...     sys.executable, 'scripts/gina.py', '-q', 'lenny']
729
    >>> proc = subprocess.Popen(gina_proc, stderr=subprocess.PIPE)
730
    >>> proc.wait()
731
    0
732
733
    >>> transaction.commit()
734
13850.2.22 by Jeroen Vermeulen
Doctest still thought Gina produces Pending pubs.
735
There is now a number of source publications in PUBLISHED status for the
6527.11.9 by Celso Providelo
applying review comments, r=sinzui.
736
targetted distroseries, 'lenny'.
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
737
738
    >>> lenny_sources = SSPPH.select("distroseries = %s" % sqlvalues(lenny))
739
    >>> lenny_sources.count()
10512.5.1 by Steve Kowalik
Brutally hack gina to process multiple sources of the same name.
740
    12
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
741
742
    >>> print set([pub.status.name for pub in lenny_sources])
13850.2.22 by Jeroen Vermeulen
Doctest still thought Gina produces Pending pubs.
743
    set(['PUBLISHED'])
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
744
6527.11.9 by Celso Providelo
applying review comments, r=sinzui.
745
As mentioned before, lenny/i386 is empty, no binaries were imported.
746
Also, the number of binaries published in the whole debian distribution
747
hasn't changed.
6527.11.6 by Celso Providelo
Adding test for source-only gina targets.
748
749
    >>> lenny_binaries = SBPPH.selectBy(distroarchseries=lenny_i386)
750
    >>> lenny_binaries.count()
751
    0
752
753
    >>> debian_binaries = SBPPH.selectBy(archive=debian.main_archive)
754
    >>> debian_binaries.count() == number_of_debian_binaries
755
    True
756
757
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
758
Processing multiple suites in the same batch
759
............................................
7224.3.5 by Celso Providelo
adding tests for processing multiple suites in the same batch in gina.
760
761
Both, 'lenny' and 'hoary' (as partner) will be processed in the same
762
batch.
763
764
    >>> gina_proc = [
765
    ...     sys.executable, 'scripts/gina.py', 'lenny', 'partner']
766
    >>> proc = subprocess.Popen(gina_proc, stderr=subprocess.PIPE)
767
768
    >>> print proc.stderr.read()
7675.624.72 by Tim Penhey
Gee there are a lot of these lockfile creation fixes.
769
    INFO    Creating lockfile: /var/lock/launchpad-gina.lock
7224.3.5 by Celso Providelo
adding tests for processing multiple suites in the same batch in gina.
770
    ...
771
    INFO    === Processing debian/lenny/release ===
772
    ...
773
    INFO    === Processing ubuntu/hoary/release ===
774
    ...
775
776
    >>> proc.wait()
777
    0
778
779
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
780
Other tests
781
...........
1716.1.219 by Christian Reis
One more step in the direction of gina testing: test the processing of a second distro release. Verify that no duplicate source packages are added. Check for mangled tagfile stanzas. Reorder classes in handlers.py to be more naturally sequenced. Centralize error checking in gina.py so that do_one_*package is what's tested for error raising. Add support files for testing Breezy. More test clauses. I'd estimate I'm 30% done
782
783
For kicks, finally, run gina on a configured but incomplete archive:
784
785
    >>> gina_proc = [sys.executable, 'scripts/gina.py', '-q', 'bogus']
786
    >>> proc = subprocess.Popen(gina_proc, stderr=subprocess.PIPE)
787
    >>> print proc.stderr.read()
788
    ERROR   Failed to analyze archive for bogoland
789
     -> http://...)
790
    <BLANKLINE>
791
    >>> proc.wait()
792
    1
793
14027.3.1 by Jeroen Vermeulen
Fix lots of lint in recently-changed files.
794
795
Wrap up
796
.......
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
797
2168 by Canonical.com Patch Queue Manager
[r=BjornT] More gina improvements.
798
Remove the tmp link to the gina_test_archive
799
    >>> os.remove('/tmp/gina_test_archive')
1716.1.218 by Christian Reis
Add more package data and update the gina doctest. Seriously whack packages.py and gina.py, with some trickle into handlers.py. The creation of source packages for Hoary is now minimally tested, with most important codepaths and error conditions being checked. Did work on validation and ensuring the source and binary package data we have is consistent. Added a ton of packages to the gina test archive so we can use them in our tests -- welcome them into rocketfuel :-)
800