Merge ~cjwatson/launchpad:fix-git-tests into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 09f8a40c2d76872a6059a2f662d00cf55caa3c57
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:fix-git-tests
Merge into: launchpad:master
Diff against target: 84 lines (+9/-11)
6 files modified
doc/_static/.gitignore (+0/-0)
doc/_templates/.gitignore (+0/-0)
lib/lp/answers/configure.zcml (+0/-2)
lib/lp/app/tests/test_help.py (+0/-4)
lib/lp/services/mail/tests/test_stub.py (+7/-5)
scripts/update-version-info.sh (+2/-0)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Kristian Glass (community) Approve
Ioana Lasc (community) Approve
Review via email: mp+373504@code.launchpad.net

Commit message

Fix some tests that failed when running from git

Description of the change

A few odds and ends didn't quite work when running buildbot on the git migration: a few empty directories weren't preserved on the git side, and there were a couple of minor problems with version information.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) :
review: Approve
Revision history for this message
Kristian Glass (doismellburning) :
review: Approve
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/doc/_static/.gitignore b/doc/_static/.gitignore
0new file mode 1006440new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/doc/_static/.gitignore
diff --git a/doc/_templates/.gitignore b/doc/_templates/.gitignore
1new file mode 1006441new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/doc/_templates/.gitignore
diff --git a/lib/lp/answers/configure.zcml b/lib/lp/answers/configure.zcml
index dd3d075..9735be8 100644
--- a/lib/lp/answers/configure.zcml
+++ b/lib/lp/answers/configure.zcml
@@ -269,7 +269,5 @@
269 <allow interface="lp.services.webapp.vocabulary.IHugeVocabulary"/>269 <allow interface="lp.services.webapp.vocabulary.IHugeVocabulary"/>
270 </class>270 </class>
271271
272 <lp:help-folder folder="help" name="+help-answers"/>
273
274 <webservice:register module="lp.answers.interfaces.webservice" />272 <webservice:register module="lp.answers.interfaces.webservice" />
275</configure>273</configure>
diff --git a/lib/lp/app/tests/test_help.py b/lib/lp/app/tests/test_help.py
index fb44bf6..e4ef38a 100644
--- a/lib/lp/app/tests/test_help.py
+++ b/lib/lp/app/tests/test_help.py
@@ -35,10 +35,6 @@ class TestHelpSystemSetup(unittest.TestCase):
35 "Expected help folder %s, got %s" % (35 "Expected help folder %s, got %s" % (
36 expected_folder_path, view.folder))36 expected_folder_path, view.folder))
3737
38 def test_answers_help_folder(self):
39 self.assertHasHelpFolderView(
40 '+help-answers', os.path.join(ROOT, 'lib/lp/answers/help'))
41
42 def test_blueprints_help_folder(self):38 def test_blueprints_help_folder(self):
43 self.assertHasHelpFolderView(39 self.assertHasHelpFolderView(
44 '+help-blueprints', os.path.join(ROOT, 'lib/lp/blueprints/help'))40 '+help-blueprints', os.path.join(ROOT, 'lib/lp/blueprints/help'))
diff --git a/lib/lp/services/mail/tests/test_stub.py b/lib/lp/services/mail/tests/test_stub.py
index f91edad..032e7ed 100644
--- a/lib/lp/services/mail/tests/test_stub.py
+++ b/lib/lp/services/mail/tests/test_stub.py
@@ -101,16 +101,18 @@ def test_simple_sendmail():
101101
102 The message has a number of additional headers added by default.102 The message has a number of additional headers added by default.
103 'X-Generated-By' not only indicates that the source is Launchpad, but103 'X-Generated-By' not only indicates that the source is Launchpad, but
104 shows the bzr revision and instance name.104 shows the git revision and instance name.
105
106 >>> message['X-Generated-By'].replace('\n\t', '\n ')
107 'Launchpad (canonical.com); Revision="1999";\n Instance="launchpad-lazr.conf"'
108105
106 >>> message.get_params(header='X-Generated-By')
107 [('Launchpad (canonical.com)', ''),
108 ('revision', '0000000000000000000000000000000000000000'),
109 ('instance', 'launchpad-lazr.conf')]
109 """110 """
110111
111112
112def test_suite():113def test_suite():
113 suite = DocTestSuite(checker=RENormalizing([114 suite = DocTestSuite(checker=RENormalizing([
114 (re.compile(r'Revision="\d+"'), 'Revision="1999"')]))115 (re.compile(r"'revision', '[0-9a-f]+'"),
116 "'revision', '%s'" % ('0' * 40))]))
115 suite.layer = LaunchpadFunctionalLayer117 suite.layer = LaunchpadFunctionalLayer
116 return suite118 return suite
diff --git a/scripts/update-version-info.sh b/scripts/update-version-info.sh
index d888e6a..3b56737 100755
--- a/scripts/update-version-info.sh
+++ b/scripts/update-version-info.sh
@@ -17,6 +17,7 @@ if [ -d .git ]; then
1717
18 branch_nick="$(git rev-parse --abbrev-ref HEAD | sed "s/'/\\\\'/g")"18 branch_nick="$(git rev-parse --abbrev-ref HEAD | sed "s/'/\\\\'/g")"
19 revision_id="$(git rev-parse HEAD)"19 revision_id="$(git rev-parse HEAD)"
20 date="$(git show -s --format=%ci HEAD)"
20 cat > $newfile <<EOF21 cat > $newfile <<EOF
21#! /usr/bin/env python22#! /usr/bin/env python
2223
@@ -24,6 +25,7 @@ from __future__ import print_function
2425
25version_info = {26version_info = {
26 'branch_nick': u'$branch_nick',27 'branch_nick': u'$branch_nick',
28 'date': u'$date',
27 'revision_id': u'$revision_id',29 'revision_id': u'$revision_id',
28 }30 }
2931

Subscribers

People subscribed via source and target branches

to status/vote changes: