sapling/tests/test-fb-hgext-commitcloud-sync-autojoin.t
Liubov Dmitrieva ac401b9d9f commitcloud: trigger a backup to a secondary storage after cloud sync in the background
Summary:
We can't run in parallel at the moment as the log file and the lock file are
shared.

Every path maintains independent backup state (the previous diff).

The secondary backup state doesn't affect smartlog (only the main one)

The issue with this approach is that we maintain backup lock a bit longer.

Unfortunately, the progress in smartlog doesn't show anything about the second backup.

I added 'finished', it makes it easier to compare in the logs.

Reviewed By: markbt

Differential Revision: D14149399

fbshipit-source-id: f90e8aac6cb8dee53d5c7468bd6adba067e13362
2019-02-20 15:36:29 -08:00

56 lines
1.8 KiB
Perl

$ . $TESTDIR/infinitepush/library.sh
$ enable amend directaccess commitcloud infinitepush infinitepushbackup share
$ setconfig ui.ssh="python \"$TESTDIR/dummyssh\""
$ setconfig commitcloud.hostname=testhost
$ cat > $TESTTMP/.commitcloudrc <<EOF
> [commitcloud]
> user_token=xxxxx
> EOF
$ newrepo server
$ setconfig infinitepush.server=yes infinitepush.indextype=disk infinitepush.storetype=disk
$ setconfig infinitepush.reponame=testrepo
$ echo base > base
$ hg commit -Aqm base
$ cd $TESTTMP
$ hg clone ssh://user@dummy/server client1 -q
$ cd client1
$ setconfig commitcloud.servicetype=local commitcloud.servicelocation="$TESTTMP"
$ setconfig commitcloud.user_token_path="$TESTTMP"
Normally pushbackup doesn't connect to commit cloud sync
$ hg pushbackup --background
$ waitbgbackup
$ test -f .hg/store/commitcloudrc
[1]
Set autocloud join, now pushbackup does connect to commit cloud sync
$ setconfig commitcloud.autocloudjoin=true
$ hg pushbackup --background
$ waitbgbackup
$ cat .hg/store/commitcloudrc
[commitcloud]
current_workspace=user/test/default
Deliberately disconnect. Auto cloud join shouldn't make us reconect.
$ hg cloud leave
#commitcloud this repository is now disconnected from commit cloud
$ cat .hg/store/commitcloudrc
[commitcloud]
disconnected=true
$ hg pushbackup --background
$ waitbgbackup
$ cat .hg/store/commitcloudrc
[commitcloud]
disconnected=true
But we can manually reconnect
$ hg cloud join
#commitcloud this repository is now connected to the 'user/test/default' workspace for the 'server' repo
#commitcloud synchronizing 'server' with 'user/test/default'
#commitcloud commits synchronized
finished in * (glob)
$ cat .hg/store/commitcloudrc
[commitcloud]
current_workspace=user/test/default