~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/doc/gina.txt

  • Committer: Curtis Hovey
  • Date: 2011-08-21 14:21:06 UTC
  • mto: This revision was merged to the branch mainline in revision 13745.
  • Revision ID: curtis.hovey@canonical.com-20110821142106-x93hajd6iguma8gx
Update test that was enforcing bad grammar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
Get the current counts of stuff in the database:
9
9
 
10
 
    >>> from lp.services.identity.model.emailaddress import EmailAddress
11
 
    >>> from lp.soyuz.interfaces.publishing import active_publishing_status
 
10
    >>> from canonical.launchpad.database.emailaddress import EmailAddress
12
11
    >>> from lp.soyuz.model.publishing import (
13
12
    ...     BinaryPackagePublishingHistory,
14
13
    ...     SourcePackagePublishingHistory)
110
109
And two completely broken packages:
111
110
 
112
111
   * util-linux, a source package that is missing from the pool. It
113
 
     generates 4 binary packages, all missing. It's correctly listed in
114
 
     Sources and Packages, though.
 
112
     generates 4 binary packages, all missing. It's correctly listed in Sources
 
113
     and Packages, though.
115
114
 
116
115
   * clearlooks, a source package with no binaries listed, and which has
117
116
     a DSC file that refers to an inexistant tar.gz.
186
185
    >>> transaction.commit()
187
186
    >>> fixture.cleanUp()
188
187
 
189
 
 
190
 
Testing Source Package Results
191
 
..............................
 
188
=== Testing Source Package Results ===
192
189
 
193
190
We should have more source packages in the database:
194
191
 
294
291
were calculated directly on the files):
295
292
 
296
293
    >>> from lp.soyuz.model.files import SourcePackageReleaseFile
297
 
    >>> files = SourcePackageReleaseFile.selectBy(
298
 
    ...     sourcepackagereleaseID=cap.id, orderBy="libraryfile")
 
294
    >>> files = SourcePackageReleaseFile.selectBy(sourcepackagereleaseID=cap.id,
 
295
    ...                                           orderBy="libraryfile")
299
296
    >>> for f in files:
300
297
    ...     print f.libraryfile.content.sha1
301
298
    107d5478e72385f714523bad5359efedb5dcc8b2
323
320
    >>> print db1.section.name
324
321
    libs
325
322
 
326
 
 
327
 
Testing Source Package Publishing
328
 
.................................
 
323
=== Testing Source Package Publishing ===
329
324
 
330
325
We check that the source package publishing override facility works:
331
326
 
341
336
successfully processed.
342
337
 
343
338
    - We had 2 errors (out of 10 Sources stanzas) in hoary: mkvmlinuz and
344
 
      util-linux.
 
339
      util-linux
345
340
 
346
 
    - We had 2 errors (out of 10 Sources stanzas) in breezy: python-sqllite
347
 
      and util-linux (again, poor thing).
 
341
    - We had 2 errors (out of 10 Sources stanzas) in breezy: python-sqllite and
 
342
      util-linux (again, poor thing)
348
343
 
349
344
    >>> print SSPPH.select().count() - orig_sspph_count
350
345
    21
351
346
 
352
 
    >>> new_count = SSPPH.selectBy(
 
347
    >>> print SSPPH.selectBy(
353
348
    ...     componentID=1,
354
 
    ...     pocket=PackagePublishingPocket.RELEASE).count()
355
 
    >>> print new_count - orig_sspph_main_count
 
349
    ...     pocket=PackagePublishingPocket.RELEASE).count() - \
 
350
    ...     orig_sspph_main_count
356
351
    21
357
352
 
358
 
 
359
 
Testing Binary Package Results
360
 
..............................
 
353
=== Testing Binary Package Results ===
361
354
 
362
355
We have 26 binary packages in hoary. The 4 packages for util-linux fail, and 1
363
356
package fails for each of python-sqlite and python-pam. We should publish one
364
357
entry for each package listed in Releases.
365
358
 
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.
 
359
We have 23 binary packages in breezy. db1-compat, ed, the 3 libcap packages and
 
360
python-pam is unchanged.  python-sqlite fails. The 5 ubuntu-meta packages work.
369
361
 
370
362
    >>> BinaryPackageRelease.select().count() - orig_bpr_count
371
363
    40
463
455
XXX: test package with invalid source version
464
456
XXX: test package with maintainer with non-ascii name
465
457
 
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).
 
458
=== Testing People Created ===
 
