Skip to content

Commit

Permalink
tests: modernize a few more tests
Browse files Browse the repository at this point in the history
Reviewed By: sggutier

Differential Revision: D62680615

fbshipit-source-id: 54278504f768839e5ef64dd4052c202d22037098
  • Loading branch information
muirdm authored and facebook-github-bot committed Oct 1, 2024
1 parent 130a712 commit 317bbb4
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 105 deletions.
79 changes: 24 additions & 55 deletions eden/scm/tests/test-commitcloud-sync-rb-enabling.t
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#modern-config-incompatible
#inprocess-hg-incompatible

#require no-eden


$ enable amend commitcloud infinitepush remotenames
$ configure dummyssh
$ setconfig commitcloud.hostname=testhost
Expand Down Expand Up @@ -32,15 +28,8 @@ Set remotebookmarkssync True initially for the first repo and False for the seco
$ setconfig commitcloud.remotebookmarkssync=True
$ setconfig commitcloud.servicetype=local commitcloud.servicelocation=$TESTTMP
$ hg pull -q
$ 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: nothing to upload
commitcloud: commits synchronized
finished in 0.00 sec
$ showgraph
@ base: public default/base default/master

@ base: public remote/base remote/master
$ cd $TESTTMP
$ clone server client2
$ cd client2
Expand All @@ -49,15 +38,8 @@ Set remotebookmarkssync True initially for the first repo and False for the seco
$ setconfig commitcloud.remotebookmarkssync=False
$ setconfig commitcloud.servicetype=local commitcloud.servicelocation=$TESTTMP
$ hg pull -q
$ 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: nothing to upload
commitcloud: commits synchronized
finished in 0.00 sec
$ showgraph
@ base: public default/base default/master

@ base: public remote/base remote/master

Advance master
$ cd $TESTTMP/server
Expand All @@ -69,43 +51,38 @@ Pull in client1 (remote bookmarks sync enabled)
$ hg pull -q
$ hg cloud sync -q
$ showgraph
o public1: public default/master
o public1: public remote/master
@ base: public default/base

@ base: public remote/base

Sync in client2 (remote bookmarks sync disabled). The master bookmark doesn't move
$ cd $TESTTMP/client2
$ hg cloud sync -q
$ showgraph
@ base: public default/base default/master

@ base: public remote/base remote/master

Sync in client2 with sync enabled
$ hg cloud sync -q --config commitcloud.remotebookmarkssync=true
$ showgraph
o public1: public default/master
o public1: public remote/master
@ base: public default/base

@ base: public remote/base

Sync in client1 again.
$ cd $TESTTMP/client1
$ hg cloud sync -q
$ showgraph
o public1: public default/master
o public1: public remote/master
@ base: public default/base

@ base: public remote/base

Sync in client2 again (remote bookmarks sync disabled)
$ cd $TESTTMP/client2
$ hg cloud sync -q
$ showgraph
o public1: public default/master
o public1: public remote/master
@ base: public default/base

@ base: public remote/base

Advance master
$ cd $TESTTMP/server
Expand All @@ -117,23 +94,21 @@ Pull in client1 and sync
$ hg pull -q
$ hg cloud sync -q
$ showgraph
o public2: public default/master
o public2: public remote/master
o public1: public
@ base: public default/base

@ base: public remote/base

Sync in client 2 with remotebookmarks sync enabled.
$ cd $TESTTMP/client2
$ hg cloud sync -q --config commitcloud.remotebookmarkssync=true
$ showgraph
o public2: public default/master
o public2: public remote/master
o public1: public
@ base: public default/base

@ base: public remote/base

Delete the base bookmark on the server
$ cd $TESTTMP/server
Expand All @@ -143,70 +118,64 @@ Pull in client 1, which removes the base remote bookmark
$ cd $TESTTMP/client1
$ hg pull -q
$ showgraph
o public2: public default/master
o public2: public remote/master
o public1: public
@ base: public


Make an update to the cloud workspace in client 2 with remotebookmarks sync disabled
$ cd $TESTTMP/client2
$ hg book local1
$ hg cloud sync -q
$ showgraph
o public2: public default/master
o public2: public remote/master
o public1: public
@ base: public local1 default/base

@ base: public local1 remote/base

Sync in client1, deleted base bookmark remains deleted
$ cd $TESTTMP/client1
$ hg cloud sync -q
$ showgraph
o public2: public default/master
o public2: public remote/master
o public1: public
@ base: public local1


Sync in client2 with remote bookmarks sync enabled. The base bookmark
gets revived in the cloud workspace as this client didn't know that it
had been deleted on the server.
$ cd $TESTTMP/client2
$ hg cloud sync -q --config commitcloud.remotebookmarkssync=true
$ showgraph
o public2: public default/master
o public2: public remote/master
o public1: public
@ base: public local1 default/base

@ base: public local1 remote/base
Pull in client 2, base bookmark is now deleted
$ hg pull
pulling from ssh://user@dummy/server
pulling from test:server

Sync again, and this time it gets deleted.
$ hg cloud sync -q --config commitcloud.remotebookmarkssync=true
$ showgraph
o public2: public default/master
o public2: public remote/master
o public1: public
@ base: public local1


