* [PATCH 3/3] http-push: update tests
@ 2009-01-17 2:59 Ray Chuan
2009-01-17 5:23 ` Johannes Schindelin
0 siblings, 1 reply; 10+ messages in thread
From: Ray Chuan @ 2009-01-17 2:59 UTC (permalink / raw)
To: git
note: the test needs to chmod the test_repo.git folder so that
apache/mod_dav can create .DAV folders in it for locking.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
src/git-1.6.1/t/t5540-http-push.sh | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/git-1.6.1/t/t5540-http-push.sh
b/src/git-1.6.1/t/t5540-http-push.sh
index da95886..730b9cb 100755
--- a/src/git-1.6.1/t/t5540-http-push.sh
+++ b/src/git-1.6.1/t/t5540-http-push.sh
@@ -51,17 +51,16 @@ test_expect_success 'clone remote repository' '
git clone $HTTPD_URL/test_repo.git test_repo_clone
'
-test_expect_failure 'push to remote repository' '
+test_expect_success 'push to remote repository' '
cd "$ROOT_PATH"/test_repo_clone &&
: >path2 &&
git add path2 &&
test_tick &&
git commit -m path2 &&
- git push &&
- [ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
+ git push origin master
'
-test_expect_failure 'create and delete remote branch' '
+test_expect_success 'create and delete remote branch' '
cd "$ROOT_PATH"/test_repo_clone &&
git checkout -b dev &&
: >path3 &&
--
1.6.0.4
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] http-push: update tests
2009-01-17 2:59 [PATCH 3/3] http-push: update tests Ray Chuan
@ 2009-01-17 5:23 ` Johannes Schindelin
2009-01-17 8:40 ` Ray Chuan
0 siblings, 1 reply; 10+ messages in thread
From: Johannes Schindelin @ 2009-01-17 5:23 UTC (permalink / raw)
To: Ray Chuan; +Cc: git
Hi,
On Sat, 17 Jan 2009, Ray Chuan wrote:
> note: the test needs to chmod the test_repo.git folder so that
> apache/mod_dav can create .DAV folders in it for locking.
Is this supposed to explain ...
> @@ -51,17 +51,16 @@ test_expect_success 'clone remote repository' '
> git clone $HTTPD_URL/test_repo.git test_repo_clone
> '
>
> -test_expect_failure 'push to remote repository' '
> +test_expect_success 'push to remote repository' '
> cd "$ROOT_PATH"/test_repo_clone &&
> : >path2 &&
> git add path2 &&
> test_tick &&
> git commit -m path2 &&
> - git push &&
> - [ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
> + git push origin master
> '
... this removal? I do not think this is a good change, as it removes
a test that is actually pretty important.
BTW I do not understand at all what you mean by "we need to chmod". Does
the Apache instance not run with the current user's permissions?
Ciao,
Dscho
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] http-push: update tests
2009-01-17 5:23 ` Johannes Schindelin
@ 2009-01-17 8:40 ` Ray Chuan
2009-01-17 18:54 ` Junio C Hamano
0 siblings, 1 reply; 10+ messages in thread
From: Ray Chuan @ 2009-01-17 8:40 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
Hi,
On Sat, Jan 17, 2009 at 1:23 PM, Johannes Schindelin
<Johannes.Schindelin@gmx.de> wrote:
> Hi,
>
> On Sat, 17 Jan 2009, Ray Chuan wrote:
>
>> note: the test needs to chmod the test_repo.git folder so that
>> apache/mod_dav can create .DAV folders in it for locking.
>
> Is this supposed to explain ...
>
>> @@ -51,17 +51,16 @@ test_expect_success 'clone remote repository' '
>> git clone $HTTPD_URL/test_repo.git test_repo_clone
>> '
>>
>> -test_expect_failure 'push to remote repository' '
>> +test_expect_success 'push to remote repository' '
>> cd "$ROOT_PATH"/test_repo_clone &&
>> : >path2 &&
>> git add path2 &&
>> test_tick &&
>> git commit -m path2 &&
>> - git push &&
>> - [ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
>> + git push origin master
>> '
>
> ... this removal? I do not think this is a good change, as it removes
> a test that is actually pretty important.
i'm sorry for the poor commit message, what i wanted to do was to
change the tests to expect success rather than failure. no tests were
removed; only their expected outcomes were modified. currently, the
pushes fail, so the test 'fails as expected'; now the pushes succeed,
so they shouldn't be expecting failed pushes (or anything else).
> BTW I do not understand at all what you mean by "we need to chmod". Does
> the Apache instance not run with the current user's permissions?
i wrote 'we need to chmod', cos i'm not sure what the permissions are
required. sorry, i didn't notice that apache was running with the
current user's permissions. but i added the note just in case, for
users who don't run apache with the current user, so they modify the
test appropriately (ie adding a chmod).
> Ciao,
> Dscho
>
--
Cheers,
Ray Chuan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] http-push: update tests
2009-01-17 8:40 ` Ray Chuan
@ 2009-01-17 18:54 ` Junio C Hamano
2009-01-17 19:37 ` Johannes Schindelin
2009-01-17 19:55 ` Ray Chuan
0 siblings, 2 replies; 10+ messages in thread
From: Junio C Hamano @ 2009-01-17 18:54 UTC (permalink / raw)
To: Ray Chuan; +Cc: Johannes Schindelin, git
"Ray Chuan" <rctay89@gmail.com> writes:
>>> -test_expect_failure 'push to remote repository' '
>>> +test_expect_success 'push to remote repository' '
>>> cd "$ROOT_PATH"/test_repo_clone &&
>>> : >path2 &&
>>> git add path2 &&
>>> test_tick &&
>>> git commit -m path2 &&
>>> - git push &&
>>> - [ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
>>> + git push origin master
>>> '
>>
>> ... this removal? I do not think this is a good change, as it removes
>> a test that is actually pretty important.
>
> i'm sorry for the poor commit message, what i wanted to do was to
> change the tests to expect success rather than failure. no tests were
> removed; only their expected outcomes were modified. currently, the
> pushes fail, so the test 'fails as expected'; now the pushes succeed,
> so they shouldn't be expecting failed pushes (or anything else).
The original seems to want the push to succeed, and also it wants the file
refs/heads/master to be present after the push (presumably because there
should be that ref when the push succeeds). If you fixed "push" that used
to fail to succeed, that is great, and s/failure/success/ is a good thing.
But you are removing something else without explanation. Why do you need
to remove the part of the test that checks if refs/heads/master is present?
Is it looking for a file in a wrong place?
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] http-push: update tests
2009-01-17 18:54 ` Junio C Hamano
@ 2009-01-17 19:37 ` Johannes Schindelin
2009-01-17 19:55 ` Ray Chuan
1 sibling, 0 replies; 10+ messages in thread
From: Johannes Schindelin @ 2009-01-17 19:37 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Ray Chuan, git
Hi,
On Sat, 17 Jan 2009, Junio C Hamano wrote:
> The original seems to want the push to succeed, and also it wants the
> file refs/heads/master to be present after the push (presumably because
> there should be that ref when the push succeeds). If you fixed "push"
> that used to fail to succeed, that is great, and s/failure/success/ is a
> good thing.
>
> But you are removing something else without explanation. Why do you
> need to remove the part of the test that checks if refs/heads/master is
> present? Is it looking for a file in a wrong place?
As I mentioned with two other patches, the push does not succeed, and that
is the reason for the "failure" in test_expect_failure.
It does not succeed for two reasons:
- due to an off-by-path_len bug, xmalloc() tries to allocate ~4GB of
memory, which is a bit much, so http-push die()s with an OOM.
- even with that fix, the push fails because it cannot find any common
refs. It cannot find them because it does not download info/refs as it
is supposed to do, but it looks through refs/, missing the fact that the
refs are packed (which it cannot handle).
Ciao,
Dscho
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] http-push: update tests
2009-01-17 18:54 ` Junio C Hamano
2009-01-17 19:37 ` Johannes Schindelin
@ 2009-01-17 19:55 ` Ray Chuan
2009-01-17 20:21 ` Jakub Narebski
1 sibling, 1 reply; 10+ messages in thread
From: Ray Chuan @ 2009-01-17 19:55 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Schindelin, git
Hi,
On Sat, Jan 17, 2009 at 6:54 PM, Junio C Hamano <gitster@pobox.com> wrote:
> "Ray Chuan" <rctay89@gmail.com> writes:
>
>>>> -test_expect_failure 'push to remote repository' '
>>>> +test_expect_success 'push to remote repository' '
>>>> cd "$ROOT_PATH"/test_repo_clone &&
>>>> : >path2 &&
>>>> git add path2 &&
>>>> test_tick &&
>>>> git commit -m path2 &&
>>>> - git push &&
>>>> - [ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
i modified the push arguments as there was no remote ref/branch
specified. With a fixed "git push", that line says:
No refs in common and none specified; doing nothing.
i'd like to take this chance to inquire, what does the -f, plus square
brackets, really mean? i assumed it was to force push to go ahead even
if "a remote ref that is not an ancestor of the local ref used to
overwrite it" check fails.
--
Cheers,
Ray Chuan
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] http-push: update tests
2009-01-17 19:55 ` Ray Chuan
@ 2009-01-17 20:21 ` Jakub Narebski
2009-01-17 21:00 ` Ray Chuan
0 siblings, 1 reply; 10+ messages in thread
From: Jakub Narebski @ 2009-01-17 20:21 UTC (permalink / raw)
To: Ray Chuan; +Cc: Junio C Hamano, Johannes Schindelin, git
"Ray Chuan" <rctay89@gmail.com> writes:
>>>>> - git push &&
>>>>> - [ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
>
> i modified the push arguments as there was no remote ref/branch
> specified. With a fixed "git push", that line says:
>
> No refs in common and none specified; doing nothing.
>
> i'd like to take this chance to inquire, what does the -f, plus square
> brackets, really mean? i assumed it was to force push to go ahead even
> if "a remote ref that is not an ancestor of the local ref used to
> overwrite it" check fails.
Errr...
git push &&
[ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
means, do "git push", and if it succeeds test (which should really be
written as 'test <cond>' and not '[ <cond> ]' I think) if the file
does exists and is regular file ('help test' or 'man test').
--
Jakub Narebski
Poland
ShadeHawk on #git
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] http-push: update tests
2009-01-17 20:21 ` Jakub Narebski
@ 2009-01-17 21:00 ` Ray Chuan
2009-01-17 21:15 ` Jakub Narebski
2009-01-17 21:24 ` Johannes Schindelin
0 siblings, 2 replies; 10+ messages in thread
From: Ray Chuan @ 2009-01-17 21:00 UTC (permalink / raw)
To: Jakub Narebski; +Cc: Junio C Hamano, Johannes Schindelin, git
change tests to expect success.
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
---
t/t5540-http-push.sh | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t5540-http-push.sh b/t/t5540-http-push.sh
index da95886..4acc087 100755
--- a/t/t5540-http-push.sh
+++ b/t/t5540-http-push.sh
@@ -51,17 +51,17 @@ test_expect_success 'clone remote repository' '
git clone $HTTPD_URL/test_repo.git test_repo_clone
'
-test_expect_failure 'push to remote repository' '
+test_expect_success 'push to remote repository' '
cd "$ROOT_PATH"/test_repo_clone &&
: >path2 &&
git add path2 &&
test_tick &&
git commit -m path2 &&
- git push &&
+ git push origin master &&
[ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
'
-test_expect_failure 'create and delete remote branch' '
+test_expect_success 'create and delete remote branch' '
cd "$ROOT_PATH"/test_repo_clone &&
git checkout -b dev &&
: >path3 &&
--
1.5.6.3
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] http-push: update tests
2009-01-17 21:00 ` Ray Chuan
@ 2009-01-17 21:15 ` Jakub Narebski
2009-01-17 21:24 ` Johannes Schindelin
1 sibling, 0 replies; 10+ messages in thread
From: Jakub Narebski @ 2009-01-17 21:15 UTC (permalink / raw)
To: Ray Chuan; +Cc: Junio C Hamano, Johannes Schindelin, git
Ray Chuan wrote:
> Subject: [PATCH 3/3] http-push: update tests
>
> change tests to expect success.
Minor nit: I would use here
Subject: [PATCH 3/3] http-push: change tests to expect success
--
Jakub Narebski
Poland
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] http-push: update tests
2009-01-17 21:00 ` Ray Chuan
2009-01-17 21:15 ` Jakub Narebski
@ 2009-01-17 21:24 ` Johannes Schindelin
1 sibling, 0 replies; 10+ messages in thread
From: Johannes Schindelin @ 2009-01-17 21:24 UTC (permalink / raw)
To: Ray Chuan; +Cc: Jakub Narebski, Junio C Hamano, git
Hi,
On Sat, 17 Jan 2009, Ray Chuan wrote:
> -test_expect_failure 'push to remote repository' '
> +test_expect_success 'push to remote repository' '
> cd "$ROOT_PATH"/test_repo_clone &&
> : >path2 &&
> git add path2 &&
> test_tick &&
> git commit -m path2 &&
> - git push &&
> + git push origin master &&
> [ -f "$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git/refs/heads/master" ]
> '
But it _should_ succeed without <remote> <branch>. It should find that
there is a master locally and one remotely, and push that.
Ciao,
Dscho
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2009-01-17 21:24 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-17 2:59 [PATCH 3/3] http-push: update tests Ray Chuan
2009-01-17 5:23 ` Johannes Schindelin
2009-01-17 8:40 ` Ray Chuan
2009-01-17 18:54 ` Junio C Hamano
2009-01-17 19:37 ` Johannes Schindelin
2009-01-17 19:55 ` Ray Chuan
2009-01-17 20:21 ` Jakub Narebski
2009-01-17 21:00 ` Ray Chuan
2009-01-17 21:15 ` Jakub Narebski
2009-01-17 21:24 ` Johannes Schindelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).