sapling/tests/test-lfs-test-server.t
Jun Wu 67f97aa1d3 lfs: add an integration test with lfs-test-server
Summary:
lfs-test-server is a reference implementation by GitHub [1]. Testing against it
will give us more confidence.

[1]: https://github.com/git-lfs/lfs-test-server

Test Plan: Added a test

Reviewers: #mercurial, davidsp

Reviewed By: davidsp

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D5009346

Signature: t1:5009346:1494042196:86e8c2e0e5c4296b1afc72efa84a9c1b9030e6fc
2017-05-08 11:13:12 -07:00

50 lines
1.2 KiB
Perl

Require lfs-test-server (https://github.com/git-lfs/lfs-test-server)
$ hash lfs-test-server || { echo 'skipped: missing lfs-test-server'; exit 80; }
$ LFS_LISTEN="tcp://:$HGPORT"
$ LFS_HOST="localhost:$HGPORT"
$ LFS_PUBLIC=1
$ export LFS_LISTEN LFS_HOST LFS_PUBLIC
$ lfs-test-server &> lfs-server.log &
$ echo $! >> $DAEMON_PIDS
$ cat >> $HGRCPATH <<EOF
> [extensions]
> lfs=$TESTDIR/../hgext3rd/lfs
> [lfs]
> url=http://foo:bar@$LFS_HOST/
> threshold=1
> EOF
$ hg init repo1
$ cd repo1
$ echo THIS-IS-LFS > a
$ hg commit -m a -A a
$ hg init ../repo2
$ hg push ../repo2 -v
pushing to ../repo2
searching for changes
lfs: computing set of blobs to upload
lfs: need to upload 1 objects (12 bytes)
lfs: mapping blobs to upload URLs
lfs: upload completed
1 changesets found
uncompressed size of bundle content:
* (changelog) (glob)
* (manifests) (glob)
* a (glob)
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
$ cd ../repo2
$ hg update tip -v
resolving manifests
getting a
lfs: mapping blobs to download URLs
lfs: download completed
1 files updated, 0 files merged, 0 files removed, 0 files unresolved