git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Khalid Ali <khalludi123@gmail.com>
To: git@vger.kernel.org
Cc: Khalid Ali <khalludi123@gmail.com>
Subject: [GSoC][PATCH v1] t9811: avoid pipe in git commands in test script
Date: Mon,  1 Apr 2019 21:41:15 -0400	[thread overview]
Message-ID: <20190402014115.22478-1-khalludi123@gmail.com> (raw)

The exit code of the upstream in a pipe is ignored thus we
should avoid using it. By writing out the output of the git command to a
file, we can test the exit codes of both the commands.

Aside from the commit message, I plan to apply for GSoC. Planning to
solve the rebase/cherry-pick issue or adding functionality for the
rebase interactive command. 

Any review on this commit would be appreciated!

Signed-off-by: Khalid Ali <khalludi123@gmail.com>
---
 t/t9811-git-p4-label-import.sh | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/t/t9811-git-p4-label-import.sh b/t/t9811-git-p4-label-import.sh
index 602b0a5d5c..2f4e80ed55 100755
--- a/t/t9811-git-p4-label-import.sh
+++ b/t/t9811-git-p4-label-import.sh
@@ -63,7 +63,8 @@ test_expect_success 'basic p4 labels' '
 		git checkout TAG_WITH\$_SHELL_CHAR &&
 		test -f f1 && test -f f2 && test -f file_with_\$metachar &&
 
-		git show TAG_LONG_LABEL | grep -q "A Label second line"
+		git show TAG_LONG_LABEL >actual &&
+		grep -q "A Label second line" actual
 	)
 '
 # Test some label corner cases:
@@ -92,9 +93,9 @@ test_expect_success 'two labels on the same changelist' '
 		cd "$git" &&
 		git p4 sync --import-labels &&
 
-		git tag | grep TAG_F1 &&
-		git tag | grep -q TAG_F1_1 &&
-		git tag | grep -q TAG_F1_2 &&
+		git tag >actual && grep TAG_F1 actual &&
+		git tag >actual && grep -q TAG_F1_1 actual &&
+		git tag >actual && grep -q TAG_F1_2 actual &&
 
 		cd main &&
 
@@ -205,7 +206,7 @@ test_expect_success 'use git config to enable import/export of tags' '
 		git p4 rebase --verbose &&
 		git p4 submit --verbose &&
 		git tag &&
-		git tag | grep TAG_F1_1
+		git tag >actual && grep TAG_F1_1 actual
 	) &&
 	(
 		cd "$cli" &&
-- 
2.21.0.196.g041f5ea1cf


             reply	other threads:[~2019-04-02  1:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-02  1:41 Khalid Ali [this message]
2019-04-02  2:39 ` [GSoC][PATCH v1] t9811: avoid pipe in git commands in test script Junio C Hamano
2019-04-02 20:52   ` Khalid Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190402014115.22478-1-khalludi123@gmail.com \
    --to=khalludi123@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).