Patchwork D10732: tests: add req on bash for test-transaction-rollback-on-sigpipe (issue6429)

login
register
mail settings
Submitter phabricator
Date May 18, 2021, 5:55 p.m.
Message ID <differential-rev-PHID-DREV-2bsrqv7payr5x6tvls3l-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/49053/
State Superseded
Headers show

Comments

phabricator - May 18, 2021, 5:55 p.m.
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I think we could work around this by rewriting the helper scripts in
  Python, but I don't want to deal with that now and this should prevent
  failures due to a lack of bash.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10732

AFFECTED FILES
  tests/hghave.py
  tests/test-transaction-rollback-on-sigpipe.t

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-transaction-rollback-on-sigpipe.t b/tests/test-transaction-rollback-on-sigpipe.t
--- a/tests/test-transaction-rollback-on-sigpipe.t
+++ b/tests/test-transaction-rollback-on-sigpipe.t
@@ -1,3 +1,4 @@ 
+#require bash
 Test that, when an hg push is interrupted and the remote side recieves SIGPIPE,
 the remote hg is able to successfully roll back the transaction.
 
diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -1121,3 +1121,8 @@ 
         return True
     except ImportError:
         return False
+
+
+@check("bash", "bash shell")
+def has_bash():
+    return matchoutput("bash -c 'echo hi'", b'^hi$')