List for cgit developers and users
 help / color / mirror / Atom feed
* [PATCH] t0109: chain operations with &&
@ 2013-04-10 12:11 john
  2013-04-10 12:14 ` Jason
  2013-04-10 12:16 ` Jason
  0 siblings, 2 replies; 4+ messages in thread
From: john @ 2013-04-10 12:11 UTC (permalink / raw)


Without '&&' between operations, we will not detect if strace or cgit
exit with an error status, which would cause a false positive test
status in this case.

Signed-off-by: John Keeping <john at keeping.me.uk>
---
 tests/t0109-gitconfig.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/t0109-gitconfig.sh b/tests/t0109-gitconfig.sh
index cdd570b..f64e691 100755
--- a/tests/t0109-gitconfig.sh
+++ b/tests/t0109-gitconfig.sh
@@ -18,7 +18,7 @@ test_expect_success 'no access to $HOME' '
 		-E HOME="$non_existant_path" \
 		-E CGIT_CONFIG="$PWD/cgitrc" \
 		-E QUERY_STRING="url=foo/commit" \
-		-e access -f -o strace.out cgit
+		-e access -f -o strace.out cgit &&
 	test_must_fail grep "$non_existant_path" strace.out
 '
 
-- 
1.8.2.694.ga76e9c3.dirty





^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] t0109: chain operations with &&
  2013-04-10 12:11 [PATCH] t0109: chain operations with && john
@ 2013-04-10 12:14 ` Jason
  2013-04-10 12:16 ` Jason
  1 sibling, 0 replies; 4+ messages in thread
From: Jason @ 2013-04-10 12:14 UTC (permalink / raw)


Thanks. Merged.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] t0109: chain operations with &&
  2013-04-10 12:11 [PATCH] t0109: chain operations with && john
  2013-04-10 12:14 ` Jason
@ 2013-04-10 12:16 ` Jason
  2013-04-10 22:40   ` john
  1 sibling, 1 reply; 4+ messages in thread
From: Jason @ 2013-04-10 12:16 UTC (permalink / raw)


On Wed, Apr 10, 2013 at 2:11 PM, John Keeping <john at keeping.me.uk> wrote:
> Without '&&' between operations, we will not detect if strace or cgit
> exit with an error status, which would cause a false positive test
> status in this case.

I wonder if for some of the larger && chains in other tests "set -e"
would be a bit cleaner. I don't know if setting that inside the test
string will bubble the setting back up to the test harness (which
would be bad) or if it would be local for the test (which would be
ideal). Something to investigate.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] t0109: chain operations with &&
  2013-04-10 12:16 ` Jason
@ 2013-04-10 22:40   ` john
  0 siblings, 0 replies; 4+ messages in thread
From: john @ 2013-04-10 22:40 UTC (permalink / raw)


On Wed, Apr 10, 2013 at 02:16:44PM +0200, Jason A. Donenfeld wrote:
> On Wed, Apr 10, 2013 at 2:11 PM, John Keeping <john at keeping.me.uk> wrote:
> > Without '&&' between operations, we will not detect if strace or cgit
> > exit with an error status, which would cause a false positive test
> > status in this case.
> 
> I wonder if for some of the larger && chains in other tests "set -e"
> would be a bit cleaner. I don't know if setting that inside the test
> string will bubble the setting back up to the test harness (which
> would be bad) or if it would be local for the test (which would be
> ideal). Something to investigate.

I expect if it was that easy, the tests in Git would take an approach
more like that.  Personally, I have found in the past that using
"set -e" often leads to problems later on, so I would prefer to keep the
&&-chain.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-04-10 22:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-10 12:11 [PATCH] t0109: chain operations with && john
2013-04-10 12:14 ` Jason
2013-04-10 12:16 ` Jason
2013-04-10 22:40   ` john

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).