← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~cjwatson/launchpad/inline-release-timestamp into lp:launchpad

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/inline-release-timestamp into lp:launchpad.

Commit message:
Synchronise timestamp of InRelease with other index files when we create it.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/inline-release-timestamp/+merge/272506

Synchronise timestamp of InRelease with other index files when we create it.  I missed this in https://code.launchpad.net/~cjwatson/launchpad/inline-release/+merge/272132.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/inline-release-timestamp into lp:launchpad.
=== modified file 'lib/lp/archivepublisher/publishing.py'
--- lib/lp/archivepublisher/publishing.py	2015-09-23 13:19:25 +0000
+++ lib/lp/archivepublisher/publishing.py	2015-09-26 00:34:32 +0000
@@ -885,6 +885,7 @@
         archive_signer = IArchiveSigningKey(self.archive)
         archive_signer.signRepository(suite)
         all_files.add("Release.gpg")
+        all_files.add("InRelease")
 
         # Make sure all the timestamps match, to make it easier to insert
         # caching headers on mirrors.

=== modified file 'lib/lp/archivepublisher/tests/test_publisher.py'
--- lib/lp/archivepublisher/tests/test_publisher.py	2015-09-25 11:13:02 +0000
+++ lib/lp/archivepublisher/tests/test_publisher.py	2015-09-26 00:34:32 +0000
@@ -18,6 +18,7 @@
 import time
 
 from debian.deb822 import Release
+from testtools.matchers import ContainsAll
 import transaction
 from zope.component import getUtility
 from zope.security.proxy import removeSecurityProxy
@@ -2152,9 +2153,10 @@
 
     def setupPublisher(self, archive):
         """Setup a `Publisher` instance for the given archive."""
-        allowed_suites = []
-        self.archive_publisher = getPublisher(
-            archive, allowed_suites, self.logger)
+        if self.archive_publisher is None:
+            allowed_suites = []
+            self.archive_publisher = getPublisher(
+                archive, allowed_suites, self.logger)
 
     def _publishArchive(self, archive):
         """Publish a test source in the given archive.
@@ -2225,6 +2227,9 @@
         IArchiveSigningKey(cprov.archive).setSigningKey(key_path)
         self.assertTrue(cprov.archive.signing_key is not None)
 
+        self.setupPublisher(cprov.archive)
+        self.archive_publisher._syncTimestamps = FakeMethod()
+
         self._publishArchive(cprov.archive)
 
         # All of Release, Release.gpg, and InRelease exist.
@@ -2252,6 +2257,13 @@
             cprov.archive.signing_key.fingerprint)
         self.assertEqual(release_content, inline_signature.plain_data)
 
+        # The publisher synchronises the various Release file timestamps.
+        self.assertEqual(1, self.archive_publisher._syncTimestamps.call_count)
+        sync_args = self.archive_publisher._syncTimestamps.extract_args()[0]
+        self.assertEqual(self.distroseries.name, sync_args[0])
+        self.assertThat(
+            sync_args[1], ContainsAll(['Release', 'Release.gpg', 'InRelease']))
+
         # All done, turn test-keyserver off.
         tac.tearDown()
 


Follow ups