vcssync: expose overlay-hg-repos cli to tests (bug 1340031) r?smacleod draft
authorbyron jones <glob@mozilla.com>
Thu, 16 Feb 2017 13:46:28 +0800
changeset 10412 2c075f505effb84e94e28049079aa2864fab1227
parent 10411 e01531f0d4e1a3d4ea0b7de00c740ba1376f1eda
child 10413 e44c6c792b6799df4783d596a0f9cf4c9a7d9931
push id1532
push userbjones@mozilla.com
push dateThu, 16 Feb 2017 06:19:37 +0000
reviewerssmacleod
bugs1340031
vcssync: expose overlay-hg-repos cli to tests (bug 1340031) r?smacleod overlay-hg-repos wasn't callable from tests, causing failures. MozReview-Commit-ID: CbdyUYxbuHl
vcssync/tests/helpers.sh
--- a/vcssync/tests/helpers.sh
+++ b/vcssync/tests/helpers.sh
@@ -1,14 +1,24 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 . $TESTDIR/hgserver/tests/helpers.sh
 
+# create overlay-hg-repos cli
+cat > $TESTTMP/overlay-hg-repos <<EOF
+#!$TESTDIR/venv/bin/python
+import sys
+from mozvcssync.cli import overlay_hg_repos_cli
+sys.exit(overlay_hg_repos_cli())
+EOF
+chmod +x $TESTTMP/overlay-hg-repos
+alias overlay-hg-repos=$TESTTMP/overlay-hg-repos
+
 # make git commits deterministic and environment agnostic
 export GIT_AUTHOR_NAME=test
 export GIT_AUTHOR_EMAIL=test@example.com
 export GIT_AUTHOR_DATE='Thu Jan 1 00:00:00 1970 +0000'
 export GIT_COMMITTER_NAME=test
 export GIT_COMMITTER_EMAIL=test@example.com
 export GIT_COMMITTER_DATE='Thu Jan 1 00:00:00 1970 +0000'