Add integration test for mononokeapi

Summary:
Add an integration test that talks to the API server from remotefilelog.

Since this involves running a local instance of Mononoke and the API server, I've added it to Mononoke's integration tests rather than Mercurial's integration tests in order to re-use the setup code from Mononoke's tests. Since the server is running locally, and would use a different SSL setup that the VIP that hg would normally access it through, the local API server is run without SSL enabled.

Reviewed By: Anastasiya-Zhyrkevich, farnz

Differential Revision: D13089196

fbshipit-source-id: 01f415d8ee7173f7f2ab3a234565fd79d618126e
This commit is contained in:
Arun Kulshreshtha 2018-12-03 17:44:41 -08:00 committed by Facebook Github Bot
parent bd7246dcf7
commit 5f10031e48

View File

@ -0,0 +1,36 @@
$ CACHEDIR=$PWD/cachepath
$ . $TESTDIR/library.sh
Set up local hgrc and Mononoke config repo
$ setup_common_config
$ cd $TESTTMP
Initialize test repo
$ hginit_treemanifest repo-hg
$ cd repo-hg
$ setup_hg_server
Populate test repo
$ echo "test content" > test.txt
$ hg commit -Aqm "test commit"
$ hg bookmarks -r tip master_bookmark
Blobimport test repo
$ cd ..
$ blobimport rocksdb repo-hg/.hg repo
Start API server
$ APISERVER_PORT=$(get_free_socket)
$ no_ssl_apiserver -H "127.0.0.1" -p $APISERVER_PORT
$ wait_for_apiserver --no-ssl
Enable Mononoke API for Mercurial client
$ cd repo-hg
$ cat >> $HGRCPATH <<EOF
> [mononoke-api]
> enabled = true
> host = $APISERVER
> EOF
$ hg debugmononokeapi
success