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

Proposed by Martin Pool
Status: Merged
Approved by: Martin Pool
Approved revision: no longer in the source branch.
Merged at revision: 5639
Proposed branch: lp:~mbp/bzr/751824-whoami-test-failures-2.3
Merge into: lp:bzr/2.3
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 Pending
Review via email: mp+57436@code.launchpad.net

This proposal supersedes a proposal from 2011-04-06.

Commit message

Tests for no user identity being set must cope with machines that have a mailname.

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.

This was meant to go into 2.3, but in the previous iteration was accidentally merged only to trunk.

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

-----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 : Posted in a previous version of this proposal

    > 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 : Posted in a previous version of this proposal

sent to pqm by email

Revision history for this message
Martin Pool (mbp) wrote :

sent to pqm by email

Revision history for this message
Martin Pool (mbp) 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-13 05:31:30 +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-10 22:20:12 +0000
25+++ bzrlib/tests/blackbox/test_whoami.py 2011-04-13 05:31:30 +0000
26@@ -92,10 +92,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-01-12 16:41:08 +0000
44+++ bzrlib/tests/per_repository/test_commit_builder.py 2011-04-13 05:31:30 +0000
45@@ -19,6 +19,7 @@
46 import os
47
48 from bzrlib import (
49+ config,
50 errors,
51 graph,
52 inventory,
53@@ -1322,6 +1323,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:

Subscribers

People subscribed via source and target branches