threads / patch / 36451

patcht5801 (remote-helpers): cleanup environment sets

Subject: [PATCH] t5801 (remote-helpers): cleanup environment sets

## tl;dr

2 messages between Apr 20, 2014 and Apr 20, 2014. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Felipe Contreras· Apr 20, 2014, 18:43 UTC · lore

Commit 512477b (tests: use "env" to run commands with temporary env-var settings) missed some variables in the remote-helpers test. Also standardize these.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 t/t5801-remote-helpers.sh | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
Show changes to t/t5801-remote-helpers.sh +7 −8
diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
index 25fd2e7..42d1c66 100755
--- a/t/t5801-remote-helpers.sh
+++ b/t/t5801-remote-helpers.sh
@@ -212,19 +212,17 @@ test_expect_success 'push update refs failure' '
 	echo "update fail" >>file &&
 	git commit -a -m "update fail" &&
 	git rev-parse --verify testgit/origin/heads/update >expect &&
-	GIT_REMOTE_TESTGIT_PUSH_ERROR="non-fast forward" &&
-	export GIT_REMOTE_TESTGIT_PUSH_ERROR &&
-	test_expect_code 1 git push origin update &&
+	test_expect_code 1 env GIT_REMOTE_TESTGIT_FAILURE="non-fast forward" \
+	git push origin update &&
 	git rev-parse --verify testgit/origin/heads/update >actual &&
 	test_cmp expect actual
 	)
 '
 
 test_expect_success 'proper failure checks for fetching' '
-	(GIT_REMOTE_TESTGIT_FAILURE=1 &&
-	export GIT_REMOTE_TESTGIT_FAILURE &&
-	cd local &&
-	test_must_fail git fetch 2> error &&
+	(cd local &&
+	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 \
+	git fetch 2> error &&
 	cat error &&
 	grep -q "Error while running fast-import" error
 	)
@@ -232,7 +230,8 @@ test_expect_success 'proper failure checks for fetching' '
 
 test_expect_success 'proper failure checks for pushing' '
 	(cd local &&
-	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all
+	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 \
+	git push --all
 	)
 '
 
-- 
1.9.1+fc3.9.gc73078e
Junio C Hamano· Apr 20, 2014, 22:15 UTC · re: Felipe Contreras · lore

Re: [PATCH] t5801 (remote-helpers): cleanup environment sets

Felipe Contreras <felipe.contreras@gmail.com> writes:
Show 5 quoted lines
> Commit 512477b (tests: use "env" to run commands with temporary env-var
> settings) missed some variables in the remote-helpers test. Also
> standardize these.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>

Good. I was wondering about these myself when juggling some series that touched this file the other day.

Will queue.  Thanks.
Show 42 quoted lines
> ---
>  t/t5801-remote-helpers.sh | 15 +++++++--------
>  1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/t/t5801-remote-helpers.sh b/t/t5801-remote-helpers.sh
> index 25fd2e7..42d1c66 100755
> --- a/t/t5801-remote-helpers.sh
> +++ b/t/t5801-remote-helpers.sh
> @@ -212,19 +212,17 @@ test_expect_success 'push update refs failure' '
>  	echo "update fail" >>file &&
>  	git commit -a -m "update fail" &&
>  	git rev-parse --verify testgit/origin/heads/update >expect &&
> -	GIT_REMOTE_TESTGIT_PUSH_ERROR="non-fast forward" &&
> -	export GIT_REMOTE_TESTGIT_PUSH_ERROR &&
> -	test_expect_code 1 git push origin update &&
> +	test_expect_code 1 env GIT_REMOTE_TESTGIT_FAILURE="non-fast forward" \
> +	git push origin update &&
>  	git rev-parse --verify testgit/origin/heads/update >actual &&
>  	test_cmp expect actual
>  	)
>  '
>  
>  test_expect_success 'proper failure checks for fetching' '
> -	(GIT_REMOTE_TESTGIT_FAILURE=1 &&
> -	export GIT_REMOTE_TESTGIT_FAILURE &&
> -	cd local &&
> -	test_must_fail git fetch 2> error &&
> +	(cd local &&
> +	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 \
> +	git fetch 2> error &&
>  	cat error &&
>  	grep -q "Error while running fast-import" error
>  	)
> @@ -232,7 +230,8 @@ test_expect_success 'proper failure checks for fetching' '
>  
>  test_expect_success 'proper failure checks for pushing' '
>  	(cd local &&
> -	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 git push --all
> +	test_must_fail env GIT_REMOTE_TESTGIT_FAILURE=1 \
> +	git push --all
>  	)
>  '

← back to recent threads