459
 
 
460
Ensure only one Kamion was created (he's an uploader on multiple packages), and
 
461
that we imported exactly 9 people (13 packages with 3 being uploaded by Kamion,
 
462
2 being uploaded by mdz and 2 by doko).
473
463
 
474
464
    >>> from sqlobject import LIKE
475
465
    >>> p = Person.selectOne(LIKE(Person.q.name, u"cjwatson%"))
483
473
    13
484
474
 
485
475
 
486
 
Re-run Gina
487
 
...........
 
476
=== Re-run Gina ===
488
477
 
489
478
The second run of gina uses a test archive that is a copy of the first
490
479
one, but with updated Packages and Sources files for breezy that do
570
559
    >>> print SSPPH.select().count() - orig_sspph_count
571
560
    23
572
561
 
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.
 
562
Check that the overrides we did were correctly issued. We can't use selectOneBy
 
563
because, of course, there may be multiple rows published for that package --
 
564
that's what overrides actually do.
576
565
 
577
566
    >>> from canonical.database.sqlbase import sqlvalues
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]
 
567
    >>> from lp.soyuz.enums import PackagePublishingStatus
 
568
    >>> x11_pub = SSPPH.select("""sourcepackagerelease = %s
 
569
    ...                           AND distroseries = %s
 
570
    ...                           AND status in (%s, %s)""" %
 
571
    ...                         sqlvalues(x11p, breezy,
 
572
    ...                          PackagePublishingStatus.PUBLISHED,
 
573
    ...                          PackagePublishingStatus.PENDING),
 
574
    ...                          orderBy=["-datecreated"])[0]
585
575
    >>> print x11_pub.section.name
586
576
    net
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]
 
577
    >>> ed_pub = SBPPH.select("""binarypackagerelease = %s
 
578
    ...                           AND distroarchseries = %s
 
579
    ...                           AND status in (%s, %s)""" %
 
580
    ...                         sqlvalues(ed, breezy_i386,
 
581
    ...                          PackagePublishingStatus.PUBLISHED,
 
582
    ...                          PackagePublishingStatus.PENDING),
 
583
    ...                          orderBy=["-datecreated"])[0]
594
584
    >>> print ed_pub.priority
595
585
    Extra
596
586
    >>> n = SourcePackageName.selectOneBy(name="archive-copier")
597
587
    >>> ac = SourcePackageRelease.selectOneBy(sourcepackagenameID=n.id,
598
588
    ...         version="0.3.6")
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]
 
589
    >>> ac_pub = SSPPH.select("""sourcepackagerelease = %s
 
590
    ...                          AND distroseries = %s
 
591
    ...                          AND status in (%s, %s)""" %
 
592
    ...                        sqlvalues(ac, breezy,
 
593
    ...                         PackagePublishingStatus.PUBLISHED,
 
594
    ...                         PackagePublishingStatus.PENDING),
 
595
    ...                         orderBy=["-datecreated"])[0]
606
596
    >>> print ac_pub.component.name
607
597
    universe
608
598
 
609
599
 
610
 
Partner archive import
611
 
......................
 
600
=== Partner archive import ===
612
601
 
613
602
Importing the partner archive requires overriding the component to
614
603
"partner", which also makes the archive on any publishing records the
665
654
    set(['PARTNER'])
666
655
 
667
656
 
668
 
Source-only imports
669
 
...................
 
657
=== Source-only imports ===
670
658
 
671
659
Gina has a 'source-only' configuration option which allows it to
672
660
import only sources from the configured archive.
732
720
 
733
721
    >>> transaction.commit()
734
722
 
735
 
There is now a number of source publications in PUBLISHED status for the
 
723
There is now a number of source publications in PENDING status for the
736
724
targetted distroseries, 'lenny'.
737
725
 
738
726
    >>> lenny_sources = SSPPH.select("distroseries = %s" % sqlvalues(lenny))
740
728
    12
741
729
 
742
730
    >>> print set([pub.status.name for pub in lenny_sources])
743
 
    set(['PUBLISHED'])
 
731
    set(['PENDING'])
744
732
 
745
733
As mentioned before, lenny/i386 is empty, no binaries were imported.
746
734
Also, the number of binaries published in the whole debian distribution
755
743
    True
756
744
 
757
745
 
758
 
Processing multiple suites in the same batch
759
 
............................................
 
746
=== Processing multiple suites in the same batch ===
760
747
 
761
748
Both, 'lenny' and 'hoary' (as partner) will be processed in the same
762
749
batch.
777
764
    0
778
765
 
779
766
 
780
 
Other tests
781
 
...........
 
767
=== Other tests ===
782
768
 
783
769
For kicks, finally, run gina on a configured but incomplete archive:
784
770
 
791
777
    >>> proc.wait()
792
778
    1
793
779
 
794
 
 
795
 
Wrap up
796
 
.......
 
780
=== Wrap up ===
797
781
 
798
782
Remove the tmp link to the gina_test_archive
799
783
    >>> os.remove('/tmp/gina_test_archive')