And remains deleted in client 1
$ cd $TESTTMP/client1
$ hg cloud sync -q
$ showgraph
o public2: public default/master
o public2: public remote/master
o public1: public
@ base: public local1


6 changes: 0 additions & 6 deletions eden/scm/tests/test-commitcloud-sync-rb-enabling2.t
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#modern-config-incompatible
#inprocess-hg-incompatible

#require no-eden


$ configure modern

$ newserver server
$ cd $TESTTMP/server
$ echo base > base
Expand Down
6 changes: 0 additions & 6 deletions eden/scm/tests/test-commitcloud-sync-rb-join.t
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
#modern-config-incompatible
#inprocess-hg-incompatible

#require no-eden


$ configure modern

$ showgraph() {
> hg log -G -T "{desc}: {phase} {bookmarks} {remotenames}" -r "all()"
> }
Expand Down
9 changes: 3 additions & 6 deletions eden/scm/tests/test-doctor-remotenames.t
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
#modern-config-incompatible
#inprocess-hg-incompatible

#require no-eden

$ setconfig devel.segmented-changelog-rev-compat=true
$ configure modern
$ newserver server1
$ drawdag << 'EOS'
> B
Expand Down Expand Up @@ -43,6 +39,7 @@ Cause "lag" by adding a commit:

$ hg doctor --config doctor.check-lag-threshold=1
checking internal storage
revisionstore: repaired
checking commit references
master might be lagging, running pull
checking irrelevant draft branches for the workspace 'user/test/default'
Expand All @@ -60,8 +57,8 @@ Test too many names:
$ hg log -r 'all()' -T '{desc}: {remotenames}.\n'
A: .
B: debugremote/name1 debugremote/name2 debugremote/name3.
D: remote/master.
C: .
D: remote/master.

$ hg doctor --config doctor.check-too-many-names-threshold=1
checking internal storage
Expand All @@ -73,8 +70,8 @@ Test too many names:
$ hg log -r 'all()' -T '{desc}: {remotenames}.\n'
A: .
B: .
D: remote/master.
C: .
D: remote/master.

Test less relevant branches:

Expand Down
19 changes: 3 additions & 16 deletions eden/scm/tests/test-fb-ext-debugdetectissues.t
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
#modern-config-incompatible
#inprocess-hg-incompatible

#require no-eden

$ configure modern
$ setconfig remotefilelog.cachelimit=50B remotefilelog.manifestlimit=50B

$ newserver master
$ cat >> .hg/hgrc <<EOF
> [remotefilelog]
> cachelimit = 100B
> manifestlimit = 100B
> EOF
$ hg debugdetectissues
ran issue detector 'cachesizeexceedslimit', found 0 issues
$ echo "a" > a ; hg add a ; hg commit -qAm a
Expand All @@ -20,12 +12,7 @@
$ cd ..
$ clone master shallow --config remotenames.selectivepull=false
$ cd shallow
$ cat >> .hg/hgrc <<EOF
> [remotefilelog]
> cachelimit = 100B
> manifestlimit = 100B
> EOF
$ hg debugdetectissues
ran issue detector 'cachesizeexceedslimit', found 2 issues
'cache_size_exceeds_limit': 'cache size of * exceeds configured limit of 100. 0 files skipped.' (glob)
'manifest_size_exceeds_limit': 'manifest cache size of * exceeds configured limit of 100. 0 files skipped.' (glob)
'cache_size_exceeds_limit': 'cache size of * exceeds configured limit of 50. 0 files skipped.' (glob)
'manifest_size_exceeds_limit': 'manifest cache size of * exceeds configured limit of 50. 0 files skipped.' (glob)
8 changes: 5 additions & 3 deletions eden/scm/tests/test-mutation-pushrebase.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#modern-config-incompatible
#inprocess-hg-incompatible

#require no-eden

Dummy SSH issues on Windows
#inprocess-hg-incompatible

Eagerepo doesn't support pushrebase yet.
$ rm $TESTTMP/.eagerepo

$ configure dummyssh
$ enable pushrebase amend remotenames
Expand Down
27 changes: 14 additions & 13 deletions eden/scm/tests/test-pushrebase-withmerges.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#modern-config-incompatible
#inprocess-hg-incompatible

#require no-eden

Dummy SSH issues on Windows
#inprocess-hg-incompatible

Eagerepo doesn't support pushrebase yet.
$ rm $TESTTMP/.eagerepo

Setup

Expand Down Expand Up @@ -99,14 +101,13 @@ Push in from the client.
├─╮
o merge alpha [public:a9138cc95bb3]
│ ├─╮
o │ │ merge beta [public:f71e1c3a925c]
├───╮
│ │ o other [public:7fd651906bb3]
│ │ │
o │ │ beta [public:4f90fdc3a1aa]
│ │
o │ alpha [public:c85f9ce7b342]
o base [public:d20a80d4def3]

│ │ o alpha [public:c85f9ce7b342]
│ │
o │ merge beta [public:f71e1c3a925c]
├─╮
o other [public:7fd651906bb3]
│ │
o │ beta [public:4f90fdc3a1aa]
o base [public:d20a80d4def3]
$ test -f other

0 comments on commit 317bbb4

Please sign in to comment.