Merge lp:~mbp/bzr/751824-whoami-test-failures-2.3 into lp:bzr

Proposed by Martin Pool
Status: Superseded
Proposed branch: lp:~mbp/bzr/751824-whoami-test-failures-2.3
Merge into: lp:bzr
Diff against target: 63 lines (+13/-1)
3 files modified
bzrlib/tests/blackbox/test_commit.py (+4/-0)
bzrlib/tests/blackbox/test_whoami.py (+4/-1)
bzrlib/tests/per_repository/test_commit_builder.py (+5/-0)
To merge this branch: bzr merge lp:~mbp/bzr/751824-whoami-test-failures-2.3
Reviewer Review Type Date Requested Status
John A Meinel Approve
Review via email: mp+56503@code.launchpad.net

This proposal has been superseded by a proposal from 2011-04-13.

Commit message

Update tests for no user identity being configured so they work when one can be inferred.

Description of the change

Fixes https://bugs.launchpad.net/bzr/+bug/751824

This updates some tests for no user identity being configured so they work properly when one can be inferred from /etc/mailname. I infer this passed through pqm the first time because mailname is not set there. I have now run the whole thing locally and there are no problems.

It would be nicer if there was a process-scope configuration that the tests could override to force this off, rather than monkeypatching.

To post a comment you must log in.
Revision history for this message
John A Meinel (jameinel) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/06/2011 06:44 AM, Martin Pool wrote:
> Martin Pool has proposed merging lp:~mbp/bzr/751824-whoami-test-failures-2.3 into lp:bzr.
>
> Requested reviews:
> bzr-core (bzr-core)
> Related bugs:
> Bug #751824 in Bazaar: "whoami-related test failures with bzr.dev"
> https://bugs.launchpad.net/bzr/+bug/751824
>
> For more details, see:
> https://code.launchpad.net/~mbp/bzr/751824-whoami-test-failures-2.3/+merge/56503
>
> Fixes https://bugs.launchpad.net/bzr/+bug/751824
>
> This updates some tests for no user identity being configured so they work properly when one can be inferred from /etc/mailname. I infer this passed through pqm the first time because mailname is not set there. I have now run the whole thing locally and there are no problems.
>
> It would be nicer if there was a process-scope configuration that the tests could override to force this off, rather than monkeypatching.

 merge: approve
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2cFH4ACgkQJdeBCYSNAAP/UQCgkPEHPtGgI2y6pPiftzHk8dlu
g3sAoM+E4jBKkdL2rIfMtrXD/p9nOuuY
=yX9q
-----END PGP SIGNATURE-----

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

    > It would be nicer if there was a process-scope configuration that
    > the tests could override to force this off, rather than
    > monkeypatching.

Hi-jacking the thread a bit: pedantically speaking, this is one example
of a config option that could be defined in /etc/bzr/bazaar.conf.

Supporting it in ~/.bazaar/bazaar.conf would still be an improvement
though.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

sent to pqm by email

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bzrlib/tests/blackbox/test_commit.py'
2--- bzrlib/tests/blackbox/test_commit.py 2011-01-10 22:20:12 +0000
3+++ bzrlib/tests/blackbox/test_commit.py 2011-04-06 04:42:44 +0000
4@@ -23,6 +23,7 @@
5
6 from bzrlib import (
7 bzrdir,
8+ config,
9 osutils,
10 ignores,
11 msgeditor,
12@@ -758,6 +759,9 @@
13 self.run_bzr(['add'])
14 self.overrideEnv('EMAIL', None)
15 self.overrideEnv('BZR_EMAIL', None)
16+ # Also, make sure that it's not inferred from mailname.
17+ self.overrideAttr(config, '_auto_user_id',
18+ lambda: (None, None))
19 out, err = self.run_bzr(['commit', '-m', 'initial'], 3)
20 self.assertContainsRe(err, 'Unable to determine your name')
21
22
23=== modified file 'bzrlib/tests/blackbox/test_whoami.py'
24--- bzrlib/tests/blackbox/test_whoami.py 2011-01-18 22:30:23 +0000
25+++ bzrlib/tests/blackbox/test_whoami.py 2011-04-06 04:42:44 +0000
26@@ -94,10 +94,13 @@
27 'recommended.\n', display)
28
29 def test_whoami_not_set(self):
30- """Ensure whoami error if username is not set.
31+ """Ensure whoami error if username is not set and not inferred.
32 """
33 self.overrideEnv('EMAIL', None)
34 self.overrideEnv('BZR_EMAIL', None)
35+ # Also, make sure that it's not inferred from mailname.
36+ self.overrideAttr(config, '_auto_user_id',
37+ lambda: (None, None))
38 out, err = self.run_bzr(['whoami'], 3)
39 self.assertContainsRe(err, 'Unable to determine your name')
40
41
42=== modified file 'bzrlib/tests/per_repository/test_commit_builder.py'
43--- bzrlib/tests/per_repository/test_commit_builder.py 2011-03-13 15:22:28 +0000
44+++ bzrlib/tests/per_repository/test_commit_builder.py 2011-04-06 04:42:44 +0000
45@@ -19,6 +19,7 @@
46 import os
47
48 from bzrlib import (
49+ config,
50 errors,
51 graph,
52 inventory,
53@@ -1361,6 +1362,10 @@
54 # Ensure that when no username is available but a committer is
55 # supplied, commit works.
56 self.overrideEnv('EMAIL', None)
57+ self.overrideEnv('BZR_EMAIL', None)
58+ # Also, make sure that it's not inferred from mailname.
59+ self.overrideAttr(config, '_auto_user_id',
60+ lambda: (None, None))
61 tree = self.make_branch_and_tree(".")
62 tree.lock_write()
63 try: