[PATCH 0/3] test: cleanups

6 views
Skip to first unread message

Felipe Contreras

unread,
Jun 1, 2013, 9:21:25 AM6/1/13
to giti...@googlegroups.com, Dusty Phillips, Felipe Contreras
Hi,

Here are a bit more cleanups for the testing stuff.

Felipe Contreras (3):
test: fix URLs
test: simplify python path stuff
test: simplify testgitifyhg hack

git-remote-testgitifyhg | 19 -------------------
test/git-remote-gitifyhg | 7 +++++++
test/test-lib.sh | 5 ++++-
test/test_anonymous_branches.t | 4 ++--
test/test_special_cases.t | 2 +-
5 files changed, 14 insertions(+), 23 deletions(-)
delete mode 100755 git-remote-testgitifyhg
create mode 100755 test/git-remote-gitifyhg

--
1.8.3.358.g5a91d05

Felipe Contreras

unread,
Jun 1, 2013, 9:21:26 AM6/1/13
to giti...@googlegroups.com, Dusty Phillips, Felipe Contreras
We should not be testing the installed one.

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
test/test_notes.t | 2 +-
test/test_pull.t | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/test_notes.t b/test/test_notes.t
index 5319a5f..de4ea19 100755
--- a/test/test_notes.t
+++ b/test/test_notes.t
@@ -54,7 +54,7 @@ test_expect_success 'pull notes rename remote' '
mkdir git_clone &&
cd git_clone &&
git init &&
- git remote add --fetch the_remote gitifyhg::../hg_repo &&
+ git remote add --fetch the_remote testgitifyhg::../hg_repo &&
git pull the_remote master &&
assert_git_messages "a" &&
cd ../hg_repo &&
diff --git a/test/test_pull.t b/test/test_pull.t
index 06347d5..4367bc3 100755
--- a/test/test_pull.t
+++ b/test/test_pull.t
@@ -35,7 +35,7 @@ test_expect_success 'pull named remote' '
mkdir git_repo &&
cd git_repo &&
git init &&
- git remote add --fetch the_remote gitifyhg::../hg_repo
+ git remote add --fetch the_remote testgitifyhg::../hg_repo
git pull the_remote master &&
assert_git_messages a &&
cd ../hg_repo &&
--
1.8.3.358.g5a91d05

Felipe Contreras

unread,
Jun 1, 2013, 9:21:27 AM6/1/13
to giti...@googlegroups.com, Dusty Phillips, Felipe Contreras
Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
git-remote-testgitifyhg | 16 ++--------------
test/test-lib.sh | 1 +
2 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/git-remote-testgitifyhg b/git-remote-testgitifyhg
index 6a677a4..c261329 100755
--- a/git-remote-testgitifyhg
+++ b/git-remote-testgitifyhg
@@ -2,18 +2,6 @@
#
# This bin script is intended only for testing.
# It will not be used by the installed egg.
-#
-# For testing, just put the path to this bin script ahead of all
-# others, e.g.:
-# export PATH=/path/to/gitifyhg/bin:$PATH
-
-import os
-import sys
-
-# Set up sys.path so our package is before all others
-# (including eggs of ourselves that have been installed).
-bindir = os.path.dirname(__file__)
-sys.path.insert(1, os.path.abspath(os.path.join(bindir, "..")))

-from gitifyhg import gitifyhg
-gitifyhg.main()
+import gitifyhg.gitifyhg
+gitifyhg.gitifyhg.main()
diff --git a/test/test-lib.sh b/test/test-lib.sh
index cd5c4b0..b009392 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -11,6 +11,7 @@ export GIT_PAGER=cat
export HGRCPATH="$HOME/.hgrc"
export NL='
'
+export PYTHONPATH="$SHARNESS_BUILD_DIRECTORY"

make_hg_repo() {
hg init hg_repo &&
--
1.8.3.358.g5a91d05

Felipe Contreras

unread,
Jun 1, 2013, 9:21:28 AM6/1/13
to giti...@googlegroups.com, Dusty Phillips, Felipe Contreras
Move it to the 'test' directory so it's clear what's its purpose, and
rename it so the tests use less hacky URLs.

Signed-off-by: Felipe Contreras <felipe.c...@gmail.com>
---
git-remote-testgitifyhg | 7 -------
test/git-remote-gitifyhg | 7 +++++++
test/test-lib.sh | 6 ++++--
test/test_anonymous_branches.t | 4 ++--
test/test_notes.t | 2 +-
test/test_pull.t | 2 +-
test/test_special_cases.t | 2 +-
7 files changed, 16 insertions(+), 14 deletions(-)
delete mode 100755 git-remote-testgitifyhg
create mode 100755 test/git-remote-gitifyhg

diff --git a/git-remote-testgitifyhg b/git-remote-testgitifyhg
deleted file mode 100755
index c261329..0000000
--- a/git-remote-testgitifyhg
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env python
-#
-# This bin script is intended only for testing.
-# It will not be used by the installed egg.
-
-import gitifyhg.gitifyhg
-gitifyhg.gitifyhg.main()
diff --git a/test/git-remote-gitifyhg b/test/git-remote-gitifyhg
new file mode 100755
index 0000000..c261329
--- /dev/null
+++ b/test/git-remote-gitifyhg
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+#
+# This bin script is intended only for testing.
+# It will not be used by the installed egg.
+
+import gitifyhg.gitifyhg
+gitifyhg.gitifyhg.main()
diff --git a/test/test-lib.sh b/test/test-lib.sh
index b009392..a738efa 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -1,5 +1,7 @@
#!/bin/sh

+: ${SHARNESS_BUILD_DIRECTORY:=$(pwd)}
+
. ./sharness.sh

export GIT_AUTHOR_EMAIL=git....@example.com
@@ -11,7 +13,7 @@ export GIT_PAGER=cat
export HGRCPATH="$HOME/.hgrc"
export NL='
'
-export PYTHONPATH="$SHARNESS_BUILD_DIRECTORY"
+export PYTHONPATH="$SHARNESS_BUILD_DIRECTORY/.."

make_hg_repo() {
hg init hg_repo &&
@@ -23,7 +25,7 @@ make_hg_repo() {

clone_repo() {
cd .. &&
- test_expect_code 0 git clone "testgitifyhg::hg_repo" git_clone &&
+ test_expect_code 0 git clone "gitifyhg::hg_repo" git_clone &&
cd git_clone &&
git config user.email $GIT_AUTHOR_EMAIL &&
git config user.name "$GIT_USER"
diff --git a/test/test_anonymous_branches.t b/test/test_anonymous_branches.t
index 09f23d1..dbdf4e2 100755
--- a/test/test_anonymous_branches.t
+++ b/test/test_anonymous_branches.t
@@ -23,7 +23,7 @@ test_expect_failure 'anonymous branches dont work' '
make_hg_commit c test_file &&
cd .. &&

- git clone testgitifyhg::hg_repo git_clone 2>&1 | grep "more than one head" &&
+ git clone gitifyhg::hg_repo git_clone 2>&1 | grep "more than one head" &&

# TODO: "more than one head" is the correct response for now, but a more
# appropriate result would be to clone the extra commits, perhaps naming
@@ -47,7 +47,7 @@ test_expect_failure 'anonymous branch from named branch' '
make_hg_commit e test_file &&

cd .. &&
- git clone testgitifyhg::hg_repo git_clone 2>&1 | grep "more than one head" &&
+ git clone gitifyhg::hg_repo git_clone 2>&1 | grep "more than one head" &&
cd git_clone &&
test "`git branch -r`" = " origin/HEAD -> origin/master
origin/branches/featurebranch
diff --git a/test/test_notes.t b/test/test_notes.t
index de4ea19..5319a5f 100755
--- a/test/test_notes.t
+++ b/test/test_notes.t
@@ -54,7 +54,7 @@ test_expect_success 'pull notes rename remote' '
mkdir git_clone &&
cd git_clone &&
git init &&
- git remote add --fetch the_remote testgitifyhg::../hg_repo &&
+ git remote add --fetch the_remote gitifyhg::../hg_repo &&
git pull the_remote master &&
assert_git_messages "a" &&
cd ../hg_repo &&
diff --git a/test/test_pull.t b/test/test_pull.t
index 4367bc3..06347d5 100755
--- a/test/test_pull.t
+++ b/test/test_pull.t
@@ -35,7 +35,7 @@ test_expect_success 'pull named remote' '
mkdir git_repo &&
cd git_repo &&
git init &&
- git remote add --fetch the_remote testgitifyhg::../hg_repo
+ git remote add --fetch the_remote gitifyhg::../hg_repo
git pull the_remote master &&
assert_git_messages a &&
cd ../hg_repo &&
diff --git a/test/test_special_cases.t b/test/test_special_cases.t
index 72ec040..95d3db1 100755
--- a/test/test_special_cases.t
+++ b/test/test_special_cases.t
@@ -38,7 +38,7 @@ test_expect_success 'unicode paths' '
hg add file${SB} &&
hg commit -m ${SB} --user="$HG_USER" &&
cd .. &&
- git clone testgitifyhg::hg${SB}repo git${SB}clone &&
+ git clone gitifyhg::hg${SB}repo git${SB}clone &&
cd git${SB}clone &&
git config user.email $GIT_AUTHOR_EMAIL &&
git config user.name "$GIT_USER"
--
1.8.3.358.g5a91d05

Felipe Contreras

unread,
Jun 1, 2013, 9:25:20 AM6/1/13
to giti...@googlegroups.com, Dusty Phillips, Felipe Contreras
On Sat, Jun 1, 2013 at 8:21 AM, Felipe Contreras
<felipe.c...@gmail.com> wrote:

> Here are a bit more cleanups for the testing stuff.

Here's the pull request.

https://github.com/buchuki/gitifyhg/pull/91

--
Felipe Contreras

Felipe Contreras

unread,
Aug 23, 2013, 9:49:57 PM8/23/13
to giti...@googlegroups.com, Dusty Phillips, Felipe Contreras
On Sat, Jun 1, 2013 at 8:25 AM, Felipe Contreras
<felipe.c...@gmail.com> wrote:
> On Sat, Jun 1, 2013 at 8:21 AM, Felipe Contreras
> <felipe.c...@gmail.com> wrote:
>
>> Here are a bit more cleanups for the testing stuff.
>
> Here's the pull request.
>
> https://github.com/buchuki/gitifyhg/pull/91

Hello?

I haven't seen any activity on the gitifyhg side. What's going on?

Have you reconsidered contributing directly to git-remote-hg? As I've
shown multiple times, there isn't a single feature of gitifyhg that
git-remote-hg doesn't have, and there's many that git-remote-hg does
have, that gitifyhg doesn't.

At the very least we could share the test framework.

--
Felipe Contreras

Dusty Phillips

unread,
Aug 23, 2013, 10:50:10 PM8/23/13
to Felipe Contreras, giti...@googlegroups.com
My company has started using Kiln, which is doing a (reasonably) good
job of git to hg transformation, so my previous energy in maintaining a
git client to mercurial has been directed to other open source projects.

Good to hear that the numerous problems I had with git-remote-hg have
been solved, though! I'll add a link to the gitifyhg README suggesting
users try the git-remote-hg.

Dusty

Felipe Contreras

unread,
Aug 23, 2013, 11:17:57 PM8/23/13
to Dusty Phillips, giti...@googlegroups.com
On Fri, Aug 23, 2013 at 9:50 PM, Dusty Phillips <du...@buchuki.com> wrote:
> On 08/23/2013 07:49 PM, Felipe Contreras wrote:
>>
>> On Sat, Jun 1, 2013 at 8:25 AM, Felipe Contreras
>> <felipe.c...@gmail.com> wrote:
>>>
>>> On Sat, Jun 1, 2013 at 8:21 AM, Felipe Contreras
>>> <felipe.c...@gmail.com> wrote:
>>>
>>>> Here are a bit more cleanups for the testing stuff.
>>>
>>> Here's the pull request.
>>>
>>> https://github.com/buchuki/gitifyhg/pull/91
>>
>> Hello?
>>
>> I haven't seen any activity on the gitifyhg side. What's going on?
>>
>> Have you reconsidered contributing directly to git-remote-hg? As I've
>> shown multiple times, there isn't a single feature of gitifyhg that
>> git-remote-hg doesn't have, and there's many that git-remote-hg does
>> have, that gitifyhg doesn't.
>>
>> At the very least we could share the test framework.
>>
> My company has started using Kiln, which is doing a (reasonably) good job of
> git to hg transformation, so my previous energy in maintaining a git client
> to mercurial has been directed to other open source projects.

I see, I haven't tried Kiln, but at least I know it has a bug with
timestamps that git-remote-hg doesn't have.

> Good to hear that the numerous problems I had with git-remote-hg have been
> solved, though! I'll add a link to the gitifyhg README suggesting users try
> the git-remote-hg.

Good to know. Hopefully other gitifyhg developers help to migrate the
testing framework so there's a single project for this effort.

--
Felipe Contreras
Reply all
Reply to author
Forward
0 new messages